From: Hugo Lambert, warehouse lead
Question: Which stockouts hurt us most in March and April?
"We ran out of several products this spring. Tell me how many days each product was at zero, the longest run, and roughly what it cost us in sales, so I know which reorder points to fix first."
Estimate rule: a product's normal daily sales are its units sold January to June 2025 (orders not cancelled) divided by 181 days. Lost units are that rate times the days at zero. Lost revenue is lost units times the current price.
Data: stock_levels (March 1 to April 14), order_items, orders, products.
This case combines gaps and islands with a simple estimate. Days at zero are a count; runs of zero are islands; the estimate multiplies days out by a normal sales rate.
State the estimate's limits next to the number: daily readings have gaps, and sales on in-stock days may already be lower than normal. The point is to rank products, not to book a loss to the cent.