DATA ANALYST
Download my resume
View My LinkedIn Profile
View My Tableau Public Profile
Sets in Tableau are used to create subsets of data based on certain conditions defined by the user. Types of sets: dynamic set, fixed set and combined set. In Tableau, sets can only be created based on dimension fields.
Here the following topics will be covered:
Global superstore orders Data used for this blog can be downloaded from here
The members of a dynamics set changes when there is a change in the underlying data. Dynamic sets can only be based on a single dimension.
Lets try to answer the question - Show the top 10 Products which has the maximum sales.
General Used to select one or more values that will be considered when computing the set. Usually the Use all/Custom value list option is used to consider all members of the dimensions and later the condition/top tab is used for selecting the filtered or required member.
Condition Use the Condition tab to define rules that determine what members to include in the set. Set conditions work the same as filter conditions.
Example: Condition to select only those products which has profit more than $4000. (Wont be using this tab’s conditon in the main question defined above)
Now following with the question, set condition to None.
When finished click OK. The new set is added to the bottom of the Data pane, under the Sets section.
Now lets observe the effect of sets. Drop the Product Name dimension to the rows shelf. And drag measure Sales to the Text in marks card and we get total sales for each Product. Then drag the set Top 10 Products with max sales to the filter and we get the top 10 Products which has the maximum sales.
The members of a fixed set do not change. A fixed set can be based on a single dimension or multiple dimensions. This is particularly useful when we want to focus particularly on selected memebers of considered dimensions.
To create a fixed set:
To see the states which are in the top 10 of both highest sales and highest profits.
Created a set which has top 10 states with the highest sales in US-
Created a set which has top 10 states with highest profits in US-
Resultant sets in the sets section
Right click on either of the 2 sets and select create combined set.
Combined set creation dialog box
Result of combined set has states common to both in the sets with
Image source: Tableau blog - 8 ways to bring powerful new comparisons to viz audiences with Tableau set actions
With Set Actions, it is possible to dynamically pass dimension values to existing sets based on value selection from other visualizations by user. Like parameters, set action allows user to control different aspects of analysis.
With Set Actions implemented, the values in the Set, change based on the selection from source sheet.
A set can apply different behaviours to various target sheets. For example, the same set could colour viz A, hide data in viz B, and filter an axis in viz C. Now with set actions, a user selection in any of the sheets can update the set, thereby modifying all target sheets in a single coordinated selection.