Skip to main content
AG·SORA
ERP & Operations

Demand Forecasting with AI and ERP Data: A Realistic Guide for Stock and Purchasing

Published 8 min readWritten by agsora.tech
AG·SORA / BLOGAG·SORAERP & OperationsDemand Forecasting with AIand ERP Data: A RealisticGuide for Stock andPurchasingagsora.tech
In this article

Almost every operational decision in trading and manufacturing companies starts with one question: how much will we sell? The answer determines how much is ordered from suppliers, how much raw material is prepared, how many people are scheduled in the warehouse, and how much money is tied up in inventory. In many companies the answer still comes from the purchasing team's gut feeling or a three month sales average in a spreadsheet.

AI assisted demand forecasting promises a better way. But the promise is often overstated, as if a sophisticated model could predict the future precisely. This article looks at demand forecasting realistically: what ERP data you need, which methods make sense for a mid sized company, how to measure whether forecasts are actually improving, and how to connect the results to purchasing and production decisions.

Summary

  • Forecasts are never exact; the goal is to reduce error and be aware of uncertainty, not to eliminate it
  • Historical sales data in the ERP is the foundation, but it must be cleaned of distortions such as stockouts, promotions, and one off orders
  • Start with simple statistical methods as a baseline, and use machine learning only if it proves more accurate
  • Measure forecast accuracy and bias regularly by item group, not just an overall average
  • Forecasts only create value when connected to purchasing, production, and safety stock planning in the ERP, with room for human judgement

Why demand forecasting matters

Forecast errors always end in cost. Forecasts that are too high fill the warehouse with slow moving goods, tie up working capital, and raise the risk of damage or expiry. Forecasts that are too low cause stockouts, send customers to competitors, and force the team into emergency purchases at higher prices. Both directly affect cash flow.

Better forecasts do not have to be perfect to pay off. Reducing error on high value or high volume items alone can improve service levels and lower inventory at the same time. That is why demand forecasting is often one of the AI applications most easily tied to measurable business results.

The data you need from the ERP

A forecasting model is only as good as the data it is given. Most of the data you need already exists in the ERP, as long as it is recorded properly.

  • Sales or shipment history per item, per location, and per day or week
  • Stock history, to know when items were out of stock so sales did not reflect true demand
  • History of promotions, discounts, and price changes
  • Item data: category, launch date, active or discontinued status, and substitute items
  • Customer or channel data for B2B sales, because large orders from one customer can distort patterns
  • Supplier lead times and minimum order quantities, needed when forecasts are turned into purchase plans

The quality of master data is decisive. If one product is recorded under several codes, or substitute items are not linked to the old item, the model sees a fragmented history.

A warehouse aisle with tall racks stacked with cardboard boxes
Every box in the warehouse is the result of someone's forecast of upcoming demand.

Sales are not always demand

One of the biggest traps is treating sales figures as demand. If an item was out of stock for two weeks, its sales were zero even though customers kept looking for it. If this data is used as is, the model forecasts lower demand, stock gets thinner, and the item runs out even more often. Stockout periods need to be flagged and corrected before the data is used to train a model.

The same applies to promotions. A sales spike during a big discount is not a normal pattern, and it is often followed by a dip as customers have stocked up. One off project orders from large customers should also be separated from routine demand.

Forecasting methods: from simple to sophisticated

Basic statistical methods

Moving averages, exponential smoothing, and models that account for trend and seasonality have been used for decades. They are easy to understand, quick to compute, and often good enough for items with stable demand patterns. Most importantly, they are a mandatory baseline. Any AI model must be shown to be more accurate than these simple methods before it is worth using.

Machine learning

Machine learning models, such as tree based models or neural networks, can take many factors into account at once: price, promotions, holidays, weather, payday, and data from similar items. Their advantage shows in portfolios with thousands of items, many locations, and strong promotional effects. A single model can learn from patterns across the whole portfolio, so items with short histories benefit from the patterns of other items in the same category.

But machine learning is no guarantee. For companies with few items and short data histories, complex models can lose to simple methods because they overfit to past coincidences. Models that are hard to explain also tend not to be trusted by the purchasing team, so their output gets ignored.

Language models and generative AI

Generative AI such as large language models is not the main tool for calculating forecast numbers. Its role is better as support: summarising why an item's forecast changed, answering planners' questions in everyday language, or helping process unstructured information such as promotion plans from the marketing team. A broader discussion of these limits is in our article on AI risks in operations.

Not every item should be forecast the same way

An item portfolio usually consists of several groups with different characteristics. Treating them all with one method rarely gives the best result.

  • Fast movers with stable demand: statistical methods or machine learning usually work well, with the focus on accuracy
  • Seasonal items: need several seasons of history and special attention to the start and end of the season
  • Items with infrequent, irregular demand, such as spare parts: specialised methods for intermittent demand, and often better managed with minimum stock rules
  • New items without history: use patterns from similar items and sales team judgement, then update quickly once early data arrives
  • Items being discontinued: reduce purchasing in a planned way to avoid dead stock

This grouping complements the value based item classification covered in our article on stock planning and reordering.

Measuring whether forecasts improve

Without measurement it is hard to judge whether an AI project is delivering. Two things need monitoring. First, accuracy: how far forecasts miss reality. Common measures include mean absolute percentage error and absolute error weighted by sales volume or value. Second, bias: whether forecasts tend to be consistently too high or consistently too low. Consistent bias is often more damaging than random error, because it keeps piling up stock or keeps causing stockouts.

Measure accuracy at the level relevant to the decision. If purchasing happens per item per warehouse each week, accuracy must be measured at that level too, not just the company's total monthly sales. Always compare against a simple baseline method and against the manual forecasts used before.

Test on data the model has never seen

Accuracy must be tested on a period not used to train the model, for example by training on data up to a certain month and testing on the months that follow. A model that looks highly accurate on training data can fail completely on new data.

From forecast numbers to decisions

A forecast stored in a separate report rarely changes anything. Its value appears when the forecast flows into planning processes in the ERP: calculating reorder points, setting safety stock based on forecast uncertainty and supplier lead time, building production plans, and preparing draft purchase orders for the purchasing team to review.

Safety stock should not be a fixed figure for every item. Items whose forecasts often miss or whose suppliers are unreliable need a bigger buffer than items with stable demand. Connect planning to supplier performance evaluation as well, because inconsistent lead times are just as costly as a missed forecast.

A laptop displaying a dashboard with charts and report tables
A good forecasting dashboard shows the numbers, the range of uncertainty, and the items that need attention.

The role of human judgement

Sales and marketing teams often know things that are not in the data: a large customer opening a new branch, a competitor running out of stock, or a campaign launching next month. A good system leaves room for manual adjustments but records who changed what, by how much, and why. With that record, the company can judge whether manual adjustments actually improve forecasts or add bias.

How to start

  1. 01Choose one important item category with relatively clean data as a pilot
  2. 02Gather sales and stock history covering at least several seasons, then flag stockout periods, promotions, and one off orders
  3. 03Calculate the accuracy of the forecasts used today as a starting point
  4. 04Build a simple statistical method as a baseline, then test more sophisticated models against it
  5. 05Connect the best forecast to reorder point calculations and draft purchase orders in the ERP
  6. 06Track accuracy, bias, item availability, and inventory value every month, then expand to other categories

If data is still spread across several systems, the first step may be bringing it together, for example through a data warehouse. For companies just getting started, our article on starting AI automation in operations offers guidance on choosing a realistic first AI project.

Common mistakes

  • Training models on raw sales data without correcting for stockout periods
  • Measuring accuracy only on totals, so large item level errors stay hidden
  • Jumping straight to complex models without a simple baseline
  • Letting forecasts stop at a report without connecting them to purchasing
  • Ignoring input from the sales team, or conversely allowing manual adjustments without records and evaluation

Conclusion

AI demand forecasting is not magic, but it is not just a trend either. With clean ERP data, methods chosen on evidence, honest accuracy measurement, and integration into purchasing and production, mid sized companies can reduce both overstock and stockouts at the same time. Start with one category, measure the results, and expand step by step. Consistent, measurable results are worth far more than the most sophisticated model that the team itself does not trust.

Want demand forecasts connected to your ERP?

The AG·SORA team helps clean your data, build measurable forecasting models, and connect them to stock and purchase planning. The first consultation is free with no obligation.

Free Consultation

Free checklist: choosing a software house

24 points to evaluate a vendor before you sign. Can be saved as a PDF.

Get the checklist

Ready to build a system that grows with your business?

Discuss your needs with the AG·SORA team, no cost, no commitment.