People First Service Center needs a weekly view of inventory shrinkage to help Operations Managers prioritize loss prevention. Write a PostgreSQL query that summarizes shrinkage by week, store, product category, and store manager, then identifies the two largest loss drivers for each store and week.
Requirements
- Calculate shrink units as expected units minus counted units, ignoring overages by treating negative shrinkage as zero.
- Calculate monetary loss using shrink units multiplied by unit cost, and aggregate results by week, store, category, and manager.
- Use
LEFT JOIN operations so audits with an unknown store or an unassigned manager remain visible, using clear fallback labels.
- Rank categories within each store and week by monetary loss and return only the top two drivers.
Use audits from January 2025 only. Exclude groups with no positive monetary loss.