Write a SQL query to find the rolling 7-day average of active users, partitioned by specific clinical cohorts at nference.
Use the provided cohort, user, and activity data. Include calendar dates with no activity so inactive days contribute zero to the average.
Output
- One row per clinical cohort and calendar date in the activity range
- Columns:
cohort_id, cohort_name, activity_date, daily_active_users, and rolling_7_day_avg
- Include all cohorts represented by users, order by
cohort_id, then activity_date