I have the following tables in my PostgreSQL database:
users: id, created_at (timestamp)
purchases: id, created_at
A user can have multiple purchases. What I'm like to learn is, by users created in a particular month, what is the average length of time before they make their first purchase. And this should only include users that make 1 or more purchases.
Goal is for the data to look like so:
weeks_ago | Date Start | Date End | Total Users in Cohort | Total Users w >=1 Purchase | avg days to complete 1st purchase
What approach can I try?