Skip to content

Demand Forecasting

StockrHub’s demand forecasting engine analyzes your sales history to predict when products will run out of stock and when you should reorder. This helps you avoid stockouts while minimizing excess inventory.

The forecasting engine follows a straightforward process:

  1. Pulls sales history from Shopify for a configurable lookback period.
  2. Calculates sales velocity — the average number of units sold per day.
  3. Estimates days of stock remaining based on current inventory and velocity.
  4. Predicts a stockout date — the date when stock will reach zero at the current sell rate.
  5. Calculates a reorder date — the stockout date minus the supplier’s lead time.
  6. Generates reorder suggestions for items that need to be ordered soon.

Sales velocity is the core metric behind all forecasting calculations. It represents how many units of a product sell per day, averaged over the lookback period.

Formula: Sales Velocity = Total Units Sold / Number of Days in Period

ProductUnits Sold (30 days)Sales Velocity
Widget Blue SM1204.0 units/day
Widget Red MD451.5 units/day
Widget Green LG90.3 units/day

You can adjust the number of days of sales history used for velocity calculations. Common settings:

  • 30 days — Best for fast-moving, stable products.
  • 60 days — Balances recent trends with a wider sample.
  • 90 days — Smooths out short-term fluctuations; good for slower-moving items.

This metric tells you how long your current inventory will last at the current sales rate.

Formula: Days of Stock = Current Inventory / Sales Velocity

ProductOn HandVelocityDays of Stock
Widget Blue SM804.0/day20 days
Widget Red MD451.5/day30 days
Widget Green LG900.3/day300 days

The stockout date is when inventory is expected to reach zero.

Formula: Stockout Date = Today + Days of Stock Remaining

If a product has a velocity of zero (no recent sales), no stockout date is predicted.

The reorder date accounts for supplier lead time. It tells you the latest date you should place a purchase order to avoid a gap in availability.

Formula: Reorder Date = Stockout Date - Supplier Lead Time (days)

ProductStockout DateLead TimeReorder By
Widget Blue SMMar 2014 daysMar 6
Widget Red MDMar 307 daysMar 23

Based on the calculations above, StockrHub generates a list of products that need to be reordered. Each suggestion includes:

  • Product and variant — What to reorder.
  • Current stock — How many units are on hand.
  • Sales velocity — Current sell rate.
  • Days remaining — How long stock will last.
  • Reorder date — When the order should be placed.
  • Suggested quantity — Based on your reorder rules (e.g., reorder enough to cover X days of sales).
  • Preferred supplier — The supplier to order from.

You can review these suggestions and convert them into purchase orders with a single click.

The demand forecasting dashboard gives you an at-a-glance view of your inventory health:

  • At-Risk Items — Products that need to be reordered within the next 7 days.
  • Stockout Imminent — Products predicted to run out within 3 days or less.
  • Healthy Stock — Products with more than 30 days of stock remaining.
  • Overstocked — Products with significantly more stock than needed based on velocity.