Remitly wants to measure how consistently newly registered customers complete transfers after signup. Write a PostgreSQL query to calculate monthly retention for the January 2024 signup cohort.
2024-01-01 through 2024-01-31 as the cohort.cohort_month, month_number, cohort_users, retained_users, and retention_rate.month_number ascending.retention_rate to four decimal places.NULL for retention_rate when cohort_users is zero.2024-01-01 00:00:00 inclusive through 2024-04-01 00:00:00 exclusive.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique Remitly customer identifier |
| signup_date | DATE | Date the customer registered |
| country_code | VARCHAR(2) | Customer registration country |
| Column | Type | Description |
|---|---|---|
| transfer_idPK | INT | Unique transfer identifier |
| user_id | INT | Customer who initiated the transfer |
| completed_at | TIMESTAMP | Transfer completion timestamp |
| channel | VARCHAR(20) | Transfer initiation channel |