What Demand Forecasting Is For
Every purchasing and production decision is a bet on future demand. When a buyer orders 2,000 cartons from a supplier with a six-week lead time, he is forecasting what customers will want in six weeks, whether he calls it that or not. The question is never whether to forecast. It is whether the forecast is explicit, measured and improving, or implicit, unmeasured and stuck in one person's head.
Artificial intelligence, in this context mostly meaning machine learning models trained on historical data, has made it practical to forecast more items, at a finer level, using more signals than a planner can handle with spreadsheets. But AI does not fix bad data, and it does not replace judgment about promotions, new customers or a supplier that has just doubled its lead time. The companies that get value from it treat it as one part of a planning process that sits on top of a clean ERP.
This guide explains how forecasting methods compare, which data they need, how to measure accuracy with real formulas, how forecasts turn into reorder points and purchase orders, and which Saudi calendar effects a model must understand.
Why Spreadsheet Forecasting Breaks Down
Most companies start with something like "last year's same month plus 10%". It works tolerably for a small catalogue of stable products. It fails in predictable ways as the business grows:
- Scale: a planner can review a few hundred items carefully. A distributor with 8,000 SKUs across six warehouses has 48,000 item-location combinations. Most of them get no real attention.
- Moving seasons: Ramadan and the Eids follow the Hijri calendar, which is about 11 days shorter than the Gregorian year, so they move earlier every year. "Same month last year" compares the wrong weeks.
- Stockouts hide demand: if an item was out of stock for three weeks, sales history shows low demand for those weeks. A naive forecast learns the stockout as if it were reality and orders too little next time.
- Promotions and one-offs: a single large project order or a promotion inflates history. Unless it is flagged, it inflates the next forecast.
- No feedback loop: without measuring error item by item, nobody knows which forecasts are good, which are biased, and whether overrides help.
Forecasting Methods Compared
"AI forecasting" covers a range of techniques. The right one depends on the item's demand pattern and the data available.
| Method | How it works | Strengths | Weaknesses |
|---|---|---|---|
| Moving average | Average of recent periods | Simple, transparent | Lags trends, ignores seasonality |
| Exponential smoothing (including Holt-Winters) | Weighted average favouring recent data, with optional trend and seasonal terms | Robust baseline, fast, works well on many items | Assumes regular seasonality on a fixed calendar |
| ARIMA and seasonal ARIMA | Statistical model of autocorrelation in the series | Well understood, good for stable series | Needs tuning, handles external drivers awkwardly |
| Prophet | Additive model of trend, seasonality and holiday effects, open-sourced by Facebook in 2017 | Handles custom holiday calendars such as Ramadan and Eid well | Can overfit noisy, short series |
| Gradient boosted trees (XGBoost, LightGBM) | Machine learning on many features: lags, prices, promotions, weather, calendar | Uses external drivers, learns across many items at once | Needs feature engineering and more data |
| Neural networks (LSTM and similar) | Deep learning on long sequences | Can capture complex patterns at scale | Data hungry, harder to explain |
| Croston and related methods | Forecast size and interval of demand separately | Designed for intermittent demand such as spare parts | Not suitable for regular demand |
| Ensembles | Combine several models | Often more stable than any single model | More complex to operate |
We deliberately do not quote accuracy figures for each method. Published accuracy numbers depend entirely on the dataset, the forecast horizon and the level of aggregation, and they rarely transfer to your business. The only accuracy number that matters is the one you measure on your own items, which is covered below.
The case for starting simple
A well-tuned exponential smoothing model with proper handling of the Hijri calendar and stockouts is a strong baseline. Machine learning earns its place when you have external drivers that matter, such as price changes, promotions, weather or project pipelines, and enough history to learn from them. Always compare an advanced model against the simple baseline; if it does not beat it on your data, keep the baseline.
The Data a Forecast Needs
Forecasting quality is limited by data quality, and most of the data lives in your ERP:
- Clean sales history by item, location and customer, ideally at least two years so that each seasonal event appears more than once. Returns netted against the original sale.
- Stockout flags: days when the item was unavailable, so lost demand can be estimated instead of learned as zero.
- Promotions and price history: what was on offer, when, and at what price.
- Unusual orders: one-off project or tender orders flagged so they do not distort the baseline.
- Item master data: category, unit of measure, pack size, shelf life, lifecycle status (new, active, phasing out) and substitutes.
- Supply data: lead times by supplier, minimum order quantities and pack multiples, which turn a forecast into an orderable quantity.
- Calendar: Hijri holidays, school terms, national holidays and your own events.
Units of measure deserve special attention. If one branch records sales in cartons and another in pieces, the model sees two different products. An ERP that handles multiple units of measure with fixed conversions, as Tranquil's inventory does, removes that problem at the source.
Measuring Forecast Accuracy
Take a hypothetical item over four weeks:
| Week | Actual | Forecast | Absolute error | Percentage error |
|---|---|---|---|---|
| 1 | 100 | 110 | 10 | 10.0% |
| 2 | 120 | 100 | 20 | 16.7% |
| 3 | 80 | 90 | 10 | 12.5% |
| 4 | 150 | 130 | 20 | 13.3% |
| Total | 450 | 430 | 60 |
- MAPE (mean absolute percentage error) is the average of the percentage errors: about 13.1%. It is intuitive but explodes on low-volume weeks, because dividing by a small actual gives a huge percentage.
- Weighted MAPE divides total absolute error by total actual: 60 ÷ 450 = 13.3%. It is more stable and better for comparing across items.
- Bias compares total forecast with total actual: (430 − 450) ÷ 450 = −4.4%. A persistent negative bias means you under-forecast and will run short; a persistent positive bias means excess stock.
Track both error and bias by item group, every month. Also track forecast value added: compare the accuracy of the model's forecast with the accuracy after planners' manual overrides. If overrides make forecasts worse on average, limit them to cases with real information, such as a confirmed large order.
From Forecast to Purchase Order
A forecast on its own does not reduce stock or prevent stockouts. It does that through the replenishment parameters in your ERP.
Worked example: safety stock and reorder point
A hypothetical item sells an average of 40 units a day. The standard deviation of daily forecast error is 12 units, the supplier lead time is 9 days, and the target service level is 95%, which corresponds to a z-value of about 1.65.
- Safety stock = z × σ × √lead time = 1.65 × 12 × 3 ≈ 60 units
- Reorder point = average demand during lead time + safety stock = 40 × 9 + 60 = 420 units
Now suppose a better forecasting model reduces the daily forecast error to 8 units. Safety stock falls to 1.65 × 8 × 3 ≈ 40 units and the reorder point to 400. Twenty fewer units are held for the same service level. At a unit cost of SAR 250, that is SAR 5,000 less stock on this item. This is the main mechanism through which forecasting pays: lower error means less safety stock for the same availability. For the underlying formulas, see our guides to safety stock and the reorder point.
Making the quantity orderable
The suggested order then needs to respect the supplier's minimum order quantity, pack multiples and truck or container capacity, and it should be reviewed against open purchase orders and stock in transit. Those are ERP functions, not forecasting functions, which is why the forecast must feed back into purchasing rather than sitting in a separate tool.
Saudi Calendar and Market Effects
| Effect | Why it matters | How to model it |
|---|---|---|
| Ramadan and the two Eids | Strong shifts in food, beverage, clothing and gifting demand; they move about 11 days earlier each Gregorian year | Hijri-based holiday variables with pre- and post-event windows |
| Hajj and Umrah seasons | Demand spikes in Makkah and Madinah for hospitality, food and transport | Region-specific event variables |
| Summer heat | Cooling, beverages and certain building activities rise or fall with temperature | Temperature or month variables by region |
| School calendar | Back-to-school stationery, uniforms and electronics | School term dates as events |
| National Day and Founding Day | Retail promotions and gifting | Fixed Gregorian events |
| Large sales events | Short promotional peaks in e-commerce and retail | Promotion flags with price data |
| Regional differences | Riyadh, Jeddah and the Eastern Province do not move in lockstep | Forecast by location, not only nationally |
Special Cases
New products
A product with no history can borrow the pattern of a similar item, scaled by expected volume. Where no analogue exists, structured judgment from sales teams and key customers is the starting point. The Delphi method, which refines expert estimates through anonymous rounds of feedback, helps avoid a single planner's bias.
Intermittent demand
Spare parts and slow movers sell in irregular lumps. Standard methods forecast a small number every week and are always wrong. Croston-type methods or simple min-max rules with periodic review usually work better.
Project-driven demand
Building materials and industrial supplies often depend on large projects. Link the forecast to the sales pipeline or confirmed tenders, and treat that demand separately from the run-rate business.
Governance and Responsible Use
Forecasting models do not usually process personal data, but they influence decisions about stock, staffing and customers, so they should be explainable and monitored. In Saudi Arabia, SDAIA's AI Ethics Principles, published in 2023, set out principles including transparency and explainability, reliability and safety, and accountability, and apply to private-sector AI stakeholders. In practical terms: document what each model uses, review its performance monthly, keep a human owner for each product group, and make sure a planner can see why a forecast changed.
A Six-Step Roadmap
- Clean the data: two years of sales history, returns netted, units of measure unified, stockouts and one-off orders flagged.
- Segment items: use ABC analysis by value and a variability measure to decide which items deserve advanced models and which need simple rules.
- Build the baseline: exponential smoothing with a Hijri holiday calendar. Measure its error and bias.
- Add drivers: promotions, prices and region-specific events, using machine learning where it beats the baseline.
- Connect to replenishment: update safety stock and reorder points from forecast error, and generate purchase suggestions in the ERP.
- Run the monthly cycle: review accuracy, overrides and exceptions in a demand review meeting. See our article on demand planning for how to run that process.
Pitfalls to Avoid
- Buying a model before fixing the data. If returns are not linked to sales and stockouts are not flagged, any model learns the wrong lesson.
- Forecasting only at national level. A national total can be accurate while every warehouse is wrong in opposite directions.
- Measuring accuracy once. Accuracy drifts as products, customers and suppliers change. It needs a monthly review.
- Ignoring bias. A forecast with modest error but consistent under-forecasting will still cause repeated stockouts.
- Leaving parameters static. If safety stock and reorder points are not recalculated when error falls, better forecasts never reach the warehouse.
Where the ERP Fits
Forecasting tools, whether built in-house or bought, depend on the ERP for clean history and for acting on the result. Tranquil's inventory management, purchasing and sales modules hold the item master, multi-unit stock, sales, returns and purchase orders in one database, and its customization services include reports and API integrations, which is how an external forecasting model can read history and return suggested quantities.
Frequently Asked Questions
How much history do we need for AI forecasting?
Ideally at least two years at weekly or daily level, so that each seasonal event appears more than once. For moving Hijri events, more years help the model separate the event from the Gregorian month.
Is machine learning always more accurate than statistical methods?
No. On many stable items, exponential smoothing performs as well as complex models. Machine learning helps when external drivers such as price, promotions or weather matter and enough data exists.
Which accuracy metric should we use?
Weighted MAPE for overall accuracy and bias for direction of error, tracked by item group. Plain MAPE becomes misleading on low-volume items.
How does forecasting reduce inventory?
Mainly through safety stock. Lower forecast error allows less safety stock for the same service level, which lowers reorder points and average inventory.
Does Tranquil include AI forecasting?
Tranquil provides the inventory, sales and purchasing data that forecasting relies on, and can connect to forecasting tools through API integrations as part of its customization services. Contact the Tranquil team to discuss your planning needs.

