Write a SQL query to compare pre- and post-launch conversion rates by cohort using window functions and common table expressions for Pfizer.
Use 30-day windows immediately before and after each product launch. Count each member at most once per period, and exclude members whose product has no launch record.
Output
- One row per product and cohort month.
- Columns:
product_code, cohort_month, pre_conversion_rate, post_conversion_rate, and rate_change.
- Rates must be rounded to four decimal places, ordered by
product_code and cohort_month.