Write a SQL query to calculate monthly operational KPIs by location, including total volume, average cycle time, and month-over-month change.
Use completed operational records and exclude records without a valid location. Cycle time is the elapsed time between started_at and completed_at in minutes.
location_name, month, total_volume, avg_cycle_time_minutes, mom_volume_change, and mom_volume_change_pct.| Column | Type | Description |
|---|---|---|
| location_idPK | INT | Unique operational location identifier |
| location_name | VARCHAR(100) | Display name of the operational location |
| region | VARCHAR(50) | Geographic region containing the location |
| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique operational event identifier |
| location_id | INT | Location associated with the event |
| status | VARCHAR(20) | Current event status |
| started_at | TIMESTAMP | Timestamp when operational processing began |
| completed_at | TIMESTAMP | Timestamp when operational processing completed |