User retention charts
Read the data
select
sessions.user_id,
date_trunc('week',users.signed_up_at) as signed_up_at_week,
floor(extract('day' from session_started_at - signed_up_at)/7) as week -- The number of weeks that passed since the user signed up
from
sessions
left join users on sessions.user_id = users.user_id
Select the time range
StartDate
EndDate
Visualize
Let's start by plotting a time series of each cohort's retention rate. This is useful for identifying changes over time. For example, we can see that our cohorts in September are performing much better than the ones in May through August.
Sometimes it's helpful to look at the number of users, not just the retention rate. It's also useful to visualize retention as a matrix, to find any outliers. Once again, we can see our September cohorts is doing well.