In a previous blog, I went over how you can create multiple select parameters in Tableau. Just as its name suggests, multiple select parameters allows users to select more than one parameter. It provides a ton of flexibility around parameter functionality and design on dashboards.
However, in that blog post, I did not cover how to add an “ALL” option since that requires a few more additional steps.
In this post, I go over how you can create an “ALL” option to include on your dashboard.
Why Include an “ALL” Option?
Depending on your needs and requirements, including an “ALL” option offers more flexibility for how users interact with the data. Say you have quite a long list of parameter selections and you wanted to view all of them. It can be cumbersome to click through one by one to select all of the parameters.
We can resolve that by including an “ALL” option in our list of parameters.
How to Create an “ALL” Option for Multiple Select Parameters
You will find that a lot of the steps are very similar to the steps in my post on creating multiple select parameters. What’s new is that some of the calculations we need to create are a bit different, we need to create an additional sheet for the “ALL” selection button, and add two additional actions on our dashboard.
Step 1: Create a Data Visualization to Apply the Parameter on
Connect to Sample Super Store data
Drag [Longitude] onto columns
Drag [Latitude] onto rows
Drag [Profit] onto the colors mark
Drag [State] field onto details mark.
Step 2: Create the Parameter
Create a new parameter with the following settings:
Name: Subcat Parameter
Data Type: String
Current Value: ALL (in all caps)
Value when workbook opens: Current Value
Allowable values: All
Step 3: Create 5 New Calculations that Will be Used in our Sheets
CONTAINS([Subcat Parameter], [Sub-Category])
OR [Subcat Parameter] = "ALL"
REPLACE(IF CONTAINS([Subcat Parameter], [Sub-Category])
THEN REPLACE([Subcat Parameter], [Sub-Category] + ",","")
ELSE [Subcat Parameter] + [Sub-Category] + ", "
END,"ALL","")
IF [Subcat Parameter] = "ALL" THEN "•" ELSE "◦" END
FALSE
TRUE
Step 4: Build the “ALL” Selection Option
Drag the [Subcat Param ALL] calculation you created onto the rows shelf.
Place the [TRUE] and [FALSE] fields onto the details mark.
Add ‘ALL’ to the texts mark.
Step 5: Create a New Sheet to Build out our List of Parameters
Refer to the “How to Create Multiple Select Parameters” article on how to build out this view.
What is different in this step though, is adding the [Subcat TF] calculation we created in Step 3 onto the colors mark instead of the original TF calc in the part 1 blog.
Step 6: Add the TF Calculation Onto the Filters Shelf for the Data Visualization
Go back to our main visualization we created in step 1, and add the [Subcat TF] field onto the filters shelf and select True.
Step 7: Create the Dashboard
Now, you can put your dashboard together and place all three sheets into the view. Combine the Subcat ALL sheet and the Subcat sheet into a vertical container, then edit the heights so that it looks like the filter list below in the screenshot of the final result.
Step 8: Add Four Dashboard Actions
1 – Subcat Action:
Create parameter action
Name: Subcat Action
Source Sheet: Subcat
Run Action on: Select
Target Parameter: Subcat Parameter
Source Field: Subcat Param Action
Aggregation: None
Clearing the selection will: Keep current value
2 – Subcat Action ALL:
Create parameter action
Name: Subcat Action ALL
Source Sheet: Subcat ALL
Run Action on: Select
Target Parameter: Subcat Parameter
Source Field: ‘ALL’
Aggregation: None
Clearing the selection will: Keep current value
3 – Deselect Subcat:
Create filter action
Name: Deselect Subcat
Source Sheet: Subcat
Run Action on: Select
Target Sheet: Subcat
Clearing the selection will: Show all Values
Filter: Source field set to TRUE and Target field set to FALSE
4 – Deselect Subcat ALL:
-
Create filter action
-
Name: Deselect Subcat ALL
-
Source Sheet: Subcat ALL
-
Run Action on: Select
-
Target Sheet: Subcat ALL
-
Clearing the selection will: Show all Values
-
Filter: Source field set to TRUE and Target field set to FALSE
Final Result
…And voila! You should now have a dashboard with multiple select parameters and an “ALL” selection option.
Takeaways
Multi-select parameters are a must for Tableau, and the ability to add an “ALL” option just provides more options on how users can interact with the dashboard. Something to consider though is that if your list of parameters might have a string that contains “all” in it such as “Overalls,” Tableau will not be able to tell the difference.
A workaround is to include a special character for “ALL” such as “[ALL]” or “%ALL” when building the calculations, labels, and inputting “ALL” into the parameter, so that way it will not catch strings that happen to have “all” in it.
Beyond that, we hope this enhances your visualizations and gets your users exactly what they need!
Interested in learning more about the data visualization tools in Tableau?
Reach out to phData’s team of Tableau experts today to have all your questions answered!