Cascading parameters, or parameter list values that change depending on what is selected in other parameters, is something that has a lot of use cases, but at this point, at least when this blog post was written, is not supported in Tableau. Cascading filters are possible, but often times you need to leverage the selected values, like you can with a parameter. There are a couple of ways that you can mimic the functionality of “Cascading Parameters” leveraging Dashboard Actions and Collapsible Containers. This post focuses on how to use Set Actions.
Setting Up Your “Parameters“
- Drag a floating Blank object onto your dashboard. Set height to ~30 pixels and set width as desired. Add color and border as desired.
- Drag a floating Container onto your dashboard. Set the width equal to the width of the Blank object. Align the Container under the Blank object so they are overlapping slightly
- Click on the Container, open the drop-down in the top right corner, and select “Add Show/Hide Button”
- Drag the Button onto the Blank object
- Repeat for as many “parameters” as necessary
- Create a new worksheet for each of your “Parameter” fields
- Change the Mark Type to “Polygon”
- Drag your field onto Rows
- Format text as desired (recommend size 9 font)
- Remove header and and any row/column lines
- Add Worksheets to floating Containers on Dashboard
- Select Tiled in the Object Pane on your Dashboard
- Drag your worksheet into the floating Container created in the previous steps
- Format your worksheet
- Hide Title
- Add a Border that matches the border of your Blank object
- Adjust the Outer Padding so the top is set to 4 and all other directions are set to 0
- Repeat for each “Parameter”
Adding Sets, Actions, and Filters
- Create a Set for each of the “Parameters”. To do this, go to any worksheet, right click on the field to use in the “Parameter” and select “Create Set”.
- Rename the set “Set – [Field Name]”
- When prompted, click the “All” option to include all values in your initial set. Repeat for each field.
- Create a Dashboard Set Action for each of your Sets
- In the dashboard, click on “Dashboard” in the upper ribbon and select “Actions”.
- When prompted, click “Add Action” and select “Change Set Values”
- Under “Source Sheets”, select the worksheet that is in the floating Container
- Under “Target Set”, select the corresponding Set that was created in the previous step
- Under “Clearing the Action Will”, select “Add All Values”
- Under “Run Action On”, select “Select”
- Repeat for each Set
- Add filters to each of your “Parameter” worksheets
- For this example, we will have 3 “Parameters” in our Heirarchy; Region, State, and City. When we click on a Region, we only want to see States in that Region in the second “Parameter”. Then when we click on a State, we only want to see the Cities in that State
- No Filters are required in the 1st “Parameter” in your Hierarchy
- In the second “Parameter” worksheet, drag the set for the first field in your Hierarchy to the Filter shelf
- In this case, in the “State” worksheet, we will drag the “Region” set to the Filter shelf
- In the third “Parameter” worksheet, drag the sets for the first and second fields in your Hierarchy to the Filter shelf
- In this case, in the “City” worksheet, we will drag the “Region” and State” sets to the Filter shelf
- Create Calculations to retrieve the value selected in each of the sets. This value can then be used in other calculated fields, titles, headers, etc.
- Create a calculated field called “Set Value – [Field]”
- if { FIXED : COUNTD([Set – Region])}=1 then “Select a Region”
else { FIXED : MIN(if [Set – Region] then [Region] end)} END - The first portion of this calculation tests the set to determine if any one value has been added or if the set still contains All values. If no value has been added, the calculation will return “Select a Region”.
- The second portion of this calculation will return the value that has been added to the set (if one has been added)
- Repeat for each of your sets
- Create a new worksheet for each of your “Parameters” to use as a Label
- Change Mark Type to “Text”
- Drag your “Set Value – [Field]” calculation to Text
- Format text as desired (9 or 10 point font recommended)
- Align the text (Left, Center)
- Repeat for each of your “Parameters”
- Add your Label worksheets to the Blank objects in your “Parameters
- Select “Floating” in the Object pane on your dashboard
- Drag your Label worksheet over the Blank object
- Resize object. Set height to 8-10 pixels shorter than your Blank object. Set width so it begins near the left edge of the Blank object and stops before the Container Button
- Repeat for each “Parameter”
“Cascading Parameters”
At this point you should have working “Cascading Parameters”. The only thing left to do is to add filters to the worksheets in your dashboard. You can do this by either adding all of the Sets on to the Filter shelf in each of the worksheets, or you can create a calculated field, so you only need to add one field to the filter shelf. The calculation for this field in this example would be “[Set – Region] and [Set – State] [and Set – City]”. And now you should have a functioning dashboard with “Cascading Parameters” using Set Actions
This would not have been possible in Tableau until very recently. I remembered years ago trying to figure out a workaround for this and couldn’t come up with anything. But thanks to recent Tableau releases including Set Actions and Collapsible Containers, as well as some inspiration from Lindsey Poulter’s incredible 2019 Iron Viz Performance, we can now mimic the functionality of “Cascading Parameters” with relatively little effort.