Skip to content
SwankyForge
SwankyForge
All case studies
ForecastingOptimizationAnalytics4 months

Demand Forecasting + Inventory Optimization

Planning ran on a spreadsheet and one growth rate. Stock now follows actual demand.

Weighted MAPE

2.7%

Reconciled hierarchical forecast

Was

12.1%

Spreadsheet with blended growth rate

In plain terms

What this actually was.

No jargon in this section. The technical write-up is further down.

What was going wrong

Planning used spreadsheets and a single growth assumption applied to everything. Popular lines ran out while slow ones sat in the warehouse tying up cash, and nobody could put a number on the trade-off between the two.

What we built

We built forecasting that works product by product and adds up consistently to category and company totals, plugged into the planning process people already used, and able to answer what-if questions.

What changed

Forecast error fell from 12.1% to 2.7%. Cash previously tied up in the wrong stock was released without more items running out, and planners now review the exceptions instead of rebuilding spreadsheets.

Architecture

How it fits together.

Scroll through the stages. Anything marked as added is a component that did not exist before this project.

PER LEVELERP + POSDAILYFeature buildCALENDAR + PROMOForecast modelHIERARCHICALReconciliationCOHERENTStock optimiserSERVICE LEVELPlanner UIEXCEPTIONS
  1. ERP + POS

    daily

    feeds
    Feature build
  2. Feature build

    calendar + promo

    receives from
    ERP + POS
    feeds
    Forecast model
  3. Forecast model

    hierarchical

    We added this
    receives from
    Feature build
    feeds
    Reconciliationper level
  4. Reconciliation

    coherent

    We added this
    receives from
    Forecast modelper level
    feeds
    Stock optimiser
  5. Stock optimiser

    service level

    We added this
    receives from
    Reconciliation
    feeds
    Planner UI
  6. Planner UI

    exceptions

    receives from
    Stock optimiser
The write-up

How it was actually built.

Dataset, approach, measured results and the stack. Written for whoever has to review it.

ForecastingOptimizationAnalytics4 months

Demand Forecasting + Inventory Optimization

Forecasting that plugs into planning workflows and supports what-if scenarios.

Problem

Planning ran on spreadsheets with a single blended growth rate. Fast movers stocked out while slow movers tied up working capital, and nobody could quantify the tradeoff.

Dataset

rows
31M SKU-days
features
178
sources
ERP, POS, promotions, weather
window
48 months

Approach

  1. 01Built a hierarchical forecast reconciled across SKU, store and region
  2. 02Backtested with rolling-origin evaluation rather than a single split
  3. 03Modelled promotions and calendar effects as explicit regressors
  4. 04Fed forecasts into a safety-stock optimiser with service-level targets

Metrics

2.7%
weighted MAPE
-9.4pp
97.3%
forecast accuracy
12-week horizon
-34%
stockouts
on A items
-21%
inventory held
same service level

Business impact

  • Working capital released without hurting availability
  • Planners review exceptions instead of rebuilding spreadsheets
  • Promotion decisions backed by a measured lift estimate

Tech stack

  • Python
  • Prophet
  • CatBoost
  • dbt
  • BigQuery
  • Looker
  • Airflow

Next

Need a system like this?

Answer six questions and we will tell you whether this shape fits your problem — including when it does not.