1 Load your SAP export
Drop a CSV file here, or choose a file
Sales history exported from SAP (for example VA05, VF05 or an SE16 table) saved as CSV or TXT.
3 Portfolio overview
ABC ranks items by share of sales value, or quantity if there is no net value column (A = top 80%, B = next 15%, C = last 5%). XYZ ranks by demand stability using the coefficient of variation (X < 0.5 steady, Y 0.5–1.0 variable, Z > 1.0 erratic). Click a row to see its forecast. Formulas are explained in How Tanaw Demand Planning calculates at the bottom of the page.
4 Item forecast
5 Control chart (I-MR)
Lean Six Sigma check for unusual months. Points outside the limits are special-cause signals worth investigating.
6 Safety stock
Buffer stock to cover forecast error during the replenishment lead time.
Safety stock = Z × forecast error (RMSE) × √lead time. Reorder point = average monthly forecast × lead time + safety stock.
7 Sales input
Contracts or orders the sales team expects. They are added to the statistical forecast in the plan, sales figures, downloads and report.
Add to forecast: extra business on top of the normal forecast (e.g. a new customer). Replace forecast: that month's quantity is the contract, instead of the forecast (best for items that sell on contracts, whose forecast is already an average of past contracts). Chance: a 60% chance of 1,000 adds 600. Entries are lost when the page is reloaded, so download them to keep them.
How Tanaw Demand Planning calculates The formulas, statistical models and planning practices behind every number in the app.
Notation: yt = actual quantity in month t, ŷ = forecast, n = months of history, h = months ahead.
1. Preparing the data
- Rows are added up per item and calendar month. Returns (negative quantities, e.g. SAP
12-) are netted out; a month whose net total is below zero counts as 0. - Each item's history runs from its first sale to the last month in the whole file. Months with no rows count as 0 sales, so every item and every business group / team view forecasts the same months.
- Rows with an unreadable date, quantity or item code are skipped and counted, with an example of what could not be read.
- Plants can be combined or forecast separately; business group and team filters forecast only the rows that match.
2. Demand statistics and ABC / XYZ classification
- XYZ (stability, by coefficient of variation): X if CV < 0.5 (steady), Y if 0.5 ≤ CV ≤ 1.0 (variable), Z if CV > 1.0 (erratic).
- ABC (importance, Pareto): items are sorted by net sales value (or quantity if there is no net value column). An item is A while the cumulative share before it is under 80%, B under 95%, otherwise C.
- Intermittent: more than 30% of months with zero sales (typical for contract-driven items and spare parts).
- Seasonality test (lag-12 autocorrelation), used with 24+ months of history; above 0.3 counts as seasonal:
r12 = Σt>12 (yt − ȳ)(yt−12 − ȳ) / Σ (yt − ȳ)²
3. Forecasting methods
Every method's settings (α, β, γ) are chosen by grid search to minimise the mean squared one-step-ahead error on the item's own history: MSE = (1/N) · Σ (yt − ŷt|t−1)²
3-month moving average
A simple, robust baseline. Fewer than 3 months: the average of what there is.
Simple exponential smoothing (SES)
Recent months weigh more than older ones. Start: ℓ0 = y1. α from 0.05 to 0.95 in steps of 0.05.
Trend: Holt's method with damping
bt = β(ℓt − ℓt−1) + (1 − β)·φ·bt−1
ŷn+h = ℓn + (φ + φ² + … + φh)·bn
Follows the level ℓ and the trend b. The damping factor φ = 0.95 makes the trend fade over time, so long horizons don't run away (damped trends are among the most accurate methods in forecasting competitions). α 0.1–0.9, β 0.05–0.5.
Seasonal: additive Holt-Winters (12-month season)
bt = β(ℓt − ℓt−1) + (1 − β)·bt−1
st = γ(yt − ℓt) + (1 − γ)·st−12
ŷn+h = ℓn + h·bn + s (the latest seasonal value for that calendar month)
Adds a seasonal amount s for each calendar month. Start: level = first year's average, trend = (second year's average − first year's) / 12, seasonal values = first year minus its average. Used with 24+ months of history. α ∈ {0.1, 0.3, 0.5, 0.7, 0.9}, β ∈ {0.01, 0.11, 0.21}, γ ∈ {0.1, 0.3, 0.5, 0.7, 0.9}.
Intermittent: Croston's method with the Syntetos-Boylan correction (SBA)
ŷn+h = (1 − α/2) · z / p
z = typical order size, p = typical months between orders, q = months since the previous order. The forecast is an average monthly rate, so a quiet spell doesn't push it to zero; the (1 − α/2) factor removes Croston's known upward bias. Start: z = average order size, p = months ÷ number of orders. α 0.05–0.5.
4. Choosing a method automatically (“Best fit”)
- Fewer than 4 months of history → 3-month moving average.
- Intermittent (more than 30% zero months) → Croston (SBA). Comparing month-by-month errors would favour a forecast of zero, which is never useful for planning.
- Seasonal (r12 > 0.3 with 24+ months) → Holt-Winters. A short test window can miss the peak season, so seasonality is decided by the pattern, not the test.
- Otherwise → the method among moving average, SES and Holt with the lowest mean absolute error (MAE) on the hold-out test below.
The chosen method is then refitted on the full history. Planners can pick a different method per item in the item view.
5. Measuring forecast accuracy
The last H = min(6, ⌊n/4⌋) months are held back (at least 8 months of history needed). The method is fitted on the earlier months, forecasts the held-back months, and is compared with what really sold (an out-of-sample test):
- WAPE (weighted absolute percentage error) is used instead of MAPE, because MAPE divides by each month's sales and breaks on zero months. 100% means the forecast was zero (or equally far off) while the item sold.
- Bias shows direction: positive = over-forecasting, negative = under-forecasting. Within ±5% counts as balanced. For intermittent items, Bias (the error on the test-period total) is the better check, because the month an order lands can't be predicted.
- When the test months had no sales at all, WAPE and Bias are shown as “–”: there is nothing to divide by.
6. Forecast range (95% prediction interval)
Each method is written in error-correction form, where a surprise j months before a forecast month still moves it by a weight cj (Hyndman et al., state-space exponential smoothing):
| Method | Weight cj |
|---|---|
| SES | α |
| 3-month moving average | 2 / (k + 1) = 0.5 (behaves like SES with that α) |
| Holt (damped) | α + α·β·(φ + φ² + … + φj) |
| Holt-Winters | α + α·β·j, plus γ(1 − α) when j is a multiple of 12 |
| Croston (SBA) | α / p (the rate only moves when an order arrives) |
σ is the spread of the one-step errors, with degrees of freedom df = number of errors − number of smoothing settings chosen (0–3). The Student-t value (instead of 1.96) widens the range when there is little history. In simulation tests, 95–96% of actual months fell inside the range. It shows uncertainty in the statistical forecast; sales input is not part of it.
7. Control chart (I-MR, Statistical Process Control)
2.66 = 3 / d2 with d2 = 1.128, the standard constant for moving ranges of two points, so the limits are ±3 standard deviations. Signals of special-cause variation (Western Electric / Nelson rules):
- a month outside the control limits (check for promotions, stock-outs, one-off orders or data errors);
- 8 months in a row on the same side of the average (a shift in demand);
- 6 months in a row steadily rising or falling (a trend).
Common-cause variation (inside the limits, no pattern) is normal noise and should not be chased. For seasonal items, signals in peak months may simply be the season.
8. Safety stock and reorder point
L = lead time in months; RMSE = √[mean of squared one-step forecast errors] on the full history (forecast error is a better measure of risk than the spread of demand itself). Z by service level (chance of not running out during a lead time): 90% → 1.2816, 95% → 1.6449, 98% → 2.0537, 99% → 2.3263. The average monthly plan includes sales input.
9. Sales value and sales input
Forecast salesmonth = planned quantitymonth × average price
Only rows with both a quantity and a net value are used for the price, so returns and credit notes are netted out. With more than one currency in the file, sales totals are flagged as unreliable.
Replace: plan = forecast + chance × (quantity − forecast at the entry's business group / team level)
Replace is the expected value: with the given chance the month is the contract quantity, otherwise the statistical forecast. An entry counts in the business group / team view it was made for and in wider views, never in other groups or teams. The plan is never below zero.
10. Best practices
- Use complete months only. Export up to the end of the last full month; a half month looks like a sudden drop and pulls the forecast down.
- Clean history before trusting it. Use the control chart to find special causes (stock-outs, one-off orders, promotions, data errors) and confirm them with the team that knows.
- Plan by segment (ABC × XYZ). AX/BX items: trust the statistical forecast and review exceptions. AZ/BZ items: review with sales every cycle. CY/CZ items: keep it simple; rely on safety stock or make-to-order rather than forecast precision. Spend review time where the value is (A items).
- Watch bias as closely as error. A forecast that is always a little high or low builds up excess stock or shortages; a balanced forecast with some error is easier to buffer with safety stock.
- Statistical baseline + sales knowledge = consensus forecast. Let the model handle the regular pattern, and the sales team add what the history can't know (contracts, new customers, lost accounts). Record the reason in the note and use a realistic chance, as in Sales & Operations Planning (S&OP).
- Plan with the range, not just the number. The low/high range and safety stock show how much buffer the uncertainty needs.
- Review on a fixed rhythm. Re-run monthly with the new export, compare last month's plan with what actually sold, and look for items whose bias keeps the same sign.
- Keep like with like. One currency and one kind of demand per file: SAP billing (sell-in) and store POS sales (sell-out) behave differently and should not be mixed.
- Protect the data. Files are read only in this browser and never uploaded; keep real exports out of shared folders and version control.
References
- Hyndman, R.J. & Athanasopoulos, G. Forecasting: Principles and Practice (3rd ed.), OTexts, 2021: exponential smoothing, damped trend, Holt-Winters, accuracy measures.
- Hyndman, R.J., Koehler, A.B., Ord, J.K. & Snyder, R.D. Forecasting with Exponential Smoothing: The State Space Approach, Springer, 2008: prediction intervals.
- Croston, J.D. (1972), “Forecasting and stock control for intermittent demands”, Operational Research Quarterly 23(3).
- Syntetos, A.A. & Boylan, J.E. (2005), “The accuracy of intermittent demand estimates”, International Journal of Forecasting 21(2).
- Montgomery, D.C. Introduction to Statistical Quality Control, Wiley: I-MR charts and run rules.
- Silver, E.A., Pyke, D.F. & Thomas, D.J. Inventory and Production Management in Supply Chains, CRC Press: safety stock, ABC/XYZ.