Drilldown is a function of tableau; it gives the user a capability to go from a specific view to a more detailed view. This drilldown is hierarchical. For example, if you wanted to explore about profits of a product in different countries, you can make drilldowns to the levels of states and cities. There are a lot of advantages of using drilldowns in your visualization. First, it provides deeper insights into your visualization. When you dig deeper, it gives you another perspective of what it is and why it is, instantly and easily. In short, drilldowns help you investigate data in multiple layers by just a click within same sheet without having to make different visualizations for each level.

Let’s look at an example. In this example I will be using sample superstore data from saved tableau data sources. In this data, there are multiple hierarchical data that can be explored and drilldown. I will be using Product hierarchy in my example.

I will make a hierarchy that will go from category to subcategory and then finally to manufacturer

First, you need to make a set by clicking on category named “Category set”. I will be using general and use all to make the set. Then you would need to create a calculated field that will tell tableau to drilldown from category to subcategory. The calculated field called category drilldown will include the formula as below

IIF([category set], [subcategory], “”)

This reads as if I click on a category which is in set give me the subcategory for that category else nothing.

Figure 1: Creating Category Set

Figure 2: Creating calculated field for category drilldown

Now from this calculated field, I will make another set which I will name as “Category drilldown set”

Then I will make another calculated field called subcategory drilldown like as follows

IIF([category set] and [subcategory drilldown set], [manufacturer], “”)

This will drilldown my subcategory field to its manufacturer

Figure 3: Demonstrating how to create the second set

Figure 4: Creating the second level of drilldown set category drilldown set

Figure 5: Creating calculated field to drilldown to manufacturers

Now for this drilldown to work, you will need to have all of these on your canvas like as follows. You can click on in/out sets and uncheck show header so that the drilldown looks cleaner. In this way you will still have them in your view since you need them in order for it to work and they will be hidden

Figure 6: Demonstration of what is needed on canvas for drilldowns to work

Another important step for this to work is to add action to the worksheet. This is how it looks when we don’t have anything open in our drilldowns. Following actions are needed

Figure 7: Sets Action for Category to Subcategory 

Figure 8: Set Action for Subcategory to Manufacturer

This is how it looks when we don’t have anything open in our drilldowns.

Figure 9: Canvas ready for drilldown

After adding the actions (important step for drilldown to work) when I click on category, it will expand to its respective subcategory and then when I further click on subcategory it will expand to its respective manufacturers like as follows.

Figure10: Demonstration of drilldown from cat to subcategory

Figure 11: Demonstration of drilldown from subcategory to manufacturer



Maliha Athar
Author: Maliha Athar