0
0
Tableaubi_tool~10 mins

Clustering in Tableau - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Sample Data

Sample customer data with Annual Income and Spending Score used for clustering analysis.

CellValue
A1CustomerID
B1Annual Income
C1Spending Score
A2C001
B245000
C239
A3C002
B354000
C381
A4C003
B432000
C46
A5C004
B576000
C577
A6C005
B658000
C640
Formula Trace
CLUSTER([Annual Income], [Spending Score])
Step 1: Identify features: Annual Income and Spending Score for each customer
Step 2: Apply clustering algorithm (e.g., k-means) to group customers based on feature similarity
Step 3: Assign cluster labels to each customer
Cell Reference Map
    A           B               C
1 CustomerID  Annual Income  Spending Score
2   C001       45000           39
3   C002       54000           81
4   C003       32000            6
5   C004       76000           77
6   C005       58000           40

Features used: Columns B and C for clustering
The clustering formula uses Annual Income (B) and Spending Score (C) columns as input features.
Result
    A           B               C               D
1 CustomerID  Annual Income  Spending Score  Cluster
2   C001       45000           39             2
3   C002       54000           81             1
4   C003       32000            6             3
5   C004       76000           77             1
6   C005       58000           40             2
The final output adds a Cluster column showing the cluster number assigned to each customer.
Sheet Trace Quiz - 3 Questions
Test your understanding
Which columns are used as features for clustering in this example?
AAnnual Income and Spending Score
BCustomerID and Spending Score
CCustomerID and Annual Income
DOnly Spending Score
Key Result
CLUSTER groups data points based on similarity of selected numeric features.