I'm a key believer in returning to the fundamentals, which sometimes allow us to question our routines and biases. I've personally never liked using CASE statements (for not being as explicit as IF) in tableau but never really understood how it differed from If statements so this was a big help...in confirming why I don't like them lol.
I agree that case are less familiar. What I write for myself will sometimes be different than my audience. If I suspect they might not understand CASE, I'll us an IF.
Thank you for the video. I learned a couple of new things! One thing that I've struggled with as SQL user in Tableau is the structure of the case statements. I use "IN" often to match against multiple values (case when [field] in ('value1', 'value2', etc.)...) and I haven't found a way to do this in Tableau without creating a when/then for each value. Perhaps there's a better way?
Can you make a video about the efficiency of each function as well? Because I'm comfortable using any of these functions, but maybe I want to use a CASE statement rather than an IF statement because Tableau processes it faster, or something like that.
That's completely dependent on your data source. One thing to keep in mind is that IF statements always check a true/false condition whereas a CASE compares to a string. I would expect an IF to be faster.
Hi Andy, love your videos. keep up the great work. A request here, can you please make a video on most common functions and scenarios you must have come across till now. I mean the most used date functions, logical functions etc. If not video may be blog or something. In case you have already done something like that kindly guide me to the link or resource. Thanks and again appreciate what you are doing for community.
Someone else pointed that out to me today too. I didn't know they could be written that way. I find the logic tougher to follow than an IF would be though.
I'm a key believer in returning to the fundamentals, which sometimes allow us to question our routines and biases. I've personally never liked using CASE statements (for not being as explicit as IF) in tableau but never really understood how it differed from If statements so this was a big help...in confirming why I don't like them lol.
I agree that case are less familiar. What I write for myself will sometimes be different than my audience. If I suspect they might not understand CASE, I'll us an IF.
These videos are such an amazing step up in production quality. Love it! Keep 'em coming, Andy
Cheers Andy! I wish I had hired an editor ages ago.
Thanks Andy. You and Donabel Santos are the best on Tableau stuff
Glad you like them!
thank you so much Andy .I just started watching your videos .I love how you shared multiple information in a single video . Many thanks for the video
You are very welcome
Thank you for the video. I learned a couple of new things! One thing that I've struggled with as SQL user in Tableau is the structure of the case statements. I use "IN" often to match against multiple values (case when [field] in ('value1', 'value2', etc.)...) and I haven't found a way to do this in Tableau without creating a when/then for each value. Perhaps there's a better way?
IN is a function indeed. I would use it in an IF statement instead.
Dan:
---
CASE [Region]
WHEN IN ('East','West') THEN [Sales]
END
---
or you can do it in a simple one row:
IIF(Region IN ('East','West'),[Sales],0)
Can you make a video about the efficiency of each function as well? Because I'm comfortable using any of these functions, but maybe I want to use a CASE statement rather than an IF statement because Tableau processes it faster, or something like that.
That's completely dependent on your data source. One thing to keep in mind is that IF statements always check a true/false condition whereas a CASE compares to a string. I would expect an IF to be faster.
Thank you for this great video lesson)
Hi Andy, love your videos. keep up the great work. A request here, can you please make a video on most common functions and scenarios you must have come across till now. I mean the most used date functions, logical functions etc. If not video may be blog or something. In case you have already done something like that kindly guide me to the link or resource. Thanks and again appreciate what you are doing for community.
That's really an impossible question to answer. I posted a video last week on date functions.
Very helpful. Quick tips for fast life 😄
Glad you think so!
Love those "fundamental" videos. I'm emberassed to say, but I failed to predict the Null output for IF THEN w/o ELSE.
Is there a performance difference between if and case?
Negligible performance benefits for a case statement.
In some cases I do something like that:
CASE TRUE
WHEN [Sales]>=0 THEN 'High sales'
WHEN [Sales]
Someone else pointed that out to me today too. I didn't know they could be written that way. I find the logic tougher to follow than an IF would be though.
hi Andy kriebel very good explain basics of calculations
Glad it was helpful!
Great vídeo!!!
Why did tableau have to restructure Case statements. It’s one of the many reasons I like it much less than any other vis tool
I don't follow. How was it restructured? Do you mean the syntax is different than other tools?
@@vizwiz yes. We all familiar with case when then… case [field] when = x
Just stick to the standards tabby please
Interesting.
Glad you think so!
IIF() should have been called ITE(). There, I said it.
🤦🏻♂️