How MySales Generates a Forecast
How Forecasting Works in MySales
MySales has a highly technological and mathematically advanced forecasting engine (Forecast Engine), tested on hundreds of millions of different product items and stores.
Its purpose is to ensure consistent Forecast quality for every SKU in every store.
Forecast generation is an automatic, multi-stage, iterative process with a hierarchical structure. The system analyzes large volumes of data, takes into account factors affecting sales, tests different models, and selects the model with the highest accuracy based on historical data.
At What Levels Is the Forecast Generated
MySales generates forecasts at six levels — from the most aggregated to the most detailed.
Level | Forecasting Level |
|---|---|
1 | Product Group / Entire Retail Chain |
2 | Product Group / Region |
3 | Product Group / Store |
4 | SKU / Entire Retail Chain |
5 | SKU / Region |
6 | SKU / Store |
When generating the Forecast, the system analyzes all available history at these levels, including the last 3–4 years of sales.
What Volumes of Data Does the System Process
For example, a retail chain has:
Stores — 100
SKU — 10,000
Total Number of Combinations — 1,000,000
For each combination, sales history for 3–4 years is taken into account.
During each recalculation of all forecasts, MySales analyzes:
Gigabytes of information — for small retail chains.
Terabytes of information — for retail chains with hundreds of stores.
Implementing such an algorithm requires not only significant computing resources but also extensive testing.
Even after developing the algorithm, it may take years of testing on millions of different items, fixing errors, and making significant efforts to optimize computational performance to an acceptable level before its use becomes economically beneficial.
Main Stages of Forecast Generation
MySales automatically performs a sequence of calculations for each combination at every forecasting level.
1. Data Loading and Preparation
MySales loads data from the Database Management System (DBMS) and the MySales file storage.
The file storage is used to speed up calculations and reduce the load on the DBMS when processing large volumes of information.
The system uses:
Data Type | What It Includes |
|---|---|
Historical Data | Sales, prices, discounts, stock levels, and receipts |
Product Data | Product hierarchy and product directory |
Store Data | Geographical hierarchy and store directory |
External Data | Weather, macroeconomic indicators, competitor prices |
2. Substitution of Analog Data
For new stores or new items, the system can use analog data.
At the same time, MySales:
Always uses up-to-date sales data for new stores and products.
Applies analog data only for periods in which information about the new item is unavailable.
3. Data Preparation for Parallel Computing
The system creates data batches for Forecast calculation in a multiprocessor environment.
Typically, 3–9 threads are used for processing.
4. Initial Cleaning of Sales History
Before calculating trends and seasonality, MySales cleans historical sales data of the influence of key factors.
This is necessary to separate the impact of prices, discounts, and promotions on sales and correctly calculate seasonal increases.
Cleaning features:
The system determines the influence of prices, discounts, and promotions without completely excluding the corresponding periods, leaving only the most extreme ones out of the analysis.
Periods with significant sales losses due to product unavailability or insufficient stock levels are excluded.
Missing periods may be filled with data from higher forecasting levels.
In retail, the sales history of many SKUs is often limited. This approach makes it possible to calculate trends and seasonality correctly even with limited sales history, for example, only one year.
5. Seasonality Calculation
MySales takes into account two types of seasonality:
Multiplicative seasonality — seasonal coefficient.
Additive seasonality.
The system selects the optimal application method depending on the volatility of seasonal periods.
At the product group level, the seasonality of the average group price is also calculated and used for long-term price forecasting.
6. Calculation of Trends and Average Sales
After cleaning the data of key factors and seasonality, MySales calculates:
The trend of overall sales growth or decline.
Average sales.
Median sales.
Cleaned historical data is used for these calculations.
7. Generation of Historical Predictor Values
MySales fills the initial matrix of historical predictor values — factors that affect sales.
Some predictors are calculated.
For example, a predictor may be the ratio of the current period's price to the average price over previous periods.
8. Analysis of Factors Affecting Sales
The system analyzes the relationship between sales and various factors:
Prices.
Discounts.
Weather.
Macroeconomic indicators.
Cannibalization.
Other influencing factors.
When calculating the influence of each factor, MySales cleans it of the influence of other significant factors, such as promotions and seasonality.
Additionally:
Price impact analysis takes into account inflation and deflation trends.
Certain factors are analyzed separately for low, medium, and high seasons to determine elasticity more accurately.
9. Using Factors from Higher Levels
If it is not possible to determine the dependence on factors at a detailed level, MySales uses key factors from higher forecasting levels.
For example, for the SKU / Store level, data from the following levels may be applied:
SKU / Region.SKU / Entire Retail Chain.
10. Generation of Future Predictor Values
The system fills the matrix of future values of influencing factors.
Depending on the predictor, the following may be used:
Approach | Source of Values |
|---|---|
Simple Average | Average values |
Forecast Values | Calculated future values |
User Data | Values entered by the user |
For forecasting, it is recommended to upload:
Assortment matrix.
Future prices.
Data on promotional activities.
11. Generation of the Automatic Forecasting Model
MySales calculates correlation coefficients and generates an automatic Forecast model based on factors affecting sales.
12. Model Testing and Selection
The system tests:
The automatic forecasting model.
Preconfigured Forecast models.
Based on historical data, MySales selects the model with the highest accuracy.
During testing, periods with insufficient product availability and promotional influence are excluded.
13. Forecast Generation for Future Periods
After selecting the most accurate model, MySales generates a sales forecast for future periods.
14. Ensuring Forecast Stability
To ensure Forecast stability and reliability, the system:
Calculates minimum sales.
Determines the autocorrelation of model errors.
Uses the obtained results to adjust the Forecast for the coming weeks.
15. Calculation of Promotional Uplifts
MySales calculates the increase in the forecast resulting from promotions.
For this purpose, promotional coefficients adapted to each SKU and store are used.
The system also sets minimum and maximum limits for promotional uplift.
16. Model Rebalancing
MySales rebalances the model, taking into account all influencing factors, to balance the impact of price and the promotional effect.
17. Calculation of the “Automult” Predictor
The “Automult” predictor is used to adjust the Forecast for 6 weeks.
The calculation is based on the ratio of:
Average forecast.
Average sales over the last 3 weeks.
18. Safety Stock Calculation
MySales calculates safety stock as the standard deviation of the forecast from sales.
The calculation is performed with division into three ranges:
High.
Medium.
Low.
19. Daily Forecast Adjustment
MySales adjusts the short-term Forecast for 2 weeks using average daily sales over the last 7–14 days.
During the adjustment, the following are taken into account:
Promotions.
Seasonality.
Price.
Weather.
Other influencing factors.
This mechanism is called “Daily Adjustment”.
20. Control of Promotional Forecast Distribution
The system monitors the distribution of the promotional forecast across stores for future weeks.
If the deviation exceeds ±30%, MySales performs forecast alignment.
21. Adjustment Based on the Master Forecast
MySales adjusts the Forecast according to the master forecast entered by the user.
22. Generation of Pricing Recommendations
The system uses the Forecast to calculate pricing recommendations to determine the optimal selling price or margin.
23. Calculation of Economic Impact
MySales calculates the potential economic impact in the past, including:
Increase or decrease in sales.
Reduction in inventory levels.
Special Forecasting Algorithms
In addition to the main stages, MySales uses separate algorithms for special scenarios.
New Items Without an Analog
For new SKUs without an analog, the system uses the sales of an average item within the product group.
The forecast is adjusted taking into account:
Price elasticity.
Specific characteristics of the new item.
Distribution Expansion
If a store has no sales history for a particular SKU, MySales generates the Forecast based on the dynamics of three levels:
SKU / Region.Product Group / Region.Product Group / Store.
Configuring Forecasting Factors
The set of factors that MySales takes into account is determined by the user and can be individually customized.
The standard set of factors is described in the documentation: https://mysales-labs.atlassian.net/wiki/spaces/CS/pages/edit-v2/1205862404?draftShareId=e646f5c7-399f-43f0-9d12-d691a275285d