This is the first in a three series of articles dedicated to sets. Sets are one of the predominant concepts in Tableau and as such it is essential to gain an understanding of them early in the game. This article is going to answer 3 question:
What are sets?
How to create sets?
What are the existing types of sets?
If you are interested in answering any of these questions, please follow along.
You might have come across a concept of sets before. In mathematics it is used to essentially list numbers, objects or outcomes. In Tableau sets are:
Custom fields that define a subset of data based on some condition, either created manually or computed.
Sets are used to isolate specific segments of a dimension, and can then be used in several different ways to find insights in your data. Unlike dimension fields, sets are always binary. They are indicated by a small Venn diagram icon:
Likewise parameters, sets also get their own section in the Data pane:
How to create a set?
There are two common methods to create a set.
First, go to the data pane, right click a dimension and select Create -> Set, then you will see a dialog box pop up.
Here we have a lists of Sub- Categories
Set includes all members listed in the dialog box automatically. You can select the option to Exclude these members instead. When exclude field is ticked, the set will include all of the members you didn't select
Tip: Make sure you change the name of the set, as you might struggle to find it later.
The second way to create a set is by manually selecting items once you have built a chart.
In the tooltip that appears, click the Sets drop-down menu icon, and then select Add to [set name] or Remove from [set name] to add or remove data from a particular set.
Type of sets
The first type is called a constant - the members are fixed and don’t change even if the underlying data changes. It can consist of singe or multiple dimensions.
Dynamic Set: As opposed to the constant set- in the dynamic set members change when the underlying data changes. Within this there are 3 types of dynamic sets- general, condition and top.
General set: Allows to select one or more values that will be considered when computing the set. You can alternatively select the Use all option to always consider all members even when new members are added or removed.
Condition set: Allows to define rules that determine which members to include in the set. It can be accessed via the Condition tab.
Note: Set conditions work the same as filter conditions.
Top/Bottom set: Allows to select only specified ‘N’ number of top or bottom values. It can be accessed through “Top” tab. There are two ways to create a top/bottom set: by choosing a filed, or by manually computing a formula.
Combined Set: Is created out of two different sets to compare their members. This is only possible if the two sets are based on the same field. For instance, if one set is based on the top 50 least profitable customers and a second set is based on products in London, it would be impossible to create a combination of those sets. Combining 2 sets allows to create additional analysis to compare and contrast. By combining two sets, a new, third set is essentially created.Once both sets are ready, hold the CTRL button and select them both in the
Once both sets are created, hold the CTRL button and select them both in the Sets section of the Data pane. Right-click and select Combine Sets.
The Combined Set dialogue box pops up:
It is essential to determine how two underlying sets are going to interact in the combined set. There are four options indicated by different Venn diagrams:
- All Members: All members are included from each set. This is a union of both sets.
- Shared Members: Only members that exist in both sets are included in the set. This is an intersection of both sets.
- Except Shared: The final two options allow you to exclude shared members in either set, one for the set in the left-hand drop-down menu and the other option for the right-hand drop-down menu. This is the set difference of the selected set compared to the other.
In part 2 we will be focusing on exploring the differences between sets, groups and filters.