Instruction
Good job! One more exercise before we move on.
Exercise
Create a customer retention chart based on monthly signup cohorts for all years. It should have the following columns:
YearMonthPercentActive14d(the percentage of customers still active after 14 days)PercentActive30d(the percentage of customers still active after 30 days)
Order the results by year and month.
Stuck? Here's a hint!
Calculate the PercentActive14d column as:
COUNT(CASE WHEN DATEDIFF(Day, RegistrationDate, LastOrderDate) > 14 THEN CustomerID END) * 100.0 / COUNT(CustomerID)




