Instruction
Nice work! Time for an additional exercise.
Exercise
Create a conversion chart for monthly registration cohorts from 2017 for each channel. Show the following columns:
Month– The registration month.ChannelName– The registration channel.RegisteredCount– The number of users registered.NoSale– The number of users who never made a purchase.OneWeek– The number of users who made a purchase within 7 days.AfterOneWeek– The numbers of users who made a purchase after the first week.
Order the results by month.
Stuck? Here's a hint!
- Use
DATEPART(Month, RegistrationDate)to get the month. - Join the
Customerstable with theChannelstable to get channel names. - Group by month, channel ID, and channel name.
- Use the following code to calculate the
OneWeekcolumn:COUNT(CASE WHEN DATEDIFF(Day, RegistrationDate, FirstOrderDate) < 7 THEN CustomerID END) AS OneWeek




