📊 PHASE 2 · LEVEL 3 🟡 Intermediate MODULE 08

Groups, Sets & Hierarchies

⏱️ 50–65 min read
🏗️ 1 Regional Explorer Project
❓ 5 Quiz Questions
Groups, Sets, and Hierarchies are three of Tableau's most powerful organizational features — and most analysts under-use all three. Groups let you bundle dimension members into custom categories. Sets let you create dynamic in/out segments that respond to user interaction. Hierarchies let you drill from continent → country → city with a single click. Together, they unlock a whole new level of analytical flexibility.
Module 8 of 15 · Phase 2 Progress 36%

Groups — Bundling Members into Custom Categories

A Group in Tableau is a way to combine multiple dimension members into a higher-level category. Think of it as creating a custom segment that doesn't exist in your original data. Groups create a new dimension field — they don't modify your underlying data source.

The classic use case: your data has 50 US states, but your business cares about sales regions (Northeast, South, Midwest, West). You don't have a Region field — you create a Group to define it manually.

📌
Groups vs Calculated Fields
You could create the same result with an IF/CASE calculated field (IF [State] = "New York" OR [State] = "Massachusetts" THEN "Northeast"...). But Groups are faster to build and visually manage. Use Groups for ad-hoc segmentation, Calculated Fields when you need the logic reusable in formulas.

Method 1 — Manual Grouping via the Data Pane

1
Right-Click the Dimension
In the Data pane, right-click the dimension you want to group (e.g., State). Select Create → Group. A dialog opens showing all members.
2
Select Members and Group
Hold Ctrl and click multiple members (e.g., New York, Massachusetts, Connecticut). Click the Group button. A new group entry appears — type a name like "Northeast".
3
Handle "Other"
Check "Include 'Other'" to automatically bundle all ungrouped members. This is useful when you only care about specific segments and want to lump the rest together.
4
The Group Field Appears
A new dimension appears in the Data pane named State (group). Drag it into your view just like any other dimension. The paperclip icon (📎) identifies group fields.

Method 2 — Visual Grouping in the View

You can also create groups directly from a chart. Select multiple marks (bars, circles, etc.) in the view using Ctrl+click, then click the paperclip icon that appears in the tooltip. Tableau creates the group instantly. This is the fastest workflow when you can visually identify the members you want to bundle.

Editing Groups

In the Data pane, right-click your group field and select Edit Group. The same dialog reopens — add members to existing groups, rename groups, split groups apart, or delete groups entirely. Any views using the group field update automatically.

💡
Pro Workflow: Create Groups from Outliers
Sort a bar chart by a measure, then visually select the bottom 5 bars representing underperforming products. Create a group called "Needs Attention". Now you have a dynamic highlight of problem areas — filter to just this group to drill into them on a separate sheet.

Sets — Dynamic In/Out Segmentation

A Set is a custom binary field that categorizes dimension members as either In (meets the condition) or Out (does not). Sets are more powerful than Groups because they can be dynamic — they update automatically as your data changes, and they can respond to user interaction via Set Actions.

🎯
Condition-Based Sets
Define membership using a formula. E.g., customers whose total purchase > $5,000. Updates dynamically as data changes. Perfect for defining "VIP" tiers.
🏆
Top N Sets
Automatically include the Top 10 (or Bottom N) members by a measure. Top 10 customers by revenue. Bottom 5 stores by profit margin. Always current.
Combined Sets
Union, intersection, or difference of two sets. Find customers who are both Top 10 by sales AND Top 10 by profit — the truly valuable ones.
👆
Set Actions
Users click a mark to add/remove it from a set. The entire dashboard responds dynamically to the selection. This is the killer feature of sets.

Creating a Condition-Based Set

1
Right-Click a Dimension
In the Data pane, right-click Customer Name. Select Create → Set. The Set dialog opens.
2
Name Your Set
Give it a meaningful name: High Value Customers. Clear names make your workbook easier to maintain.
3
Choose the Condition Tab
Click the Condition tab. Select "By field", choose Sales, operator >=, value 5000. All customers with total sales ≥ $5,000 are "In".
4
Use the Set in a View
Drag the set to Color. Members "In" show one color, "Out" another. Or drag to Filter and show only "In" members. A circle icon identifies sets in the Data pane.

Top N Set Example

Create a set on Product Name. In the Set dialog, choose the Top tab. Select "By field" → Top 10 → by Sales → SUM. Now you have a set that always contains your top 10 products by revenue — even when the data is filtered or updated. Drag this to Color to highlight top performers vs. the rest in any chart.

Combined Sets

Create two sets first: Top 10 by Sales and Top 10 by Profit. Then right-click either set in the Data pane → Create Combined Set. You can choose:

OperationResultUse Case
All Members in Both SetsIntersection (AND)Products that are both top sales AND top profit — your gold tier
All Members in Either SetUnion (OR)Products in top sales OR top profit — worth watching
Except Members in Set 2DifferenceTop sales products that are NOT top profit — margin problems

Set Actions — User-Driven Dynamic Filtering

Set Actions are the feature that turns sets from a static analysis tool into an interactive dashboard powerhouse. A Set Action lets users click, hover over, or select marks in one chart to dynamically control the membership of a set — which then drives other charts that use that set.

This creates a pattern more flexible than standard filter actions. Unlike filter actions (which simply show/hide rows), Set Actions let you change how data is calculated — you can show comparisons between selected and non-selected items simultaneously.

📊
The Classic Set Action Pattern: "Focus + Context"
User clicks a region on a map → that region enters a set → a bar chart on the right compares the selected region's metrics (In) against all other regions (Out). Both are visible at once. This is impossible with standard filter actions, which would hide the "Out" data entirely.

Setting Up a Set Action

1
Create an Empty Set First
Right-click Region → Create Set → select any single member manually. Name it Selected Region. This will be the "target" set the action writes to.
2
Build Your Dashboard
Add a map sheet and a comparison bar chart that uses Selected Region in its color or computed axis (e.g., a calculated field: IF [Selected Region] THEN [Sales] END).
3
Add the Set Action
Dashboard menu → ActionsAdd Action → Change Set Values. Source: your map sheet. Target set: Selected Region. Run action on: Select. Clearing selection: Keep set values.
4
Test It
Click a region on the map — the bar chart instantly updates to highlight that region against all others. Click another region — the set updates. Click the same region again to deselect.

Custom Hierarchies — Drill-Down Navigation

A Hierarchy in Tableau is an ordered group of related dimensions where you can drill down (expand to more detail) or drill up (collapse to summary). Tableau automatically creates date hierarchies (Year → Quarter → Month → Week → Day), but you can create custom hierarchies for any related dimensions.

🌲
Built-in Date Hierarchy Example
Drag Order Date to Columns. Tableau places YEAR(Order Date) automatically. Click the + icon on the pill to expand to QUARTER, then MONTH. Click the - icon to collapse back. This drill-down interaction is a hierarchy in action.

Creating a Custom Geographic Hierarchy

1
Identify Related Fields
You have: Country, State, City, Postal Code. These naturally nest: Country → State → City → Postal Code.
2
Drag Fields to Create
In the Data pane, drag State and drop it directly onto Country. Tableau creates a hierarchy and prompts you to name it. Call it "Location". Then drag City onto State within the hierarchy, then Postal Code onto City.
3
Use in a View
Drag Country from the hierarchy to Rows. Click the + icon on the pill to drill into State, then City. Each level adds a column in the table or splits the chart further.
4
Drill Selectively
Right-click a specific bar or mark → Drill Down. This expands only that member — e.g., expand "West" region to see its states, while other regions remain collapsed. Essential for executive dashboards.

Product Hierarchy Example

For retail data: CategorySub-CategoryProduct Name. Create this hierarchy from the Data pane by dragging Sub-Category onto Category, then Product Name onto Sub-Category. In a sales chart, start at Category level. Click + to see sub-categories. Click + again to see individual products. Click - to roll back up. This replaces the need for multiple separate charts at each level.

⚠️
Hierarchy Level Context Matters
When you drill down in a hierarchy, table calculations (like RANK or RUNNING_SUM) recalculate at the new level. If you have a RANK calculation that ranked categories, after drilling down it will rank sub-categories. Make sure your calculations behave as expected at each drill level — test before deploying to end users.

Project: Regional Sales Explorer

Let's combine everything — groups, sets, set actions, and hierarchies — into a single interactive Regional Sales Explorer dashboard using the Sample - Superstore dataset.

🎯
What We're Building
A dashboard with a regional map where clicking a region highlights its performance in a bar chart. The bar chart uses a Set Action to show the selected region vs. all others side by side. A product hierarchy lets users drill from Category → Sub-Category → Product Name for the selected region.
1
Create a "Selected Region" Set
Right-click Region → Create Set → manually select "East". Name it Selected Region. This is the set that the Set Action will write to.
2
Build the Map Sheet
Double-click State (Tableau auto-builds a map). Drag Sales to Color. Drag Region to Detail. Name this sheet "Regional Map".
3
Build the Comparison Bar Chart
New sheet. Drag Selected Region (the set) to Rows. Drag Sales to Columns. You'll see "In" and "Out" bars. Add Selected Region to Color too — "In" glows orange, "Out" is muted. Name it "Region Comparison".
4
Build the Product Hierarchy Chart
New sheet. Create the Category → Sub-Category → Product hierarchy. Drag Category to Rows, Sales to Columns. Add a filter for Selected Region = In. Name it "Product Drill-Down".
5
Assemble the Dashboard
New Dashboard. Add "Regional Map" top-left, "Region Comparison" top-right, "Product Drill-Down" at the bottom.
6
Add the Set Action
Dashboard → Actions → Add Action → Change Set Values. Source: Regional Map. Target set: Selected Region. Run on: Select. Clearing: Keep set values. Click OK.
7
Test & Refine
Click a region on the map. All three views update instantly. The comparison bar shows that region vs others. The product chart shows only that region's products. Click the + on the Category pill to drill to Sub-Category.
🧠 Knowledge Check
1. What icon identifies Group fields in Tableau's Data pane?
2. Which Set type automatically updates when data changes, always showing the Top 10 products by sales?
3. What is the unique advantage of Set Actions over standard Filter Actions on a dashboard?
4. How do you create a custom hierarchy from two existing dimensions (e.g., Country and State)?
5. A "Combined Set" using the "All Members in Both Sets" operation is equivalent to which set theory operation?
🏆

What You Learned

📋
Lesson 8 — Key Takeaways
✅ Groups bundle dimension members into custom categories — use for ad-hoc segmentation
✅ Visual grouping lets you select marks on-canvas and group them directly
✅ Sets create binary In/Out membership — condition-based, Top N, or manual
✅ Combined Sets apply union, intersection, and difference logic across two sets
✅ Set Actions let users dynamically control set membership by clicking on marks
✅ Set Actions enable "focus + context" comparisons impossible with filter actions
✅ Custom hierarchies enable drill-down from any parent dimension to child levels
✅ Built a Regional Sales Explorer using all three features together
🎉
Lesson 8 Complete! Groups, Sets & Hierarchies mastered.
You can now segment data dynamically with sets and set actions, and create drill-down hierarchies. Next: Advanced Visualizations — heatmaps, treemaps, Gantt charts, bullet charts, and waterfall charts.