Guides

How MySales Generates a Forecast

A detailed walkthrough of the MySales demand forecasting engine — covering its hierarchical approach, data preparation stages, influencing factor analysis, and special algorithms for new items and distribution expansion.

🔑 Key Takeaways
  • MySales generates forecasts across six hierarchical levels, from total chain down to individual SKU-store combinations, processing terabytes of data for large retailers.
  • The engine automatically cleanses historical sales, isolates influencing factors (price, promotions, weather, macro indicators), and selects the best-performing model without manual intervention.
  • Specialized algorithms handle new items and distribution expansion, ensuring accurate forecasts even when historical data is limited or absent.
  • Built-in safety stock calculation, short-term forecast adjustments, and promotional uplift modeling deliver a complete, order-ready output in a single pipeline run.

Overview

MySales is built on a mathematically rigorous forecasting engine validated across hundreds of millions of SKU-store combinations. It produces stable, high-quality demand forecasts for every item in every store, fully automated and at scale.

The engine operates across six hierarchical levels, progressing from the most aggregated view down to the most granular:

Level Scope
Product category — entire chain Broadest demand signal
Product category — region Regional category trends
Product category — store Store-level category patterns
SKU — entire chain Chain-wide item demand
SKU — region Regional item behavior
SKU — store Most granular forecast unit

This hierarchical structure is fundamental. When the engine cannot determine a reliable relationship at a detailed level (for example, price elasticity for a single SKU in a single store), it draws from higher levels in the hierarchy where more data is available. The result is a forecast that is both granular and statistically robust.

📈 Scale in Practice

A chain with 100 stores and 10,000 SKUs produces one million SKU-store combinations. Multiply that by 3-4 years of daily history, and a single forecast recalculation processes gigabytes of data for small chains and terabytes for large ones. MySales handles this through parallel data packaging across multiple processing threads.


Stage 1: Data Ingestion and Preparation

The forecasting pipeline begins by loading all relevant data from the database management system and from MySales file storage (an optimization layer that reduces database load at high data volumes).

Data sources include:

  • Historical sales, prices, discounts, inventory levels, and receipt data
  • Product hierarchy and item master data
  • Geographic hierarchy and store master data
  • External sources: weather, macroeconomic indicators, and competitor pricing

For new stores or new SKUs, the system supplements missing history using analog stores or items. It always prioritizes actual sales data where available, applying analog data only for periods where no information about the new entity exists.

Once loaded, data is grouped into processing packages and distributed across multiple parallel threads (typically 3 to 9) for concurrent calculation.


Stage 2: Sales Cleansing and Baseline Extraction

Before the engine can calculate trend and seasonality, it must separate genuine demand patterns from the noise introduced by price changes, discounts, promotions, and stockouts.

Primary sales cleansing removes the effects of these influencing factors from the historical record. Rather than discarding affected periods entirely, MySales isolates and quantifies each factor's impact. This preserves as much sales history as possible, which is critical in retail environments where frequent assortment rotation leaves few unaffected periods.

Periods with significant lost sales caused by stockouts or insufficient inventory are excluded at every stage of the analysis.

📈 Handling Limited History

This cleansing approach enables reliable trend and seasonality estimation even when sales history is as short as one year. Where gaps remain, the engine fills them using data from higher forecasting levels in the hierarchy.

Seasonality calculation uses both methods simultaneously:

Method When It Applies
Multiplicative seasonality (seasonal index) Seasonal volatility scales with the overall trend
Additive seasonality Seasonal variation remains constant regardless of trend

The system automatically selects the method that best fits each combination. At the product group level, it also calculates seasonality of the average group price, capturing the tendency for seasonal demand peaks to coincide with higher average prices.

Trend calculation follows. After removing the effects of price, discount, promotion, and seasonality, the engine calculates the overall sales growth or decline trend, along with average and median sales from the cleansed data.


Stage 3: Influencing Factor Analysis and Model Selection

With a clean baseline established, the engine turns to quantifying how each external factor drives demand.

Dependency analysis evaluates the relationship between sales and each influencing factor: price, discount, weather, macroeconomic indicators (such as exchange rates), cannibalization effects, and others. When evaluating each factor, the system selectively removes the impact of more dominant factors (for example, promotions and seasonality) to isolate the true effect.

When analyzing price dependency, the system also evaluates inflation or deflation trends to cleanse historical prices from nominal distortions.

📖 Seasonal Factor Differentiation

Several factors are analyzed separately for low, medium, and high seasons. For example, price elasticity for ice cream differs substantially between winter and summer. The engine captures these distinctions automatically, producing season-specific coefficients rather than blended annual averages.

The engine then populates two matrices:

  1. Historical predictor matrix -- the observed values of all influencing factors over the historical period, including derived metrics such as the ratio of current-period price to average price over previous periods.
  2. Future predictor matrix -- projected values for each factor, using a differentiated approach: simple averages or medians for some factors, forecasted values for others, and user-entered data (assortment plans, future prices, promotional calendars) where available.

Correlation coefficients are calculated from these matrices, and the engine automatically forms candidate forecasting models from the factors that demonstrate meaningful influence on sales.

Model testing and selection follows. The engine evaluates both automatically generated models and preconfigured models against historical sales accuracy. During evaluation, periods of insufficient inventory and high-impact promotions are excluded. The model with the best historical accuracy is selected.


Stage 4: Forecast Generation and Refinement

Once the best model is selected, the engine generates the forecast for future periods. A series of refinement procedures then ensures stability and reliability.

Post-generation refinements include:

  • Calculation of minimum sales values to prevent unrealistic low forecasts
  • Autocorrelation analysis of model error, used to adjust the forecast for the coming weeks
  • AutoMult predictor calculation, which (depending on configuration) adjusts the forecast for the next 6 weeks based on the ratio between average forecast and average actual sales over the last 3 weeks

Promotional uplift is calculated next. The engine applies uplift coefficients generated by a set of neural networks, or uses data from comparable historical promotions where identified. Uplifts are adapted to the individual characteristics of each SKU-store combination, with minimum and maximum limits applied to ensure stable results for items with limited promotional history.

After promotional uplift calculation, the engine performs model rebalancing across all influencing factors. This step is necessary because price and promotion effects are often highly correlated, and the rebalancing ensures that the combined promotional forecast remains internally consistent.

📖 Cross-Store Promotion Control

An optional feature controls promotional forecast distribution across stores. If any store-level promotional forecast deviates more than +/-30% (configurable) from the group average, the system adjusts it back within range. This prevents unreliable forecasts for stores with limited history where price elasticity and other dependencies could not be determined with confidence.


Stage 5: Safety Stock, Short-Term Adjustments, and Final Outputs

With the core forecast complete, the engine calculates the operational outputs required for replenishment.

Safety stock is calculated as the standard deviation of forecast error versus historical sales. To capture seasonal variation in demand volatility, the forecast is divided into three ranges (high, medium, and low season), and safety stock is calculated separately for each.

Short-term forecast adjustment refines the next 2 weeks (configurable) using average daily sales from the most recent 7-14 days of in-stock periods. The system loads the last 28 days of sales data, identifies days when the item was available, and calculates average daily sales separately for promotional and non-promotional periods. Seasonal peaks are excluded, and the averages are adjusted for seasonality, price, weather, and other factors. The result appears as the Daily Adjustment predictor.

Additional final-stage outputs:

Output Purpose
Master forecast adjustment Incorporates user-entered manual overrides
Price recommendations Determines optimal price points for revenue or margin
Historical economic effect estimation Quantifies potential gains from increased sales, identifies lost sales from unknown factors, and estimates potential inventory reductions

Special Algorithms

MySales includes purpose-built algorithms for two scenarios where standard forecasting approaches fall short.

New items without assigned analogs. When a new item enters the assortment and no analog has been assigned, the engine uses the sales of an average item within the product group. It adjusts this baseline for the group's price elasticity using the specific price of the new item, and applies additional constraints to ensure stable, accurate results.

Distribution expansion. When an item is expanding from a subset of stores to a broader footprint, the engine generates forecasts for stores with no prior sales history.

📖 Distribution Expansion in Action

Consider an item previously sold in 10 out of 30 stores in a region. Based on strong performance, a category manager lists it in all 30 stores. For the 20 new stores, the engine draws on sales dynamics at the SKU-region, product group-region, and product group-store levels to produce a forecast where no store-level history exists.

The full set of influencing factors used by the system is defined by the user and can be customized to match each retailer's specific data environment and business requirements.


What This Means for Your Business

The MySales forecasting engine is designed to eliminate the manual effort and guesswork that characterize traditional demand planning. Every stage of the pipeline, from data cleansing to model selection to promotional uplift calculation, runs automatically and adapts to the specific characteristics of each SKU-store combination.

For enterprise retailers, this delivers three concrete outcomes. First, forecast accuracy improves because the engine evaluates every meaningful demand driver and selects the best model from hundreds of candidates, something no analyst team can replicate manually at scale. Second, operational efficiency increases because the entire pipeline, including safety stock and short-term adjustments, runs end-to-end without human intervention. Third, edge cases are handled systematically: new product launches, distribution expansion, and limited-history items all receive purpose-built algorithmic treatment rather than ad-hoc workarounds.

The result is a forecasting foundation that scales with your business, from hundreds of SKUs to hundreds of thousands, without proportional increases in planning headcount or complexity.

Ready to write your success story?

Let us show how MySales Labs can deliver the same results for your network.