Tableau Set

What is a Tableau Set?

Tableau Sets are custom fields that allow you to define a subset of data using a customized set of conditions. They enable you to compare and ask questions about a subset of data. For example, you can create a set of top 10 members (business partners) who have contributed to the maximum to the organization’s overall revenue or members who have an average net profit of $5000, etc.

Key Takeaways
  • Tableau Sets are custom fields to define a subset of data using a defined set of conditions that allow you to compare and ask questions about a subset of data. 
  • You can create two types of sets in Tableau, i.e., Dynamic sets and Fixed sets.
  • You can create, edit, and remove a set in Tableau.
  • Tableau supports creating a flexible and interactive set by using the sets in set actions. 
  • You can also add or edit a set control in Tableau.
  • Tableau provides a key feature where you can combine two sets into a single set, known as a combined set.

How to Create a Set in Tableau?

Tableau supports two ways of creating sets. These include:

  • Dynamic Sets
  • Fixed/Static Sets

#1 – Dynamic Sets

Dynamic Sets work with a single dimension and are flexible. The members of a dynamic set change if the underlying data changes.

To create a Dynamic Sets in Tableau, follow the instructions shown below:

Step 1: Connect your dataset to the Tableau interface.

Step 2: In the Data pane, right-click a field. Select CreateSet.

Tableau Set - Dynamic sets - Step 2

Step 3: Tableau will open a Create Set dialog box where you can configure your set.

Tableau Set - Dynamic sets - Step 3

There are three different tabs available.

General – This tab provides three different options to choose members. 

Tableau Set - Dynamic sets - Step 3 - General

You can use one of the below options to select values for your set

  • Select from the list
  • Custom value list
  • Use all

Note: Use all will ensure that all the members, regardless of whether newly added or removed, will always be included in the set.

Condition – This can help to specify a rule-based approach to identify the members to be included in the set.

For example, Specify the condition to include only those members in the set where the total net profit is over $1000.

Tableau Set - Dynamic sets - Step 3 - Condition

Top – This can be useful to determine members based on limits. 

For example, include the top 10 members in your set based on their net profits.

Tableau Set - Dynamic sets - Step 3 - Top

Step 4: Click on OK. Tableau will create the members visible in the Data pane.

Tableau Set - Dynamic sets - Step 4

#2 – Fixed/Static Sets

In the case of Fixed/Static Sets, the members don’t change regardless of whether the underlying data changes or not. These sets work with single and multiple dimensions.

To create a Fixed/Static Set in Tableau, follow the instructions outlined below:

Step 1: Create a data visualization in Tableau.

Tableau Set - Fixed sets

Step 2: In the view, select the marks as shown below.

Tableau Set - Fixed sets - Step 2

Step 3: Right-click on the view. In the tooltip window that appears, click on the Set icon and choose Create Set.

Tableau Set - Fixed sets - Step 3

Step 4: In the Create Set dialog box, specify a name.

Tableau Set - Fixed sets - Step 4

Tableau provides additional features such as 

  • Exclude to exclude any members listed by default in the dialog box
  • Remove any members you want by clicking on the X icon that appears when you hover the mouse over any row
Tableau Set - Fixed sets - Step 4 - Features
  • The same applies to columns you want to remove by hovering the mouse over any column.
Tableau Set - Fixed sets - Step 4 - Column
  • Choose the option Separate members by to separate the dimension values.
  • Use the option Add to Filter shelf to automatically move the set to the Filters shelf once it is created.

Step 5: Once the set is created, it will be visible in the Data pane.

Tableau Set - Fixed sets - Step 5

Note: You can perform Tableau set default filter value for your dashboard to set the initial filter when a user opens your dashboard. Tableau Set Filter Based on Parameter allows you to control a filter using the parameter you have created dynamically. 

How to edit a set in Tableau?

You can edit an existing set in Tableau to add/remove data points, change the conditions, or amend the list of members in the set.

To edit an existing set in Tableau, follow the steps highlighted below:

Step 1: In the Data pane, select the set you want to edit and right-click on it. From the context menu, choose the Edit Set…

Tableau set - Edit - Step 1

Step 2: In the Edit Set dialog box, amend the condition for the members.

Here, we have changed the condition from Net Profit to Revenue, where we will include the members who have Revenue over $5000.

Tableau Set - Edit - Step 2

Step 3: Click on OK. Tableau will amend the Set as per your specified changes.

Note: You can perform a Tableau Set Action Drill Down where your users’ action in the Tableau view can trigger a filter to perform specific actions.

Examples

In this section, let us see some examples demonstrating the functionality of Tableau sets.

Example #1 – Tableau sets as a filter

In this example, we will see how to use Tableau sets as a filter using the World Happiness Report_Feb24 dataset. The dataset contains information such as country name, Life ladder, Social support, and other details to calculate the happiness index.

To use Tableau sets as a filter, follow the steps below:

Step 1: Connect with the United States Store Sales Data to the Tableau interface using the File Navigator. 

Tableau Set - Example 1 - Step 1

Step 2: Right-click on a field you want to create a set. Select Create – Set.

Tableau Set - Example 1 - Step 2

Step 3: In the Create Set dialog box, specify the logic. Here, we have created a set of top 20 happiest countries based on the healthy life expectancy at birth.

Tableau Set - Example 1 - Step 3

The newly created set is visible in the Data pane.

Tableau Set - Example 1 - Step 3 - Data pane

Step 4: Create a data visualization by dragging and dropping the fields, i.e., Healthy life expectancy and Country name, to the Rows and Columns shelf, respectively.

Tableau Set - Example 1 - Step 4

Step 5: Now add the newly created set to the Filters shelf. Tableau will filter the view as per the members of the set.

Tableau Set - Example 1 - Step 5

Example #2 – Tableau sets as a dimension

In this example, we will demonstrate using Tableau sets as a dimension using the Attendance_2023-2024 dataset, which contains detailed information on women’s football covering attendance across various stadiums globally along with teams, leagues, etc..

To use Tableau sets as a dimension, follow the guidance below:

Step 1: Import the Attendance_2023-2024 into the Tableau desktop.

Step 2: Right-click on a field and select Create – Set.

Example 2 - Step 2

Step 3: In the Create Set dialog box, specify the condition for the set. Here, we have created a list of the Top 10 Stadiums by Attendance.

Example 2 - Step 3

Step 4: Drag and drop the measures (Capacity and Total) to the Columns shelf and Dimension (Team) to the Rows shelf.

Example 2 - Step 4

Step 5: Drag the set to the Filters.

Tableau Set - Example 2 - Step 5

Step 6: Right-click on the set (Top 10 Stadium by attendance) and select the Show In/Out of set.

Tableau Set - Example 2 - Step 6

In the Filter dialog box that appears on the screen, choose In.

Tableau Set - Example 2 - Step 6 - In

Step 7: Drag the set to the Columns shelf. 

Example 2 - Step 7

Right-click on the filter and choose Show Filter from the context menu.

Tableau Set - Example 2 - Step 7 - Show Filter

Tableau will display two columns, i.e., for in and out members in the view.

Tableau Set - Example 2 - Step 7 - Columns

Example #3 – Tableau sets within a calculated field

In this example, we will demo using Tableau sets within a calculated field using the London Property Rental dataset. The London Property Rental dataset contains detailed information about rental properties across various locations in the UK.

To use the Tableau sets within a calculated field, follow the steps outlined below:

Step 1: Connect the London Property Rental dataset in Tableau.

Example 3 - Step 1

Step 2: In the Data pane, right-click on the field and choose Create – Set.

Example 3 - Step 2

Step 3: In the Create Set dialog box, navigate to the Top tab. Specify the logic for the set. Here, we have created a set for the Top 20 properties by rent. 

Example 3 - Step 3

Step 4: Create a data visualization by dragging and dropping the fields to the Rows and the Columns shelf.

Tableau Set - Example 3 - Step 4

Step 5: Right-click on the Data pane. Select Create Calculated Field…

Example 3 - Step 5

Step 6: In the calculated field window, type down the logic for the calculation.

Example 3 - Step 6

As you can see, the calculated deposit amount field shows the amount as per the specification.

Tableau Set - Example 3 - Step 6 - amount

What are Set Actions in Tableau?

Tableau empowers you to create flexible and interactive sets by using the sets in set actions. These actions provide a means of engaging with users directly with a viz or dashboard to control data analysis aspects. For example, when you select marks in the view, the usage of set actions can amend the values in the set. Set actions references to an existing set and based on the user actions in a viz, they update the values included in that set.

Set actions in Tableau can be defined to the below items:

  • The source sheet/s it applies to
  • User actions (hovering over a view, selection, or navigation through the menu)
  • The target set covering any data source or set
  • What-if scenario analysis such as what happens when you clear or run any selection

You can create a set action by navigating to the Worksheet – Action.

Tableau Set - Worksheet - Actions

In the Actions dialog box, click on Add Action – Change Set Values.

Tableau Set - Worksheet - Actions - change values

In the Add Set Action dialog box, choose the source sheets, and target set, and Run action on option.

Tableau Set - Worksheet - Actions - Add Set Action

Click on OK to save your changes.

Important Things to Note

  • Tableau set can be dynamic or static and works with both single or multiple dimensions depending on the type unlike groups
  • You can add set controls in Tableau to dynamically amend the sets
  • Tableau sets can work in a filter, dimension, or with a calculated field.

Frequently Asked Questions (FAQs)

1. How to Add or Remove Data Points from Sets?

To add or remove data points from sets, follow the steps below:
Step 1: Create a data visualization in Tableau.

Step 2: In the view, select the data points you want to add or remove. Right-click on the selection and in the tooltips that appear in the view, click on the set icon.

Choose Add to or Remove from options as shown in the context menu.

FAQ 1

2. How to combine Sets in Tableau?

To combine sets in Tableau, follow the steps below:

Step 1: Select 2 sets from the Data pane you want to combine.

Step 2: Right-click on the sets and select Create Combined Set… from the context menu.

FAQ 2 - Step 2
Step 3: Specify the details in the Create Set dialog box. Click on OK.

FAQ 2 - Step 3
Tableau will create a combined Set visible in the Data pane.

FAQ 2 - Step 3 - Combined set

3. How to add a set control in Tableau?

To add a set control in Tableau, the set should be part of the Tableau view. You can add a set control by following the below guide:

Step 1: Drag the set to the filter shelf in Tableau.

FAQ 3 - Step 1

Step 2: Right-click on the set field in the Data pane and select Show Set.

FAQ 3 - Step 2
Tableau will display a set control option on the right side of the toolbar.

FAQ 3 - Step 2 - set control

4. What is the difference between set and group in tableau?

We have outlined the key differences between set and group in Tableau below:

FAQ 4

Download Template

This article must be helpful to understand the Tableau Set, with its formula and examples. You can download the template here to use it instantly.

This has been a guide to Tableau Set. Here we learn how to create or edit a set in tableau with its actions, examples, and points to remember. You can learn more from the following articles –

Reader Interactions

Leave a Reply

Your email address will not be published. Required fields are marked *