How to Create Clusters in Tableau

Clustering in Tableau

The basic definition of clustering is to group elements together by similar properties,dimensions, or values.
Tableau provides an option to group  data into different clusters based on parameters that you described . Tableau uses the “k-means” algorithm for clustering which suggests that based on the different values,  the data will be partitioned into k-clusters. These clusters are distinguished by the feature similarity.  Tableau for Data Science Courses for less than 15 dollars. 

The Superstore data set will give you the ability to create all the elements for the creations of the k-mean clusters.

Objective: Prior to  creating clusters,  you will need to create a scatter chart of Sub-Category drawn across total sales (x-axis) and average discount (y-axis). Now, the objective is to group the dots (Sub-Category) in scatter plot into different clusters based on their average discount values.
Following are the steps to do the clustering in Tableau:

Steps to Create Clusters:
1. Connect to Sample-Superstore dataset: Open the Tableau Desktop and select the “Sample-Superstore” dataset

2. Go to Sheet1:

3. Drag the “Sales” measure to “Columns” shelf and “Discount” measure to “Rows” shelf

User the K Means Cluster Algorithm in Tableau

4. Drag the “Sub-Category” dimension to “Detail” marks card: This will create the scatter chart of “Sub-Category” across “Sales” and “Discount”.

The clustering will be divided by colors

5. Now, select the “Analytics” tab on left “Side Bar” and you will see there is an option called “Cluster” under “Model”

Use the analytics icon in the marks in Tableau

6. Select that “Cluster” option and drag it over the scatter chart

7. Do the following to create the clusters:
a) Drag the SUM(Sales) out from the cluster window as our objective is to create clusters based on Discount values
b) Under “Number of Clusters” option enter the integer value of how many clusters you want to create. For now, I am entering 4 as value

8. You will see that all the “Sub-Categories” dots in scatter are being grouped in 4 different colored clusters based on their discount values

9. To understand the logic and statistics of how these clusters are being defined in Tableau, follow the below steps:
a) Click on “Clusters” under “Marks” card and select “Describe cluster..” option

b) In the “Describe Clusters” window, user can understand the statistics involved in creating the clusters