Tableau Set is a custom filed used to hold the subset of a data based on some condition. In real-time Tableau set can be created by selecting members from the list. Or By writing custom Condition or Selecting Top or Bottom few records based on Measure value so on.
Sets in tableau can be very helpful for instance, To create Top 10 States by profit, Sales Amount greater than the minimum threshold, Products with negative profits etc
In this article, we will show you, How to Create Tableau Set with an example. For this, we are going to use the Super Store sample excel file downloaded from the Tableau website. Please visit Connecting to Excel Files in Tableau article to understand the, How to connect and extract data from Excel file
Create Tableau Set Example
In this example, we will show you, How to create Tableau Set, Constant Sets and Computed Sets. First, Drag and Drop the State Name from Dimension Region to Rows Shelf and Profit from Measures region to Columns Shelf.
How to Create Constant Set in Tableau
The Tableau Constant Set members are fixed and once created they don’t change. In order to create Constant Set in Tableau, Please select the members you want to include in your settings and select the Set Icon present in the tooltip and click the Create Set… option as shown below.
Once you click on Create Set.. option, a new window will be opened as shown in the below screenshot.
- Name: Please specify the Unique name for this tableau set. Make sure, the name should reflect the set functionality. For now, we named this set as Random 10 States
- Members: Members we selected in our previous step. If you want to remove any member, Please select the member value and click on the cross button
- Add to Filters shelf: Please check mark this option, If you want to add this set to Filters Shelf
Click OK to finish creating our first Tableau Set. From the below screenshot you can observe that Our newly created Set is positioned within the Data pane
Please Drag and drop the newly created set (Random 10 States) from Sets region to Row Shelf. Next, Remove the existing State names from Row Shelf.
From the below screenshot you can observe that Our tableau report is displaying the In and Out rows only. This is because By default tableau will display the set values as:
- IN: All the members we selected for creating Set will be placed in IN filed. It means 103,620 is the total profit of our randomly selected 10 states
- OUT: Remaining members will be placed in OUT filed.
In order to show the state names (or Set members), Click on the Drop down arrow in the upper right corner of the IN/OUT (Random 10 States) member present in the Row Shelf and select the Show Members in Set option from the Drop down menu as shown below
From the below screenshot you can see the State members present in the Tableau Set
If you want to check the States names inside the IN filed and OUT filed then Please, Drag and drop the newly created set (Random 10 Products) from Sets region to Row Shelf. Next, Drag and drop the State filed from dimension region to Row Shelf.
How to Create Computed Set in Tableau
The Tableau Computed Set members are dynamic and they change when the underlying data changes. In order to create Computed Set in Tableau, Please select the Dimension on which you want to create your Set and then, Right click on it will open the context menu. Please select Create option and then select Set.. option from the context menu as shown below
Once you select Set.. option, a new window called Create Set was opened to create Computed Set in tableau. We have multiple options in this window as shown below
- Name: Please specify the Unique name for the Tableau set. Make sure, the name should reflect the set functionality.
- General Tab: Use this tab to select the required members from the available list.
- Top: This is to select all the Top and Bottom few records. For instance, Top 10 or bottom 10 records based on Profits.
- Condition: Used this tab to write the custom condition. For instance, Profit greater than 10000 etc
- All: This select All the available members from the list
- None: Use this to deselect All the selected members
- Summary: It will display the information regarding the set. This includes Field name, Condition we used and the number of records we selected from the Total number of records etc
Tableau Set General Tab
Within the General tab of a tableau sets, we have three more options:
- Select from List: This option allows you to choose the required members from the available list.
- Custom Value List: This option allows you to write Custom members.
- Use all: This option allows you to select All the available members from the list
Custom Value List option in Tableau Set
We just added three random records here. In real-time you have to write the existing values only.
Click OK to finish creating our Tableau Set.
How to Edit Tableau Set
In order to edit the existing sets, Please click on the Drop down arrow in the upper right corner of the Set name and select the Edit Set… option from the context menu as shown below
Once you select the Edit Set… option, a new window will be opened to edit the existing set.
Use All section option in Tableau Set
Once you select this option, there is nothing you can do because this option will select All the available members from the list
Click OK to finish editing the existing Set. Please Drag the newly created set (Example Set) from Sets region to Row Shelf and place it before the State filed as shown below.
How to Delete Tableau Set
In order to delete the existing set in Tableau, Please click on the Drop down arrow in the upper right corner of the Set name and select the Delete option from the context menu as shown below
Tableau Set Select From List
In this example, we will create one more set to select the random 6 States from the available state members in tableau. To do this, Please navigate to the General tab and select the Select from List radio button and select required state members from the available list.
Please Drag the newly created set (Random 6 States) from Sets region to Row Shelf and place it before the State filed as shown below.
From the above listing, you can observe that California, Delaware, District of Columbia, Georgia, Idaho and Indiana are listed in IN section because these are the states we selected when we created our Set.
Tableau Set Condition Tab
In this example, we will create one more set to find the States generating Positive Profits. To do this, Please navigate to Condition tab and select the By Field radio button and select SUM of Profit greater than or equal to 0 as shown below.
Click OK to finish creating new Set in Tableau. Let us replace the Random 6 States set with our newly created set, called States with Positive Profits and see the result.
From the above listing, you can see all the states with positive profits are placed in IN filed and Negative profits are placed in Out Filed
Tableau Set Top 10 Tab
In this example, we will create one more Tableau set to find the Top 10 States generating highest Profits. To do this, Please navigate to Top tab and select the By Field radio button and add constant 10 value as shown below.
TIP: If you want to make this dynamic then, replace the 10 value with Parameter name. Please refer Tableau Parameters article for understanding the creation and use of parameters
Click OK to finish creating new Set in Tableau. Let us replace the States with Positive Profits set with our newly created set, called Top 10 States by profits and see the result.
From the above listing, you can observe that California, Delaware, Georgia, Indiana, Kentucky, Michigan, Minnesota, New York, Virginia and Washington are in the Top 10 list according to their profits.
TIP: Please refer Combined Tableau Sets article to understand the creation of Combined Sets in Tableau