Data analysis case · Beverage warehouse
Simulated damage · real volumes
- Estimated loss per month
- R$210.2K
- Of cases moved
- 0.84%
- Damaged cases in the period
- 67,426
- Items analyzed
- 9,708
One-minute summary
3 findings, 3 actions
46%
of the loss comes from 3 combinations
Handling breakage at picking, pallet fall at loading and handling breakage at loading. Across simulations it ranges 43%–50%; it depends mostly on how much damage happens at picking.
80%
of the cost is long neck
Glass is 51% of the volume and is damaged 2.4× as often as cans. The most robust finding: 76%–84% across every assumption range.
+46%
at picking, mix-adjusted
The raw rate shows +31% and makes the other stages look better, but that is just glass being replaced by cans (adjusted: −1%). The simulation plants +45%, and the method recovers it.
01Real data
Three facts come straight from Montgomery, with no assumptions. The key one: cans went from 38% to 54% of the volume between 2017 and 2026, which changes how any damage rate should be read.
Packaging mix by year
% of cases moved in each year with data
- Long neck (glass)
- Can
- Keg
- Other
Volume concentration
2.5%
234 of 9,537 items (class A) make up 80% of cases moved.
Reversals by package
Reversals are rare (0.013% of cases), but kegs show them in 26 of 27 months.
- Keg0.152%26 months with reversals
- Long neck (glass)0.015%23 months with reversals
- Can0.008%19 months with reversals
- Other0.003%9 months with reversals
As the mix shifts to cans, which break less, the raw damage rate falls on its own. Any damage target must be mix-adjusted.
02Loss Pareto
Each bar is one reason at one stage, sorted by cost. 9 combinations add up to 80% of the loss; the largest, handling breakage at picking, accounts for 27% on its own.
Damage cost by reason × stage
Label: % of cost · cumulative %. The dashed line marks the 80% cut-off.
Handling breakage at picking comes before anything else: it is the largest single item and it is growing.
03Packaging × stage
Long neck is 51% of cases moved and 80% of the damage cost. Picking is the most expensive stage for every package type.
Volume × cost by package
% of cases moved vs % of damage cost
Long neck (glass)
Can
Keg
Other
Damage rate by package and stage
% of that package's moved cases damaged at each stage
| Dock | Storage | Picking | Loading | |
|---|---|---|---|---|
| Long neck (glass) | 0.17%R$644K | 0.22%R$863.8K | 0.50%R$1.9M | 0.28%R$1.1M |
| Can | 0.07%R$117.9K | 0.10%R$153.6K | 0.21%R$338.7K | 0.12%R$185.9K |
| Keg | 0.02%R$8.8K | 0.04%R$22.3K | 0.10%R$54.2K | 0.05%R$26.5K |
| Other | 0.11%R$36.3K | 0.15%R$46.6K | 0.30%R$97.9K | 0.17%R$53.8K |
Glass-specific pallet protection and handling (corner boards, extra stretch film, plastic crates for split cases) target 80% of the cost.
04Monthly cost
Loss follows the volume moved. The source has long gaps (2018, 2020 to 2026): the chart keeps each continuous block separate and never connects distant months.
Damage cost per month
BRL per month · dashed lines mark months missing from the source
With the rate steady near 0.84%, monthly cost is volume × rate × price: lowering the rate is the only lever that does not mean selling less.
05Trend
The raw rate shows picking at +31% and the other stages falling. But the mix shifted to cans: holding the first window's mix fixed, picking rises +46% and the other stages stay flat. The increase was planted in the simulation (+45%) to test the method, and it recovers it.
Damage rate by stage, per window
Change vs the first window (W1 = 0%)
- Picking
- Dock · Storage · Loading
Track the mix-adjusted rate: the raw one mistakes a packaging shift for a process improvement.
06ABC curve
234 items (class A) make up 80% of the volume and 80% of the damage cost. Damage tracking turnover is a simulation assumption; the curve's value is telling you where to start.
Volume × damage cost by ABC class
A: 80% of volume · B: up to 95% · C: the rest
A234 items · 0.84%
B588 items · 0.86%
C8,715 items · 0.73%
The 10 items with the highest damage cost
Cost in the period and main reason
- 01
CORONA EXTRA LOOSE NR - 12OZ
Long neck (glass)· Handling breakage
R$323.7K
Rate 0.93%
- 02
CORONA EXTRA 2/12 NR - 12OZ
Long neck (glass)· Handling breakage
R$323K
Rate 1.20%
- 03
HEINEKEN 2/12 NR - 12OZ
Long neck (glass)· Handling breakage
R$273K
Rate 1.63%
- 04
MODELO ESPECIAL 24 LOOSE NR - 12OZ
Long neck (glass)· Handling breakage
R$199.4K
Rate 1.44%
- 05
HEINEKEN LOOSE NR - 12OZ
Long neck (glass)· Handling breakage
R$169.9K
Rate 0.87%
- 06
CORONA EXTRA 18PK NR - 12OZ
Long neck (glass)· Handling breakage
R$153.5K
Rate 1.47%
- 07
HEINEKEN 4/6 NR - 12OZ
Long neck (glass)· Handling breakage
R$152.8K
Rate 1.41%
- 08
STELLA ARTOIS 2/12 NR - 11.2OZ
Long neck (glass)· Handling breakage
R$108.5K
Rate 1.39%
- 09
FLYING DOG THE TRUTH 4/6NR - 12OZ
Long neck (glass)· Handling breakage
R$86.5K
Rate 2.84%
- 10
CORONA EXTRA 4/6 NR - 12OZ
Long neck (glass)· Handling breakage
R$85.8K
Rate 0.62%
Priority for protection and cycle counting: start with class A glass items, where volume and fragility add up.
07Robustness
120 simulations with assumptions drawn from plausible ranges: glass damaged 1.4× to 2.4× the base rate, picking taking 30% to 50% of the damage and a 0% to 60% increase planted in it. Each bar is a finding's p5–p95 range; the dot is the v1 value.
Range of each finding across simulations
Bar: assumptions varying (p5–p95) · dashed band: no planted increase
- Assumptions varying
- No planted increase
- v1 value
What each finding depends on
Rank correlation between the drawn assumption and the finding (−1 to 1)
| How much more glass breaks | Share of damage at picking | Increase planted at picking | |
|---|---|---|---|
| Long neck (% of cost) | +0.89 | −0.14 | +0.14 |
| Top 3 combinations (% of cost) | +0.18 | +0.92 | +0.29 |
| Picking, mix-adjusted (change) | +0.12 | +0.08 | +0.97 |
| Picking, raw rate (change) | 0.00 | +0.08 | +0.96 |
| Other stages, adjusted (mean change) | −0.05 | −0.14 | +0.09 |
Robust: long neck ≈ 80% of cost. Assumption-driven: the top 3 and the size of the increase. The trend method recovers the planted increase with a median error of -1.3 p.p.
08Simulator
Pick the stage, the package and how much to cut. The baseline is the period's monthly average of damaged cases; prices per case are assumptions and can be edited.
Estimated savings
R$26,964per month
R$323,568 per year · 319 fewer damaged cases per month
Current loss in this slice: R$89,880 per month (1,065 cases)
Where this slice's loss is
Monthly cost by stage, with the saved share
- Saved
- Remaining loss
- DockR$29.9K
- StorageR$40.2K
- PickingR$89.9K
- LoadingR$50.2K
Cutting picking damage by 30% saves R$26,964 a month; the same cut across all long neck saves R$50,371.
09What to do first
Each action comes from a finding and shows its estimated savings, assuming a 30% reduction.
- 01
Picking: handling and split cases
Handling training, plastic crates for split glass cases and a review of picking pace, where the loss is growing.
Estimated impact: R$26,964 per month
- 02
Long neck: pallet protection
Corner boards and extra stretch film on glass pallets, and no mixing of cans and glass when building loads.
Estimated impact: R$50,371 per month
- 03
Loading and storage: standards
A load-securing standard at loading and a stacking limit marked at each location, against pallet falls and over-stacking.
Estimated impact: R$26,874 per month on the top 3 combinations
- 04
Metric: mix-adjusted rate
Track damage with the packaging mix held fixed. The raw rate improves on its own when sales shift to cans and hides the worsening at picking.
Estimated impact: A target the mix cannot fool
10Method
A reproducible end-to-end pipeline, with tests and the SQL behind every chart one click away.
- 01
Extraction
Montgomery County (US): Warehouse and Retail Sales, open monthly data.
- 02
Cleaning
Beer and kegs, packaging from the description, returns kept apart.
- 03
Simulation
Damage with a fixed seed and stated assumptions, below the FAO ceiling.
- 04
SQL
SQLite with CTEs and window functions: one query per question.
- 05
Site
Versioned JSONs, static Next.js, contract tests in CI.
Decisions
Real volume, simulated damage
There is no open SKU-level damage data. Volume comes from a real warehouse; damage is simulated and labeled as such.
Calibration
Base rate of 0.6% of cases, multiplied by package and stage. FAO measures 13.2% food loss between harvest and retail (2021); packaged beverages lose far less.
Gaps respected
The source has 27 months of data between 2017 and 2026. Trends compare continuous blocks, never distant months as if they were consecutive.
Prices in BRL
The source has no prices. Each package has an average price per case, editable in the simulator.
Where each number comes from
- Volumes, packaging mix, ABC curve, reversalsReal data
- Average price per case (BRL)Assumption
- Base rate, how much each package breaks, share per stage, increase at pickingAssumption
- Damage by reason and stage, costs, Pareto, findingsDerived from simulation
Limits
- Damage and cost figures are illustrative: they show the method, not any company's reality.
- Packaging is inferred from the description; 9,708 items are classified automatically.
- No company data goes into the repository or the site.
Stack
- Python
- pandas
- NumPy
- SQL
- SQLite
- pytest
- ruff
- GitHub Actions
- Next.js
- TypeScript
- D3
- Motion
- Tailwind CSS
Reproduce
$ pip install -r requirements.txt
$ python src/extract.py && python src/transform.py
$ python src/simulate.py && python src/export_web.py
$ pytest -q
$ cd web && npm install && npm run dev