Write a SQL query to analyze weekly guest complaints by location and category, and identify the top complaint drivers over time at Hard Rock International.
Use the provided complaint, location, and category data. Include observed complaint categories, calculate their weekly counts and changes from the previous week, and identify the top two drivers within each location and week.
Output
- One row per observed week, location, and complaint category
- Columns:
week_start, location_name, category_name, complaint_count, prior_week_count, week_over_week_change, location_category_rank, and is_top_driver
- Order by
week_start, location_name, location_category_rank, and category_name