Sorting, Grouping
& Sets
Master the three foundational techniques for organizing data in Tableau: sorting to reveal order, grouping to simplify categories, and sets to isolate subsets for powerful comparisons.
What is Sorting in Tableau?
Sorting arranges the rows or marks in your visualization by a field's values: alphabetically, numerically, or by a custom order. It is the simplest way to turn a chaotic bar chart into a meaningful story.
What is Grouping in Tableau?
Grouping combines related dimension members into a single, higher-level category. It simplifies your view by merging many values into fewer buckets: think of it as creating folders for your data.
What are Sets in Tableau?
A set defines a custom subset of your data based on conditions or manual selection. Unlike groups, sets produce a binary split: every row is either IN the set or OUT of the set. This makes them ideal for comparisons.
Why Sorting, Grouping & Sets Matter
The Sorting Mechanism
Tableau evaluates sorts in a priority stack: the sort applied last takes precedence. Each sort operates on a dimension field and orders it by a chosen measure or alphabetical rule.
Groups vs. Sets: Core Distinction
| Groups | Sets | |
|---|---|---|
| Purpose | Combine members into categories | Define IN/OUT subsets for comparison |
| Output | New grouped dimension (multi-value) | Binary: IN or OUT |
| Dynamic? | ✕ Static: manual assignment | ✓ Can be dynamic via conditions |
| Use on Filters? | Yes, as dimension filter | Yes, and also Show IN/OUT on Color |
| Combine? | Cannot combine groups | Combined sets (union, intersect, diff) |
| Created from | Right-click dimension → Group | Right-click dimension → Create Set |
How to Create a Group
How to Create a Set
Example 1: Sorting a Bar Chart
Scenario: You have a horizontal bar chart of Sales by Sub-Category. The bars are in default data-source order: hard to read. Sort descending by \( \text{SUM(Sales)} \) to reveal the top performers.
Example 2: Grouping States into Regions
Scenario: Your dataset has 50 U.S. states. You want to compare 4 custom regions: Northeast, Southeast, Midwest, and West. Group the State dimension to create these categories.
Example 3: Dynamic Set for Top Customers
Scenario: Create a set for Top 10 Customers by Sales. Then compare their profit margin against all other customers using the IN/OUT split on Color.
Combining Sets for Advanced Analysis
Tableau lets you combine two sets with set operations: just like mathematical set theory. This unlocks complex multi-condition analysis.
Step-by-Step: Applying All Three
Common Mistakes to Avoid
Summary Comparison
| Sorting | Grouping | Sets | |
|---|---|---|---|
| What it does | Reorders marks | Merges members | Splits IN/OUT |
| Changes data? | No | Creates new field | Creates new field |
| Dynamic? | Yes (auto-updates) | Static (manual) | Can be dynamic |
| Best for | Ranking, top/bottom | Simplifying categories | Subset comparisons |
| Can combine? | N/A | No | Yes (union, intersect) |
| On Color shelf? | No | Yes (as dimension) | Yes (IN/OUT) |
Question 1 of 5
You have a bar chart of Sales by Product Name. You want the highest-selling product at the top. What should you do?
Question 2 of 5
You want to combine "Desks," "Bookcases," and "Chairs" into a single category called "Furniture". Which feature should you use?
Question 3 of 5
What is the key difference between a group and a set in Tableau?
Question 4 of 5
You create Set A (Top 10 by Sales) and Set B (Top 10 by Profit). You want customers who appear in both sets. Which combined set operation do you use?
Question 5 of 5
You applied a descending sort to "City" by \( \text{SUM(Sales)} \), but after adding a filter on "Region," the sort order looks wrong. What is the most likely cause?