I have an android app for which I need the user retention data over 6 months period. I want to write a sql query for bigquery but having trouble with the syntax. I need to get a date series for any events from each month against a user_id. Then I can process it in Excel and make month cohorts.
From Google analytics, I can get retention for past 2 months only.
No sample data is given so Im acting here hypothetically:
Have a CTE at top where you have exploded the dates with unnest, then join this to your retention users and compare the exploded dates to signup dates in your table with 6 month interval inbetween. I imagined that you have separate events and users tables.
You can remove the group by if count of retention users is not what you are looking for (if instead you just want the Distinct userIds without aggregating or summing the rows.)
Documentation on interval functions
Interval type