Complete the code to calculate the first purchase date per customer using LOD expression.
{ FIXED [Customer ID] : MIN([1])}The LOD expression fixes the calculation at the customer level and finds the earliest order date, which represents the first purchase date.
Complete the LOD expression to count unique customers who made their first purchase in each cohort month.
COUNTD({ FIXED DATETRUNC('month', [Order Date]) : IF DATETRUNC('month', [Order Date]) = [1] THEN [Customer ID] END })This expression compares the order month to the customer's first purchase month to identify cohort members.
Fix the error in the LOD expression to calculate the number of months since a customer's first purchase.
DATEDIFF('month', [1], [Order Date])
The first purchase date must be calculated using a FIXED LOD expression to get the minimum order date per customer.
Fill both blanks to create a cohort calculation that assigns customers to their first purchase month and calculates retention month.
DATETRUNC('month', [1]) AS CohortMonth, DATEDIFF('month', [2], [Order Date]) AS RetentionMonth
Both blanks use the FIXED LOD expression to get the customer's first purchase date for cohort and retention calculations.
Fill all three blanks to write a cohort retention calculation: assign cohort month, calculate retention month, and count distinct customers.
{ FIXED DATETRUNC('month', [1]), DATEDIFF('month', [2], [Order Date]) : COUNTD([3]) }The cohort month and retention month use the fixed first purchase date, and the count distinct is on Customer ID to count unique customers.