8 Replies Latest reply on Feb 14, 2014 7:10 AM by Jonathan Drummey

    Dynamic Reference Line Using "In" Instead of Listing in Case Statement?

    Stacey Rothchild

      In looking around the forums I found these 2 threads that were very helpful:


      How to create dynamic reference lines based on a dimension filter?


      Dynamic Reference Lines Based on Filters - What To Do About "All"?


      However, I was wondering if you could use an "in" type statement for the calculated field instead of writing out all the values in a case statement. I have a situation where I have about 20 values that I'd like to include in the calculated field to filter on (the reference line will be based on a filter which is based on a set) and didn't want to have to use a case statement for all 20 (and if the set changes, I'll have to update the calculated field for the reference line). Does Tableau have an In statement? I couldn't find anything in my searching.


      So, what I'd love is something like CASE when [UnitName] In [MedSurgList] then [BudgetedHours} else NULL end


      MedSurgList is a set. The others are fields.