Volver al blog

Artificial Intelligence

Demand forecasting with AI in retail: how to start

What data you actually need, why the stockout log is the one most often missing, and how to handle sales series in a high-inflation economy.

Of the AI use cases in retail, demand forecasting comes up most often in the first conversation and stalls most often in the same place: not in the model, but in the state of the data.

This article covers what is actually required to start, which piece of data is almost always missing, and a point about high-inflation economies that invalidates much of what is written in material produced for other markets.

If you are looking at the full industry picture, AI for retail and commerce maps where it creates value and what to resolve before starting.

Why this case usually comes first

Because the effect is direct and measurable in two lines every retailer watches: capital tied up in inventory and sales lost to unavailability.

It does not change the customer experience, does not touch the shop floor and does not depend on anyone adopting a new tool: it improves a decision the business already makes every week. That combination — measurable impact, low organizational friction — is what makes it a good first project.

What data is actually needed

The minimum list is shorter than people expect:

Sales by product, by location and by day. Not by month: monthly aggregation erases weekly patterns, which are strong in retail. And not aggregated across locations, because demand at a neighbourhood store does not resemble demand at a shopping centre.

Price in each period. Without price, the model attributes to seasonality what was actually a price cut.

Promotions and commercial activity, with dates. If there was a promotion in November and it is not recorded, the model learns that November sells well and will forecast the same for the following November without one.

The calendar. Public holidays, commercial dates, back-to-school. Local discount events and long weekends shift buying behaviour differently from market to market, so they are worth marking explicitly.

Two full cycles of the pattern you want to capture. For annual seasonality, about 24 months.

The data that is almost always missing

The stockout log.

It is the most underestimated problem in this use case, and worth explaining because it invalidates results without anyone noticing: if a product was out of stock for three weeks, sales for those three weeks were zero. But demand was not zero: it was people who wanted to buy and could not.

A model trained on that history learns the product sells poorly. So it recommends buying less. So it runs out again. The error reinforces itself, and from the outside the model looks accurate, because the forecast matches actual sales.

So before modelling anything, the question to be able to answer is: does the system record when a product was unavailable? If the answer is no, there are two paths — reconstruct it approximately from inventory movements, or start with high-turnover products where stockouts were infrequent.

Forecast units, not revenue

Much of the material on forecasting is written for low-inflation markets, where a revenue series is a reasonable proxy for demand. In a high-inflation economy it is not.

A sales series in local currency mixes two things that move for different reasons: how many units sold and at what price. Under inflation, a product's revenue can grow steadily while units fall. A model trained on revenue will read that rising curve as rising demand.

What we do:

  1. Forecast units, not revenue.
  2. Treat price as an explanatory variable, not as part of the target.
  3. If a value series is needed — for financial planning, say — deflate it with a consistent index and state which one was used.

It is a simple adjustment and it changes the result entirely. It is also why a tool configured with another market's default assumptions tends to underperform.


Not sure where to start? We review your operations and opportunities to recommend how to adopt AI effectively, at no cost or commitment. Write to us at info@whitespacetech.xyz.


Where to start: a subset, not the catalogue

The most common scoping mistake is trying to forecast the whole catalogue from day one.

Split the catalogue by turnover and start at the top:

High turnover. Products with consistent daily sales. This is where methods work best, where there is most data and where most of the tied-up capital sits. Start here.

Medium turnover. Works, with more error.

Intermittent demand. Products selling a few units a week or less. A different problem, with its own methods and lower precision. Do not mix it into the same evaluation — it drags the numbers down and makes it look as though nothing works.

A reasonable first scope: the products that account for most of the revenue, in a limited group of locations, over a period with clean data.

How to measure it

The trap in this use case is evaluating the model against itself. The comparison that matters is against the method in use today, which is almost always a buyer's judgement.

That means measuring first. Before starting: take the current forecasts — even if they live in a spreadsheet — and record for a few weeks what was expected and what happened. That is the number to beat.

Then three indicators worth watching together rather than separately:

  • Forecast error, in units and in percentage, by turnover group.
  • Stockouts: how often a product that should have been available was not.
  • Tied-up capital: how much stock there is and how fast it turns.

Three, because you can improve one by worsening another. A model that over-forecasts eliminates stockouts and grows inventory. Viewed alone, it looks like a success.

Which KPIs to watch in a retail AI project covers the full set, and the business case calculator lets you estimate the return with your own figures.

Three mistakes we see often

Automating purchasing from day one. The forecast and the purchase decision are two different things. For the first few cycles, have the model propose and a person approve, until there is evidence of where it goes wrong.

Not defining which deviation triggers a review. A forecast is an estimate with a margin of error. The process has to state, before starting, at what deviation someone steps in.

Asking the model to explain what it cannot know. If a competitor opened two blocks away, the model does not know. That information comes in through the commercial team, and the process has to leave room for it.


We support AI projects in retail end to end: assessment, implementation and team training. To discuss whether this case makes sense for your operation, write to us at info@whitespacetech.xyz or see AI for retail and commerce. The initial assessment is free of charge.

Frequently asked questions

How much history is needed to forecast demand?

As a rule of thumb, two full cycles of the pattern you want to capture. For a business with annual seasonality, that is roughly 24 months of sales by product, location and day. You can start with 12 months, but the model has no way to tell real seasonality from a one-off event, and that is worth knowing before rather than after.

Does it work if I sell few products or few units per day?

Intermittent demand — products selling a few units a week or less — is a different and harder problem than high-turnover items. There are specific methods for it, but results tend to be less precise. Split the catalogue by turnover from the start rather than judging everything by the same standard.

Why can forecasting in currency terms mislead in a high-inflation economy?

Because a revenue series mixes two things that move for different reasons: how many units sold and at what price. Under inflation, a revenue series can rise while units fall. For demand forecasting, work in units and treat price as a separate explanatory variable.

Does it replace the buying team?

Not in the cases we see. What changes is where the team's judgement is applied: instead of building the base number product by product, it concentrates on exceptions, commercial decisions and products where the model has little information. Routine decisions drop in volume; the hard ones stay human.

How long does it take to get into production?

It depends far more on the state of the data than on the model. When sales history is complete and accessible, a pilot on a subset of the catalogue takes weeks. When history has to be reconstructed, product codes unified across systems, or the stockout log recovered, that preparation is usually the longest part of the project.

What if the model gets it wrong?

It will: a forecast is an estimate with a margin of error, not a certainty. So the useful question is not whether it fails, but how much better it is than the current method and what the process does when it fails. Before automating replenishment, define which deviation triggers a human review.

Todos los artículos

Innovemos juntos

Escribinos