This blog shall outline how to only show the values that in one filter that correspond to a value selected in another filter. This ensures that the user can only select values that are applicable to the first value selected.
In the example data there are three filters for Year, Category and Speaker to generate a list of 3 recommended talks for the user to watch based on these filters. However, the categories change year on year and the speakers change depending on the category. This can result in a long list of values some of which may not apply to the year ( this will impact the category and speaker category) or category (this will impact the speaker filter) selected. This not only looks messy on the dashboard but can lead to confusion if the user clicks on a category or speaker that wasn’t there for the chosen year as the view would just be blank.
To fix this on the dropdown menu in both the Category and Speak filter switch the option from “All Values in Data base” to “Only Relevant Values”. Now when 2019 is selected the list of categories is shorter only showing the categories that took place in 2019 and only the speakers that spoke in 2019, if no category is selected. When the category is selected the speakers list shall only show the speakers that apply to the category selected and that spoke in 2019.
These filters should be applied to context in the worksheet. Right click the filter in the filters card in the worksheet where the filters are applied and click on add to context.
There is a potential problem with using ‘Only Relevant Values’ that is important to remember. If it is set for all three filters, Year, Category, Speaker, then if a category or speaker value has been selected then the year filter will only have one or two values that apply to the category or speaker value selected. Therefore if I want to select different year to see who spoke that year or what categories are available I would have to clear all filters or select all in category and speaker. This makes it slightly confusing and difficult at times for the end user when trying to navigate to a particular video selection. This is currently a problem for category and speaker filters, where selecting a speaker reduces category values shown and selecting a category reduces the speaker values show, but for the dashboard purpose it was not an issue. Therefore, the ‘Only Relevant Values’ only works well when the filters are in a clear hierarchy in this example Year → Category → Speaker. The first filter in the hierarchy, in this case Year, should therefore ‘Keep All Values in the Database’.
If you want to learn more about hierarchies in Tableau and how they work I recommend this article: https://help.tableau.com/current/pro/desktop/en-us/order_of_operations.htm