Set Actions in a Tableau dashboard can enhance the user experience, interactivity and overall value of the dashboard. New insights on the data can be made by having a Set Action that provides an easy way of altering a set in dashboard.
In this blog, we will learn what Set Actions are, how to create them and their use cases. But before that a little about Sets.
Sets:
Sets in Tableau are custom fields that define a subset of data or group the data based on predefined conditions. You can use Sets to compare and ask questions about a subset of data.
At row level, individual records are either IN/OUT of the Set.
These can be Fixed or Dynamic.
In Fixed Sets, changes in data do not affect the in/out condition of your Set.
In Dynamic Sets, when the data changes, the Set may change depending on the conditions that affect the Set.
Set Actions in Tableau, allow users to dynamically update Sets based on User interactions with the Dashboard.
Set Actions:
Set Actions in Tableau let the user to interact directly with the Dashboard to control aspects of their analysis. Based on the User selection, Set Actions can change the values in the Set.
Set Actions take an existing set and update the values contained in that Set based on User actions in a Dashboard.
To change or affect the visualization, the Set referenced in the Action must be used somehow in the visualization. This can be done in different ways, such as using the set in a calculated field that you then use to build the Dashboard, or by placing the set in the view or on a Marks card property.
Let’s now see how to create Set Action:
Here, we use ‘Sample – Superstore’ data set. So go ahead and use this as the Data Source and use ‘Orders’ sheet.
Now create a Bar Chart with ‘Sub-Category’ in Rows and ‘Sales’ in Columns. Sort it in Descending order.
Now create a Set under ‘Sub-Category’ and name it as ‘Sub-Category Set’:
Select ‘Chairs’ Sub-Category as of now:
Bring it to ‘Columns’ and to the color card under Marks:
Since we have selected only ‘Chairs’ it is shown as ‘In’ and highlighted.
These values can be changed dynamically by creating Set Actions.
But before creating Set Actions, name this as ‘Bar Chart’ and create another Chart ‘Pie Chart’ as below:
Now create a Dashboard and bring both the Charts into the Dashboard:
After required formatting, the Dashboard looks like below:
Now Create Set Action to the Dashboard:
Give the details and create Set Action:
Name: SetAction
Source Sheets: Dashboard1-> Bar Chart
Target Set: Sub-Category Set
Once the Set Action is created, the user can dynamically select/change the values in the Set.
When I selected ‘Tables’, the value changed from ‘Chairs’ to ‘Tables.
For the Pie chart to change, add the ‘Sub-Category set’ to the Color card under Marks:
You have different options on how the values are assigned to Set when “running the action” and “Clearing the selection”:
Based on the options Selected, you can Assign values to the Set, Add values to Set and Remove values to Set.
Here are the screenshots of the visualizations based on some of the options selected:
Running the action will: Assign values to set
Clearing the Selection will: Keep Set values
Running the action will: Assign values to set
Clearing the Selection will: Add all vales to set
Running the action will: Add values to Set
Clearing the Selection will: Keep Set Values
Similarly, you can use other options based on your requirement.
This is how one can dynamically change the Set values using Set Actions.
The Set Actions can be used for different Use cases. Now we will see some of them.
Use Case1 - Show a part to a whole relationship:
Data Set: Sample – Superstore -> Orders
Connect to ‘Sample – Superstore’ data set.
Create a Bar chart with ‘Region’ in ‘Rows and ‘Sales’ in ‘Columns’:
Now create another Bar chart with ‘Sub-Category’ in ‘Rows and ‘Sales’ in ‘Columns’:
Now create a ‘Set’ for ‘Region’ and select ‘Central’ as of now and drag it to color card under Marks:
If we bring the ‘Region Set’ to color card under Marks for another sheet:
The highlighted part in Blue is the sales of Sub-Categories only in ‘Central’ Region.
Now let’s make this dynamic by creating Set Actions.
For this add there 2 charts in a Dashboard:
Now create Set Action and select the Source sheets and Target set:
Now you can select the Region, and based on that the Sales under Sub-categories change accordingly.
Use Case 2 – Asymmetric drill down:
Data Set: Sample – Superstore -> Orders
Connect to ‘Sample – Superstore’ data set:
Bring ‘Category’ to ‘Rows’, ‘Order Date’ to ‘Columns’ and ‘Sales’ to ‘Text’:
Now if we bring Sub-Category to ‘Rows’, Sales are drill down to Sub-Category level.
Instead of having all the Sub-Categories, you need to drill down only at specific Category level.
i.e., when we click on one Category like ‘Furniture’, we should only see the drill down for that Category and not for other categories. This can be achieved by Set Actions.
Let’s see how:
First create a ‘Set’ for Category field and bring it to ‘Rows:
Since we selected nothing in the Set, it shows ‘Out’ for every category.
Now create a Calculated Field and bring it to Rows:
This means, when a ‘Category Set’ is selected, following Sub-Categories should be displayed.
Now create Set Action:
Now if you click on any of the Category, it will drill down only to that Category:
Use Case3 – Color Scaling:
Color values in a dashboard can be distorted by outliers. For example, when one country has significantly higher value than other countries, the nuance in differences between those non-extreme values can be lost.
Using a Set Action, the value of the relevant measure is computed only for the countries selected in the Set. Hence, when countries are selected in the map, the color palette is based only on those countries, showing greater visual differences between those values.
Let’s see how this can be achieved:
Data Set: Sample – Superstore -> Orders
Connect to ‘Sample – Superstore’ data set:
Create a Map chart using the fields ‘State’ and ‘Sales’:
From the above chart it is clear that California is having the most Sales but most of the other states are of the same color.
Now create a Set for ‘State’:
Create a Calculated field as below:
Now add the Calculated field to color card under Marks:
Only ‘Alabama’ state is highlighted since it is the one selected in the State Set.
Now create Set Action:
Now just select only the States that you want to see the Sales for, then the color palette is shown only for those selected states and hence you can clearly see which State has the most Sales.
Here is the visualization for different selections:
Conclusion:
This way Set Action feature can be used to accomplish different visualization requirements and hence is a powerful tool that can enhance the User experience and overall value of the dashboard.