Safety Stock Calculation in MySales: Steps and Key Takeaways
Safety Stock (SS) in MySales is a buffer stock that helps compensate for the difference between forecast and actual demand.
Unlike an approach where additional stock is set as an arbitrary percentage “just in case,” MySales calculates Safety Stock based on the historical Forecast error for a specific SKU × Store or the corresponding higher level.
The main purpose of Safety Stock is to maintain a balance between two risks:
OOS — actual demand was higher than the Forecast, and there was not enough stock;
Overstock / Write-offs — the safety stock is too large and creates a surplus.
How the Calculation Works
The logic can be represented as follows:
Historical Forecasts and actual sales
↓Dividing the history by demand level
↓Assessing the Forecast error
↓Safety Stock coefficient
↓Recalculation for the D1D2 horizon
↓% max SS limit
↓Final Safety Stock
1. Historical Data
For the calculation, MySales uses weekly history, including:
Forecast;
actual sales;
stock balances.
The analysis is performed for a specific SKU × Store combination or at the corresponding higher level.
Thus, Safety Stock depends not simply on sales volume, but on how closely the Forecast matched actual demand in the past.
The larger and less stable the historical Forecast error, the greater the need for safety stock.
2. Dividing the History by Demand Level
The Forecast error may differ during periods of low, medium, and high demand.
Therefore, historical weeks are divided into three groups:
Low — periods of low demand;
Mid — periods of medium demand;
High — periods of high demand.
Example of a system setting:
safetyStockQuartiles: { low: 0.3, high: 0.7, multiplier: 1, limit: 1 }With this setting:
Low — the 30% of weeks with the lowest Forecast;
Mid — the middle 40%;
High — the 30% of weeks with the highest Forecast.
This allows MySales to assess the behaviour of the Forecast error separately at different demand levels.
The group boundaries are system parameters and may depend on the configuration.
Why the High Group Is Important
Periods of high demand are particularly important from the perspective of OOS risk: if the Forecast underestimates demand specifically during these periods, the shortage may have the greatest impact on product availability.
Therefore, the example below examines the High group in more detail.
3. Assessing the Forecast Error
For each group, the system compares:
Forecast
andactual sales.
For an individual week, the error can be represented as follows: Error = Actual Sales − Forecast
Next, MySales assesses the typical error level based on squared deviations.
In simplified terms: σ = √(average value of Error²)
The more actual demand typically deviates from the Forecast, the more Safety Stock may be required.
In other words, safety stock compensates not for the sales level itself, but for Forecast uncertainty.
4. Safety Stock Coefficient
The calculated error level is additionally adjusted by the Safety Stock coefficient.
The setting is available under:
Forecasts → Administration → Safety Stock Adjustment
In simplified terms: Safety Stock = σ × SS coefficient
For example:
1.0— the baseline level;0.7— lower safety stock;1.3— greater protection against OOS.
The coefficient affects Safety Stock linearly:
a lower coefficient → less stock;
a higher coefficient → more stock.
This allows the user to adjust the balance between product availability and stock levels.
5. Recalculation for the D1D2 Horizon
Safety Stock is initially calculated at the weekly level, after which it is adapted to the horizon of a specific order.
In simplified terms: SS D1D2 = SS week × (number of D1D2 days / 7)
For example:
D1D2 =
3 days3 days →SS week × 3/7;D1D2 =
7 days7 days →SS week × 7/7;D1D2 =
14 days14 days →SS week × 14/7.
Thus, Safety Stock is adapted to the period that needs to be protected against Forecast error.
6. % max SS — Maximum Limit
After the calculation, the system checks whether Safety Stock exceeds the permitted limit relative to Forecast D1D2.
Condition: Safety Stock ≤ Forecast D1D2 × % max SS
For example: Forecast D1D2 = 80
% max SS = 50%
Maximum permitted Safety Stock: 80 × 50% = 40
If the statistical calculation produces a value greater than 40, Safety Stock is capped at this level.
This helps protect the order against:
excess stock;
an increased risk of write-offs;
uncontrolled growth in the order quantity.
50%is an example setting, not a universal value for all configurations.
Safety Stock Calculation Example
Let us consider a specific SKU.
Input Data
SKU —
123456;store —
Store_01;history —
20 weeks;D1D2 horizon —
7 days;SS coefficient —
1.0;% max SS —
50%;Forecast D1D2 —
80.
1. Dividing the History
The 20 weeks are sorted by Forecast level.
With a 30% / 40% / 30% distribution:
Low — 6 weeks;
Mid — 8 weeks;
High — 6 weeks.
For this example, let us consider the High group:
Week | Forecast | Actual | Error |
|---|---|---|---|
15 | 130 | 150 | +20 |
16 | 135 | 160 | +25 |
17 | 138 | 155 | +17 |
18 | 140 | 170 | +30 |
19 | 142 | 160 | +18 |
20 | 145 | 165 | +20 |
2. Assessing the Error Level
For this High group: σ = √((20² + 25² + 17² + 30² + 18² + 20²) / 6)
We obtain approximately: σ ≈ 22
Therefore, the typical weekly Forecast error level in this example is approximately 22 units.
3. Applying the Coefficient
Safety Stock coefficient: 1.0
Therefore: SS week = 22 × 1.0 = 22
4. Recalculation for D1D2
Order horizon: 7 days
Calculation: SS D1D2 = 22 × (7 / 7) = 22
Therefore: Safety Stock D1D2 = 22 units.
5. Checking % max SS
Forecast D1D2: 80
Maximum permitted Safety Stock: 80 × 50% = 40
Comparing: 22 ≤ 40
The limit is not triggered.
Final Safety Stock
22 units
How Safety Stock Affects the Order
After the calculation, Safety Stock becomes one of the components of the requirement.
In simplified terms:
Need = Forecast D1D2 + Safety Stock + Presentation Stock − Stock D1
For example:
Forecast D1D2 =
80;Safety Stock =
22;Presentation Stock =
5;Stock D1 =
30.
Then:
Need = 80 + 22 + 5 − 30 = 77
Therefore:
Calculated requirement = 77 units.
It is important that the 22 units of Safety Stock are derived from Forecast error statistics, rather than being manually set as an arbitrary percentage of sales.
What Is Important to Understand
Safety Stock is not intended to cover every possible peak in demand.
Its purpose is to compensate for typical Forecast uncertainty and maintain a balance between:
OSA — product availability;
the risk of OOS;
stock levels;
the risk of Overstock;
future Write-offs.
The final Safety Stock is affected by:
historical Forecast accuracy;
demand level;
the Low / Mid / High group;
the Safety Stock coefficient;
the D1D2 horizon;
% max SS.
Therefore, two SKUs with the same Forecast may receive different Safety Stock if their demand stability and historical Forecast error differ.
Result
MySales does not calculate Safety Stock according to the principle:
“Let us add another X% of stock just in case.”
Instead, the system assesses:
“How much does the Forecast typically deviate from actual demand, and how much additional stock is needed to compensate for this uncertainty?”
As a result, Safety Stock helps maintain an optimal balance between product availability, OOS risk, stock levels, and write-offs, without increasing the order uncontrollably.