September 15, 2012
Tableau Tip: Adding an “All” filter option to a string parameter
I always was under the assumption that you could not have an “All” option in a parameter to make it act like a compact list filter, but I was wrong.
I was working with a n00b Tableau user at work answering his questions. He was building a tag analysis dashboard and was using a parameter that listed all of the tags, but then had an “All” option at the top. I completely changed the discussion and asked how he did it, and it’s so simple.
Step 1: Add the field you want to filter to the Rows shelf. I’m only doing this so that you can see how it works along the way. I’m using Sub-Category.
Step 2: Right-click on the field you want to use as a filter and choose Create Parameter. The advantage of right-clicking on the field you want to build the parameter on is that the list of values is pre-populated. Add (All) to the list of values. I use the format (All) so that the parameter looks like a compact list filter. I then rearranged the order so that (All) is at the top of the list.
Step 3: Right-click on the parameter and choose “Show Parameter Control”. It should pop up on the right side of the view.
Step 4: In order to use the parameter as a filter, you have to create a calculated field.
Essentially what happens is that if the user picks (All) there’s nothing to filter, so it shows all sub-categories. Iff the user picks a sub-category, then that is passed to the filter.
Step 5: Drag the Sub-Category filter to the Filters shelf and select the True option.
That’s it! To see it in action, pick something from your parameter, then change it back to (All). So super cool!
Literally about 1 minute of work. I know I’m going to use this technique many, many times now. Thanks to the n00b that showed me the light! I love learning new tricks.
Download the sample Tableau workbook here.