How would you write a SQL query to compare week-over-week shipment volume and identify the largest changes by region at Walmart Supply Chain?
Use the provided shipment and fulfillment center data. Compare each region only for weeks that have a preceding regional week, and exclude cancelled shipments.
region, week_start, current_volume, prior_week_volume, volume_change, and percent_change.| Column | Type | Description |
|---|---|---|
| shipment_idPK | INT | Unique shipment identifier |
| facility_id | INT | Fulfillment center associated with the shipment |
| shipment_date | DATE | Date the shipment was recorded |
| shipment_status | VARCHAR(30) | Current shipment status |
| Column | Type | Description |
|---|---|---|
| facility_idPK | INT | Unique fulfillment center identifier |
| facility_code | VARCHAR(20) | Operational facility code |
| region | VARCHAR(30) | Supply chain region |