Guides

Safety Stock Calculation in MySales: Steps and Key Takeaways

A step-by-step explanation of how MySales automatically calculates safety stock based on forecast error statistics, including a worked numerical example.

🔑 Key Takeaways
  • Safety stock in MySales is derived from statistical forecast error, not arbitrary rules of thumb or fixed percentages of sales volume.
  • Historical weeks are segmented into low, medium, and high demand groups, because forecast accuracy varies by demand level -- and high-demand periods typically drive the largest safety stock requirements.
  • A configurable coefficient and a hard maximum cap (% max SS) give businesses direct control over the trade-off between on-shelf availability and inventory cost.
  • The entire calculation is automatic, repeatable, and auditable -- eliminating the subjectivity of manual safety stock planning.

How MySales Calculates Safety Stock

In MySales, safety stock is calculated automatically based on forecast error statistics. There are no manual buffers, no rule-of-thumb percentages, and no guesswork.

The system follows a deterministic, six-step process at the SKU x store level (or any higher aggregation level). Each step builds on the previous one, producing a safety stock value that is both statistically grounded and operationally bounded.


1. Historical Data Foundation

The calculation begins with weekly data for three variables:

  • Sales forecast -- the system's predicted demand
  • Actual sales -- what was actually sold
  • Inventory levels -- available stock at each point in time

The analysis is performed at the SKU x store level by default, though it can operate at higher aggregation levels when configured to do so.


2. Splitting Weeks Into Three Demand Groups

All historical weeks are sorted by forecast volume and divided into three segments:

Segment Share of Weeks Description
Low demand Bottom 30% Weeks with the lowest forecasted volume
Medium demand Middle 40% Weeks with moderate forecasted volume
High demand Top 30% Weeks with the highest forecasted volume
💡 Why segment by demand level?

Forecast error is not uniform across demand levels. High-demand periods typically exhibit larger absolute errors than low-demand periods. By calculating error separately for each segment, MySales produces a safety stock that reflects the actual risk profile of each demand regime -- rather than averaging errors across fundamentally different conditions.


3. Forecast Error Estimation

For each of the three demand groups, the system calculates the standard deviation of the difference between actual sales and forecast.

Error = Actual Sales - Forecast

The standard deviation of these errors yields a single metric: the typical weekly forecast error for that SKU, expressed in units. This is the statistical backbone of the entire safety stock calculation.


4. Safety Stock Coefficient

The calculated forecast error is multiplied by a user-defined coefficient, configured in:

Forecasts > Administration > Safety Stock Adjustment

This coefficient gives the business direct leverage over inventory policy:

Coefficient Strategy Use Case
0.7 Aggressive lean SKUs with low margin or high spoilage risk
1.0 Standard protection Default -- covers typical forecast error
1.3 Conservative buffer High-value SKUs or categories with severe out-of-stock penalties

The relationship is linear: doubling the coefficient doubles the safety stock.

💡 Coefficient strategy

The coefficient should reflect business priority, not statistical uncertainty. A retailer with strong supplier relationships and short lead times can afford a lower coefficient. A retailer serving remote stores with infrequent deliveries should err higher. The statistical model handles the math; the coefficient encodes the strategy.


5. Scaling to the Order Horizon (D1-D2)

Safety stock is initially calculated on a weekly basis. It must then be scaled to match the actual order horizon -- the number of days between the order date (D1) and the delivery date (D2).

The scaling formula is straightforward:

SS (scaled) = SS (weekly) x (N / 7)

Where N is the number of days in the D1-D2 window.

Order Horizon Scaling Factor Effect
3 days 3 / 7 = 0.43 Safety stock reduced to ~43% of the weekly value
7 days 7 / 7 = 1.00 Safety stock equals the full weekly value
14 days 14 / 7 = 2.00 Safety stock doubled to cover a two-week window

Shorter order horizons naturally require less safety stock. This is by design -- more frequent ordering reduces exposure to forecast error.


6. Upper Limit (% Max SS)

The final step applies a hard ceiling on safety stock:

SS cannot exceed Forecast(D1-D2) x % max SS

A typical value is 50%, meaning safety stock can never exceed half of the forecasted demand over the order window.

This guardrail protects against three specific risks:

  • Excessive inventory accumulation in slow-moving SKUs
  • Write-offs and spoilage from over-ordering perishable goods
  • Order inflation that distorts upstream supply chain signals

If the calculated safety stock exceeds this limit, it is forcibly capped.


What the Business Needs to Understand

Safety stock is not designed to cover 100% of demand peaks. Its purpose is narrower and more precise: to compensate for the typical magnitude of forecast error.

The system optimizes for a three-way balance:

  • On-shelf availability (OSA) -- ensuring products are present when customers want them
  • Inventory levels -- minimizing working capital tied up in stock
  • Write-offs -- reducing waste from unsold or expired products
💡 A common misconception

Stakeholders often ask: "Why did we go out of stock if we have safety stock?" The answer is that safety stock covers typical forecast error, not extreme demand spikes. Covering 100% of all possible demand scenarios would require inventory levels that are economically unsustainable. The system targets the statistically optimal trade-off -- and the coefficient gives you the lever to adjust it.


Worked Example: Safety Stock for a Specific SKU

📈 Numerical walkthrough

The following example traces the complete calculation for a single SKU, exactly as MySales executes it -- step by step, without simplification.

Parameters:

  • SKU: 123456
  • Store: Store_01
  • Order horizon: D1-D2 = 7 days
  • % max SS = 50%
  • Safety stock coefficient = 1.0
  • History length: 20 weeks

Step 1. Collect historical data

Week Forecast Actual
1 90 85
2 95 110
3 100 98
4 105 130
5 110 108
... ... ...
20 140 170

Step 2. Segment weeks by demand level

20 weeks sorted by forecast value:

  • Low (30%) -- 6 weeks with the lowest forecast
  • Medium (40%) -- 8 middle weeks
  • High (30%) -- 6 weeks with the highest forecast

The high-demand segment almost always contributes the most to the final safety stock value.


Step 3. Calculate forecast error for the high-demand group

Error = Actual - Forecast

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

Standard deviation of errors: approximately 22 units.


Step 4. Apply the safety stock coefficient

SS (weekly) = 22 x 1.0 = 22 units


Step 5. Scale to the order horizon

With a 7-day order window:

SS (scaled) = 22 x (7 / 7) = 22 units


Step 6. Apply the % max SS cap

  • Forecast over D1-D2 window: 60 units
  • Maximum allowed SS: 60 x 50% = 30 units
  • Calculated SS: 22 units

Since 22 < 30, the safety stock is not capped.

Final safety stock = 22 units


Step 7. How this feeds into the replenishment order

The 22-unit safety stock enters the base demand calculation alongside:

  • Inventory on D1 = 30 units
  • Minimum presentation stock = 5 units

The system uses these inputs to determine the final replenishment order quantity. The 22-unit safety stock is the result of statistical calculation -- not manual tuning, not a percentage override, and not a planner's intuition.


Business Impact

Automated, statistically-driven safety stock calculation delivers measurable results across three dimensions. Inventory costs decrease because safety stock is right-sized to actual forecast error rather than inflated by conservative manual buffers. On-shelf availability improves because the system allocates higher safety stock where forecast uncertainty is greatest -- typically in high-demand periods where stockouts are most costly. Operational efficiency increases because planners no longer spend time manually setting and adjusting safety stock parameters across thousands of SKU-store combinations.

The net effect is a shift from reactive inventory management -- where planners chase stockouts and trim overstock after the fact -- to a proactive, data-driven replenishment process that continuously self-calibrates to the actual accuracy of the demand forecast.

Ready to write your success story?

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