Skip to content
Tutorials Center
My learning

Topics

Lesson 17 of 35 ยท Calculations

Tableau Groups, Sets, Hierarchies, Parameters, Bins and Custom Sorting

Learn Tableau groups, sets (fixed, dynamic, combined), hierarchies, parameters, bins and manual or data-source sorting, with clear rules for when to use each and runnable stand-ins.

Calculated fields change numbers. The tools in this lesson change how members are organized and how viewers interact: groups combine members, sets define subsets, hierarchies enable drilling, parameters let viewers pick values, bins bucket numbers, and sorting controls order. They look different in the interface, but they answer one question: how do I shape the members of a dimension to tell a better story?

Tableau steps are described in words; stand-ins reproduce the logic in Python or SQL.

Groups

A group combines members of a dimension into a higher-level category.

  1. Select several members in a header or legend (Ctrl+click), or on the marks of a view.
  2. Click the paperclip (Group Members) icon in the tooltip toolbar, or right-click a field > Create > Group....
  3. Name the group (Coastal), repeat for other sets of members, and tick Include 'Other' to bucket everything left over.

Tableau creates a new field with a paperclip icon. Typical uses: fix spelling variants (NY, New York, N.Y. into one group), bucket long lists (small regions into Other) and build ad hoc categories for one analysis.

Groups are static: new members land in Other. When the rule is logic-based (profit over zero, top 10 customers), use a set or a calculated field instead.

SQL Stand-in: a group is a mapping with an Other bucket

Press Run (or Ctrl + Enter) to see the result here.

Sets

A set is a custom field that divides the data into In and Out members of a rule. Unlike groups, sets can be dynamic.

  • Fixed set: you pick the members by hand (select marks > Create Set). It never changes unless you edit it.
  • Dynamic set (computed): defined by a condition or a Top N, so it recalculates with the data. Right-click a dimension > Create > Set..., then use the Condition or Top tab (for example "Top 10 customers by SUM(Sales)" or SUM(Profit) < 0).

Use a set as a filter (Show In/Out members), on Color (In versus Out), or in a calculation: [Top Customers] returns true for members in the set (IF [Top Customers] THEN "VIP" ELSE "Other" END).

Dynamic sets update with the data, but a set based on an aggregate only reads the level of its own dimension. They run with dimension filters in the order of operations; use a context filter if the set must respect another filter (Filters and the order of operations).

Combined sets

Select two sets on the same dimension in the Data pane, right-click > Create Combined Set... and choose how to combine:

Option Result
Shared Members in Both Sets Intersection
All Members in Both Sets Union
Except Shared Members Members in set A only (or B only)

Example: customers who bought in 2024 (Set A) and in 2025 (Set B). The intersection is returning customers, A except B is churned, and B except A is new. Cohort analysis in Tableau often rests on this idea.

Python Stand-in: combined sets are set operations

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Hierarchies

A hierarchy orders dimensions from broad to narrow, so viewers can drill down with a + icon on the header.

  1. In the Data pane, drag one field (Sub-Category) onto another (Category) and name the hierarchy, or right-click > Hierarchy > Create Hierarchy.
  2. Drag fields into the correct order (top level first).
  3. Drag the hierarchy's top field to the view. Click the + on a header to expand, - to collapse.

Tableau creates built-in hierarchies for dates (Year > Quarter > Month > Day) and for geographic roles (Country > State > City). Order matters: Country > State > City makes sense, but City > Country does not.

On a dashboard, drilling happens inside one sheet, which keeps screen space small. Explain the + to users, because they do not always see it.

Parameters

A parameter is a single value that a viewer can change and that your calculations, filters, reference lines or sets can read. Unlike a filter it does not come from the data.

  1. In the Data pane choose the drop-down > Create Parameter....
  2. Set a name, Data type (Integer, Float, String, Boolean, Date), Current value and Allowable values (All, List or Range).
  3. Right-click the new parameter > Show Parameter to put a control on the view.
  4. Use it in a calculated field: [Sales] * [Growth Assumption], or IF [Metric Selector] = "Sales" THEN SUM([Sales]) ELSE SUM([Profit]) END.

Typical uses:

  • Metric switcher: one chart that shows Sales, Profit or Quantity, chosen by the viewer.
  • Top N: a parameter Top N (1-20) used in a Top filter's formula, or in RANK(SUM([Sales])) <= [Top N].
  • What-if: a growth percentage that scales a forecast.
  • Reference line: a target line at a value the viewer can adjust.
  • Date picker: a date parameter driving relative filters.

Parameters do not update from the data when new values arrive; a list of allowable values is fixed unless you set it to refresh from a field (Add Values from > a field).

Python Stand-in: a metric-switcher and a Top N parameter

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Changing the two arguments is what a viewer does with the two parameter controls.

Bins

A bin groups a measure into equal-width buckets and returns a dimension. Right-click a measure > Create > Bins..., set the Size of bins (use Suggest Bin Size for a start). You used bins for histograms in Distribution charts. They also work for age groups, price bands and order sizes. If you need uneven ranges, use a calculated field (IF [Age] < 18 THEN "Under 18" ELSEIF [Age] < 65 THEN "18-64" ELSE "65+" END).

Sorting beyond the toolbar

Sorting was introduced in Your first visualization. Two more modes finish the picture. Right-click a dimension > Sort...:

  • Data source order: members follow their order in the source (a month column that is already January to December, a rating scale). It is the best way to keep a natural order that is not alphabetical.
  • Manual: drag members into any order, or click and use the arrows in the dialog. It is stored as a custom list: a new member appears at the end, so use manual sorting only for stable lists (stages, ratings).

Also note: sorting a dimension on one sheet does not change other sheets. If a dashboard uses a sorted axis, you might want to use a parameter to switch the sort between measures (build a calculated sort field IF [Sort By] = "Sales" THEN SUM([Sales]) ELSE SUM([Profit]) END, then sort by that field).

Choosing the right tool

flowchart TD
    A["I want to organize members"] --> B{"Fixed list or rule?"}
    B -->|"Fixed, hand picked"| G["Group or fixed set"]
    B -->|"Rule based, changes with data"| S["Dynamic set or calculated field"]
    A --> C{"Viewer should pick a value?"}
    C -->|"Yes"| P["Parameter"]
    A --> D{"Drill from broad to narrow?"}
    D -->|"Yes"| H["Hierarchy"]

Decide whether the list is fixed or rule-based, whether a viewer chooses, and whether people drill.

Common mistakes

  • Groups for rules such as "top 10", which go stale. Use a set.
  • Parameters used as filters on data, then not wired to any calculation, so nothing changes.
  • Manual sort on a field that grows.
  • Hierarchies in the wrong order.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which is a dynamic set?

    A set defined by a Top N or condition recomputes as the data changes; a hand-picked set is fixed.
  2. 2. What does a Combined Set with 'Shared Members in Both Sets' give?

    Shared members are those in both sets, i.e. the intersection.
  3. 3. What is a parameter?

    Parameters are independent of the data and allow viewers to feed values into calculations.
  4. 4. Which sort mode keeps months in January-to-December order when the data source holds them that way?

    Data source order keeps the order of the source, which is how natural sequences are preserved.

Summary

  • Groups combine members statically; sets define In/Out members, fixed or dynamic, and can be combined.
  • Hierarchies add drill-down; Tableau already builds date and geographic hierarchies.
  • Parameters feed viewer-chosen values into calculations, filters and reference lines.
  • Bins bucket numbers; Data source order and Manual sorting give custom orders.

Next: Building dashboards