Sets in Tableau
Dynamic Segmentation
Learn how to create and use sets to dynamically segment your data, enabling powerful in/out comparisons and interactive analysis.
What Is a Set?
A set in Tableau is a custom field that defines a subset of your data based on conditions you specify. Every row in your dataset is classified as either IN the set or OUT of the set, creating a binary segmentation.
Why Sets Matter
Sets unlock analysis patterns that are difficult or impossible with filters alone. They let you compare segments side-by-side while keeping all data visible.
Two Types of Sets
The IN/OUT Principle
Every set in Tableau produces a binary dimension with exactly two values: IN and OUT. This is the foundation of all set-based analysis.
Sets in Calculated Fields
Sets are boolean in calculated fields. You can reference them directly in IF/THEN logic to create custom metrics that compare segments.
IF [Top Customers Set] THEN [Sales]
ELSE 0
END
Sets vs Filters vs Groups
| Sets | Filters | Groups | |
|---|---|---|---|
| Effect on data | Labels IN/OUT | Hides rows | Combines members |
| Dynamic? | ✓ Computed sets update | ✓ Updates with data | ✕ Static mapping |
| Used in calcs? | ✓ As boolean | ✕ No | ✕ Not directly |
| Set Actions? | ✓ Full support | Filter Actions only | ✕ No |
| Best for | Segmentation | Narrowing scope | Renaming/combining |
How to Create a Set
Example: Top 10 Customers
Goal: Compare sales from your top 10 customers against everyone else using the Superstore dataset.
Example: Profitable States
Goal: Create a set that includes only states where total profit exceeds \($5{,}000\).
Advanced: Combined Sets
Goal: Find customers who are both high-value (top 20 by sales) AND high-profit (\( \text{profit} > \$2{,}000 \)). This requires combining two sets.
Set Actions for Interactivity
Set actions let users click or hover on marks in one sheet to dynamically change which members are IN or OUT of a set, updating all sheets that use that set.
Configuring Set Actions
Sets on the Shelves
Where you place a set on the shelves determines how it behaves in the visualization. Each placement unlocks different analytical patterns.
Common Mistakes
Summary of Set Features
| Feature | Constant Set | Computed Set | Combined Set |
|---|---|---|---|
| Definition | Manual pick | Condition / Top N | Union / Intersection |
| Updates automatically | ✕ | ✓ | Depends on source sets |
| Usable in calcs | ✓ | ✓ | ✓ |
| Works with set actions | ✓ | ✓ | ✕ Not directly |
| Best use case | Known segments | Dynamic thresholds | Multi-criteria analysis |
Question 1 of 5
What is the primary difference between using a set and using a filter in Tableau?
Question 2 of 5
You create a set on Customer Name using the Top tab with "Top 10 by Sum of Sales." What type of set is this?
Question 3 of 5
When you reference a set inside a calculated field, what value does the set return for members that are IN the set?
Question 4 of 5
You have two sets: "Top 20 by Sales" and "\( \text{Profit} > \$2{,}000 \)." You want to find customers who appear in both sets. Which combined set mode should you choose?
Question 5 of 5
Where must you configure a set action for it to work?