Write a SQL query using window functions to compute a 7-day rolling average of telemetry events by customer and rank the top customers each week. Use the supplied customer and telemetry event data, include customers with no events, and treat missing event days as zero. Return the top three rank positions per week, including ties.
Output
- One row per included customer and calendar week.
- Columns:
customer_id, customer_name, week_start, weekly_event_count, rolling_7_day_avg, and weekly_rank.
- Sort by
week_start, weekly_rank, and customer_id.