0
0
Tableaubi_tool~10 mins

Cohort analysis patterns in Tableau - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the Tableau calculation to assign each customer to their cohort month based on their first purchase date.

Tableau
DATETRUNC('month', [1])
Drag options to blanks, or click blank then click option'
A[First Purchase Date]
B[Order Date]
C[Transaction Date]
D[Signup Date]
Attempts:
3 left
💡 Hint
Common Mistakes
Using the transaction date instead of the first purchase date.
Using a date field unrelated to customer acquisition.
2fill in blank
medium

Complete the Tableau calculation to find the number of months since the cohort month for each transaction.

Tableau
DATEDIFF('month', [1], [Order Date])
Drag options to blanks, or click blank then click option'
A[Cohort Month]
B[First Purchase Date]
C[Signup Date]
D[Transaction Date]
Attempts:
3 left
💡 Hint
Common Mistakes
Using the first purchase date directly instead of the cohort month.
Using the wrong date field for comparison.
3fill in blank
hard

Fix the error in this cohort retention calculation to count distinct customers who made a purchase in the current month since their cohort.

Tableau
COUNTD(IF [1] = 0 THEN [Customer ID] END)
Drag options to blanks, or click blank then click option'
A[Order Date]
B[Cohort Month]
C[Months Since Cohort]
D[First Purchase Date]
Attempts:
3 left
💡 Hint
Common Mistakes
Comparing the cohort month or order date directly to zero.
Using the wrong field that does not represent months since cohort.
4fill in blank
hard

Fill both blanks to calculate the retention rate as the ratio of customers active in the current month to those in the cohort month.

Tableau
SUM(IF [1] >= 0 THEN 1 ELSE 0 END) / SUM(IF [2] = 0 THEN 1 ELSE 0 END)
Drag options to blanks, or click blank then click option'
A[Months Since Cohort]
B[Order Date]
D[Cohort Month]
Attempts:
3 left
💡 Hint
Common Mistakes
Using different fields for numerator and denominator.
Mixing date fields instead of months since cohort.
5fill in blank
hard

Fill all three blanks to create a cohort retention table calculation that resets at each cohort month and calculates retention percentage.

Tableau
IF FIRST() = 0 THEN WINDOW_SUM(SUM([[1]])) / WINDOW_SUM(SUM([[2]])) ELSE PREVIOUS_VALUE(1) END * [3]
Drag options to blanks, or click blank then click option'
AActive Customers
BCohort Customers
C100
DMonths Since Cohort
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong fields for numerator or denominator.
Forgetting to multiply by 100 for percentage.