Data is powerful. It can give you access to tremendous potential to make effective decisions through data insights. But how can we access this potential at just a glance?

When designing a data visualisation that you’d like to digest quickly and use in a professional setting, space is at a premium, and we should be able to gain data insights quickly. One method to do this is by using a Set Action.
Why a Set Action? Using this method you’re able to keep all the information on one chart, meaning we can gain the insight we want while also preserving our precious dashboard space.
In this post, I’ll be showing you step-by-step how to use a set action to drill down using the Tableau superstore data set. But if you swap out my variables for yours, you’ll be able to get the same effect for your own dashboard. Let’s begin!

Exploring Data Insights From a Two-Level Drilldown in Tableau

Step 1: Create our Sales by Category chart

First, we’ll make a simple bar chart for sales per category. This will be the base of the chart that we want to drilldown into. It is important to note that the dimension we want to drilldown in is above other categories in a hierarchy.

Bar Chart in Tableau of Sales By Category

Basic bar chart of Sales by Category

Step 2: Create a Set of the items we want to drilldown into

For step 2, we need to begin creating the set of the dimension we wish to dive into. I’ll mention again, the dimension we are drilling down into must be in a hierarchy and above at least one other dimension. Since in this example I’m using the Category dimension, I’ll be creating a Category set. I’ll tick one of the categories on the sheet.

Create Set menu in Tableau

Create a set for the category dimension

Step 3: Create the drilldown calculated field

Now that the Category set has been created, the next step is to create a calculated field that selects sub-categories for our selected category. In my example, I’ve created the following.

Calculated Field in Tableau for the Sub-Category drilldown

The calculated field should be an if statement, saying if the field in our set is selected, then drilldown and display the next level of data. Otherwise, just display the normal data in our chart. We’ll drag this into our chart after the dimension we’re drilling down into. In this case, it will be after category.

Step 4: Sort the Sub-Category Drilldown Field

The very last stage is to sort the chart that we’ve created with our drilldown. After doing this, people consuming our dashboard will be able to easily gain meaningful insight from the data at a glance, and see both high and low-performers, and drilldown into interesting details. We do this by right-clicking on our drilldown calculated field, and selecting sort.

Sort menu for Sub-Category Drilldown calculated field to make data insights clearer

Sort sales by descending for the sub-category drilldown 

When doing this, make sure to pick the same sort order as what you’ve selected for the rest of the chart.

Sales by Category chart with drill down calculated field dragged in, allows drilldown to give further data insights.

Your chart should look similar to this in your sheet or dashboard. And when in action, you’ll be able to click on a category either on the axis or one of the bars on the chart to drill down via a set action. I’ll create the set action now.

Step 6: Create the Set Action to create the interactive effect

This is the final step in creating a two-level drilldown effect for your chart in Tableau. We get to this menu by either selecting ‘Dashboard’ along the top toolbar, and ‘Actions’, or with Ctrl+Shift+D. From here I’ll click ‘Add Action’ and ‘Change Set Values’ to create our Set Action. I use the following configuration:

Set Action Config

I select the source sheet, being the chart that we want to add this action too. I’ve left that as Sheet 1. I’ve also made sure that I run the action on select, as I don’t want the drilldowns to change just by hovering the cursor over the bars.  I select the target set that we created back in step 2, which is where we pick what we want to drilldown into. Finally, I make sure I’ve selected assign values to set, so only one category is being expanded upon at once, and I decided to keep set values if you click off the category.GIF of chart interactivity giving better data insights

Done! The final effect should be something similar to this. Of course, you’ll be able to improve both the chart and any actions in your own time, but this was a basic introduction to a set action that allows you to drilldown into a chart and gain more insight and understanding from just one chart.

If you’d like to see gain further understanding of set actions, Tableau have a wiki article on their help. Or if you’d like more inspiration about more functionality you can add with set actions, check out this video from Andy Kriebel.

However, there are other ways to add interactivity. Fellow Data Schooler Kristiadi Uisan has a great post about all the types of interactivity you can add to your dashboards with actions that you can find here!

You’ll now be able to gain better data insights with this two level drilldown in Tableau via set action. Stay tuned for more tutorials and tips in the future!

The Data School
Author: The Data School