Having a table containing UserID and dates only:
ID | Date
111 | 01/01/2021
222 | 30/01/2021
333 | 22/01/2021
Desired output would be (active users are users that have an activity in the past 30 days, retained users are users who were active before that ):
Date | Number_of_Active_users | Number_of_Retained_users | Retention%
01/01/2021 | 3 | 2 | 22%
03/01/2021 | 8 | 4 | 60%
Thanks