software lab

How a forecast is calculated

last updated: 2026-09-26

From sales rate to order quantity, step by step, with a worked example and what each "Why" reason means.

Every night the app recalculates each product in four steps: how fast it sells, how much you need to cover the wait for new stock, when to order, and how much to order. Everything below is visible on the product's page, under How it sells and Why.

1. Sales rate

The sales rate is units sold per day — but per day in stock, not per calendar day. If a product sold 30 units in a month but was out of stock for half of it, its rate is 2 per day, not 1. Dividing by days it could not sell would make a popular product look slow, and you would under-order exactly what sells best.

How it is measured:

  • Three windows, blended. The rate over the last 7 days counts 50%, the last 28 days 30%, and the last 90 days 20%. Recent sales weigh more without one quiet week wiping out the history. A window with no days in stock is left out and its weight shared among the others.
  • Net of returns. Refunded units are subtracted from the day of the original sale.
  • Spikes are capped. A day that sold more than 3 times a normal selling day is counted as 3 times. One promotion or viral day does not set the pace for the rest of the year.
  • Sales days are your shop's days. Each order counts on the calendar day it was processed, in the time zone set in Shopify.
  • New products (under 28 days) are measured over the days they have existed. If one has not sold yet, it borrows the rate of the other variants of the same product.

On the product page, Sales rate is the blended rate; Last 28 days and Last 90 days show the two longer windows, and Days in stock how many of those days it could actually sell. The badge next to the rate — Accelerating, Slowing or Steady — compares the last 28 days with the last 90. It is for information only: the recent weeks are already weighted in the rate.

2. Seasonality

With at least 12 months of history, the app learns how much each month sells compared to an average month, per product type (not per product: one product's history is usually too thin). The forecast is then adjusted for the months your order has to cover. An order placed in October that must last through December plans for December.

Without 12 months of history the forecast assumes every month is the same, and says so with No seasonality yet. On the product page, Seasonality shows the factor applied (1.40× means 40% above an average month) or Flat.

3. Reorder point and safety stock

The reorder point is the stock level at which you have to order, because what is left will only just last until the new stock arrives:

reorder point = sales rate × lead time (adjusted for season) + safety stock

Safety stock is the cushion for days that sell more than usual. It grows with how irregular the product's sales are and with the lead time, and with the product's class: it aims to avoid running out 98% of the time for class A products, 95% for B and 85% for C. A product that sells exactly the same every day needs almost none.

The lead time comes from the supplier. See Suppliers and lead times.

4. How much to order

The order has to last until it arrives and until your next order arrives after it:

target stock = sales rate × (lead time + order cycle) × season + safety stock

order = target stock − available − already on order

Then two supplier rules are applied, in this order:

  1. Minimum units — if the supplier won't sell fewer than a minimum, the quantity goes up to it.
  2. Case pack — the quantity is rounded up to a full case.

Units already on open purchase orders (sent, in transit or partly arrived) are subtracted, so you are never asked to buy the same stock twice. Drafts are not subtracted: a draft is not an order until you send it.

5. Order-by date

The order-by date is the day your stock is expected to reach the reorder point at the current rate. If you are already there, the date is today and it shows in red.

Days of cover is simpler: available stock divided by the sales rate. It does not count units on order.

A worked example

A product sells 2 per day. The supplier takes 14 days to deliver, you order from them every 30 days, they ship in cases of 12. Safety stock works out at 10 units. You have 60 in stock and nothing on order.

  • Reorder point: 2 × 14 + 10 = 38
  • Target stock: 2 × (14 + 30) + 10 = 98
  • To order: 98 − 60 = 38 → rounded up to full cases = 48
  • Order by: you have 60 − 38 = 22 units of margin, 11 days at 2 per day → in 11 days
  • Days of cover: 60 ÷ 2 = 30 days

The "Why" reasons

Each product shows the reasons behind its numbers. On the supplier's page they are behind the N reasons badge; on the product page they are listed with an explanation.

Reason What it means
Stockout adjusted It was out of stock some days; the rate only counts days in stock.
Estimated stockouts Some of those out-of-stock days were deduced from long gaps in sales, because Shopify keeps no stock history from before you installed. We only count a gap when it is clearly a stockout.
Spike smoothed A very high day was capped.
Accelerating / Slowing Selling faster or slower in the last 28 days than in the last 90.
Seasonality applied Adjusted for the months the order will cover.
No seasonality yet Less than 12 months of history; seasons are not considered.
Limited history The app can only read 60 days of orders, so seasons are not visible.
Estimated lead time The supplier is on the 14-day default. Confirm the real one.
High returns 15% or more of the units sold came back. The forecast uses what was kept.
Backorder It sells while out of stock, so negative stock is not treated as a stockout.
New product Less than 28 days old.
Estimated from similar No sales yet; the rate comes from its other variants.
No history No sales and nothing to compare with. No quantity is suggested.
Dead stock In stock but no sales in 90 days. No quantity is suggested.

When a product shows a dash instead of a quantity, it is one of the last two: we would rather show nothing than a number with nothing behind it.