01 / 20

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.

Tableau

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.

ALL DATA IN OUT Members matching condition Everyone else

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.

Segment
Split any dimension into IN vs OUT groups for instant comparison.
Interact
Use set actions to let users click marks and dynamically redefine the set.
Calculate
Reference sets in calculated fields for conditional logic and custom metrics.

Two Types of Sets

Constant Set
You manually pick specific members. The set stays fixed until you edit it. Best for known, stable segments like "Top 5 Products."
Computed Set
Defined by a condition or a top/bottom rule. The set updates automatically as data changes. Best for "Top N by Sales" or "Profit > \(10{,}000\)."
CONSTANT SET Members: {A, B, C} Manually selected Static until edited vs COMPUTED SET
Condition: \( \text{Sales} > 50\text{K} \)
Rule-based Auto-updates with data

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.

Data Source Set Condition Applied IN Matches condition Analyze this segment OUT Does not match Compare against IN

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.

// Sales from top customers only
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

1
Right-click a dimension in the Data pane (e.g., Customer Name, Product, State).
2
Select "Create" → "Set..." from the context menu.
3
Choose your method: General tab (pick specific members), Condition tab (write a rule), or Top tab (rank-based).
4
Name the set descriptively (e.g., "High-Value Customers") and click OK.
5
Drag the set to Rows, Columns, Color, or use in a calculated field.

Example: Top 10 Customers

Goal: Compare sales from your top 10 customers against everyone else using the Superstore dataset.

$0 $50K $100K $150K IN $130K OUT $90K Top 10 Customers All Others

Example: Profitable States

Goal: Create a set that includes only states where total profit exceeds \($5{,}000\).

1
Right-click State → Create → Set.
2
Condition tab: By Field → \( \text{Sum of Profit} > 5000 \).
3
Name it "Profitable States" and click OK.
4
Drag to Color on a filled map to highlight profitable vs unprofitable states.

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.

High-Value Top 20 by Sales High-Profit
\( \text{Profit} > \$2\text{K} \)
BOTH Combined Set Right-click either set → Create Combined Set → select both → choose intersection

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.

SOURCE SHEET ↖ User clicks marks SET ACTION SET Updates IN/OUT TARGET IN detail OUT detail Dashboard → Actions → Add Action → Change Set Values Select: source sheet, target set, and running action behavior

Configuring Set Actions

1
Open your dashboard and go to Dashboard → Actions → Add Action → Change Set Values.
2
Source sheet: choose which sheet the user clicks on (e.g., a bar chart of categories).
3
Target set: choose which set to update (e.g., "Selected Categories").
4
Clearing behavior: decide what happens when selection is cleared: Keep set values, Add all values, or Remove all values.

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.

Color
Colors marks IN vs OUT. Ideal for highlighting segments on a scatter plot or map.
Rows / Columns
Splits the view into two panes: one for IN, one for OUT. Creates side-by-side bars or panels.
Filter
Shows only IN members (or only OUT). Behaves like a filter but is driven by set logic.

Common Mistakes

✕ Using Filters Instead
Applying a filter hides OUT members entirely. If you need to compare IN vs OUT, use a set on Color or Rows, not a filter.
✕ Forgetting Aggregation Level
A set condition like "\( \text{Profit} > 100 \)" evaluates at the dimension level (e.g., per customer), not per row. Misunderstanding this gives unexpected IN/OUT splits.
✕ Static When Dynamic Needed
Using a constant (manual) set when data changes frequently. Switch to a computed set with a condition or top/bottom rule so it updates automatically.

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?