0
0
Tableaubi_tool~10 mins

Sets for dynamic grouping in Tableau - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Sample Data

Sample sales data for products with their sales amounts.

CellValue
A1Product
A2Chair
A3Table
A4Lamp
A5Desk
B1Sales
B2150
B3300
B4100
B5250
Formula Trace
IF [Product] IN [Top Sellers Set] THEN 'Top Seller' ELSE 'Other' END
Step 1: [Top Sellers Set] = {"Chair", "Table", "Desk"}
Step 2: Check if [Product] = 'Chair' is in [Top Sellers Set]
Step 3: IF True THEN 'Top Seller' ELSE 'Other'
Step 4: Check if [Product] = 'Lamp' is in [Top Sellers Set]
Step 5: IF False THEN 'Top Seller' ELSE 'Other'
Cell Reference Map
    A        B
1 Product   Sales
2 Chair     150  <-- Check if in Set
3 Table     300  <-- Check if in Set
4 Lamp      100  <-- Check if in Set
5 Desk      250  <-- Check if in Set

Set: {"Chair", "Table", "Desk"}
The formula checks each product in column A against the Top Sellers Set.
Result
    A        B       C
1 Product   Sales   Group
2 Chair     150     Top Seller
3 Table     300     Top Seller
4 Lamp      100     Other
5 Desk      250     Top Seller
Products in the set are labeled 'Top Seller', others are labeled 'Other'.
Sheet Trace Quiz - 3 Questions
Test your understanding
Which products are included in the Top Sellers Set?
AChair, Lamp
BLamp, Desk
CChair, Table, Desk
DTable, Lamp
Key Result
Use IF with IN operator to check membership in a Set for dynamic grouping.