Before building a Cohort Chart in tableau it’s important to understand its usage in the businesses. First, we need to understand its purpose and how to interpret it. This analysis is one of the first things venture capitalists would ask for when thinking about making an investment in a business.

What is Cohort Analysis?

Cohort Analysis is a subset of behavioral analytics. Which breaks users into related groups for the analysis rather than looking at all users as one unit.  These related groups, or cohorts, usually share common characteristics or experiences within a certain time period.

Cohort Analysis is a tool to measure customer engagement and retention over a certain period of time. It helps to understand whether the customer engagement is getting better over time or it is only appearing to improve due to business growth.

Cohort Analysis in Tableau

Cohort Analysis is a classic example of LOD calculations. Below is the snapshot of the analysis with the pointer above highlighted how to interpret the chart.

LOD Calcs to perform Cohort Analysis

Start Quarter: {fixed [customer Id] : MIN(DATETRUNC(‘quarter’, [purchase date]))}  // gives the first quarter of customer purchase.

Quarter Since Start:DATEDIFF(“quarter”, [Start Quarter], [purchase date]) // gives the quarters since first purchase.

–  Total Customer at start: {fixed [Quarter Since Start]: COUNTD(customer Id])} // Gives the total customer at start of each quarter.

1-First Quarter Customer ID: IF [Quarter Since Start] = 0 THEN [Customer ID] END

2-Fixed Count from Quarter Start: {fixed [Quarter Since Start]: COUNTD([First Quarter Customer ID])}

Percent Customer Active: COUNTD([Customer Id])/SUM([Fixed Count from Quarter Start]) // calcs 1 & 2 used to calculate the percentage of active customer during each quarter time.

Now bring ” Quarter Since Start” into Columns and “Start Quarter”&”Total Customer at start” into Rows pill. Bring the “Percent Customer Active” into the Labels and Color marks.

All done!

Saqib Saeed
Author: Saqib Saeed