0
0
Tableaubi_tool~10 mins

Cohort analysis patterns in Tableau - Step-by-Step Guide

Choose your learning style9 modes available
Introduction
Cohort analysis helps you see how groups of customers behave over time. It solves the problem of understanding customer retention and trends by grouping people who share a common event, like their first purchase date.
When you want to track how long customers keep buying after their first purchase
When you need to compare different groups of users who started using your product in different months
When you want to see if a marketing campaign improved customer retention over time
When you want to analyze user behavior by signup week or month
When you want to measure how long it takes for customers to make repeat purchases
Steps
Step 1: Connect
- Tableau Data Source pane
Your data with customer IDs and dates loads into Tableau
💡 Make sure your data includes a date field for the event and a unique customer ID
Step 2: Create a calculated field
- Data pane → right-click → Create Calculated Field
A new field to identify the cohort start date is ready
💡 Name it 'Cohort Month' and use a formula like: DATETRUNC('month', [First Purchase Date])
Step 3: Drag 'Cohort Month' to Columns shelf
- Columns shelf
Cohorts appear as columns representing each group's start month
Step 4: Create another calculated field for 'Months Since Cohort'
- Data pane → right-click → Create Calculated Field
A field showing how many months passed since the cohort start
💡 Use formula: DATEDIFF('month', [Cohort Month], DATETRUNC('month', [Purchase Date]))
Step 5: Drag 'Months Since Cohort' to Rows shelf
- Rows shelf
Rows show time periods since the cohort started
Step 6: Drag a measure like 'Number of Customers' to Text on Marks card
- Marks card → Text
Numbers appear showing how many customers made purchases each month after their cohort start
Step 7: Change Marks type to Heat Map
- Marks card → drop-down → select 'Square' and then Color
Colors show retention intensity, making patterns easy to spot
Before vs After
Before
Table shows raw purchase data with customer IDs and dates mixed together
After
Tableau view shows cohorts by start month on columns, months since cohort on rows, and colored squares representing customer retention counts
Settings Reference
Date truncation level
📍 Calculated field editor
Defines the time unit for cohort grouping
Default: month
Mark type
📍 Marks card
Controls how data points are visually represented
Default: Automatic
Color palette
📍 Marks card → Color
Shows intensity or categories in the heat map
Default: Sequential
Common Mistakes
Using purchase date instead of first purchase date for cohort grouping
This mixes different customers' start times and ruins cohort grouping
Create a calculated field to find each customer's first purchase date and use it for cohort assignment
Not truncating dates to the same level (e.g., mixing days and months)
This causes mismatched cohorts and confusing results
Use DATETRUNC to set all dates to the same level like month or week
Summary
Cohort analysis groups customers by their start date to track behavior over time
Tableau uses calculated fields and date truncation to create cohorts and time intervals
Visualizing cohorts as a heat map helps spot retention trends easily