Subscribe free
Alloconomy 21 Nov 2026 9 min read

Find the dispatch that never happened

Twenty eligible titles were promised a Friday promotion in each of two stores.

The interview prompt

Twenty eligible titles were promised a Friday promotion in each of two stores. Store A sold fifteen distinct eligible titles. Store B’s sales extract is missing. How many promoted store-title pairs had no sale?

Build the denominator before looking for missing activity

The coverage table has forty eligible pairs if every title is assigned to both stores for that date. Store A has twenty known pairs, fifteen with a sale and five with none. Store B contributes twenty unresolved pairs. Counting twenty-five zeros would treat a data outage as a commercial failure. Report five confirmed misses and twenty unknowns until B is complete.

For complete store-days, an anti-join expresses the business question directly. This exercise assumes one coverage row per scoped store, product, and day, and a qualifying sale is one completed purchase. A return alone does not qualify under that definition.

SELECT c.store_id, c.product_id, c.day
FROM promo_coverage AS c
JOIN complete_store_day AS ok
  ON ok.store_id = c.store_id AND ok.day = c.day
WHERE NOT EXISTS (
  SELECT 1 FROM sale AS s
  WHERE s.store_id = c.store_id AND s.product_id = c.product_id
    AND s.sale_day = c.day AND s.quantity > 0
);

Two purchases of the same title still satisfy one coverage obligation. For a promotion that runs for a week, choose whether every day is independently expected to have sales or one purchase qualifies the entire week. The correct anti-join keys follow from that choice.

The model behind the answer

Maya promised to dispatch a set of school orders by Friday. The shipment feed contains a row whenever a parcel leaves. A query over that feed can find the late dispatches it has seen. An order that never shipped has no row to find.

Record the commitments. A factless coverage table might hold one row per promised order line and due date, with the warehouse and service level. Its existence records an obligation. To find lines with no dispatch by the deadline, start from coverage and keep promises with no matching activity by the cutoff. Check that the dispatch feed is complete through that cutoff before escalating a miss.

Now change “no dispatch” to “incomplete dispatch.” One parcel of four makes the first query drop the school’s line. The second question needs promised quantity and cumulative dispatched quantity. A factless relationship solves the first version of the problem. The changed wording tells you precisely which measure the second version needs. Kimball on factless facts

Try it in SQLite

Which promotions had no sale?

Both stores promised three titles. A sent its complete file. B has sent nothing. Compare a naive absence count with confirmed misses.

Tables and sample data

Each run starts with fresh sample data. Use Ctrl+Enter or ⌘+Enter to run. Only your browser processes the query.

Test an agent’s absence alert against a silent store

Ask the agent to draft the anti-join and an alert from the promotion ticket. As reviewer, remove Store B’s sales extract while retaining its twenty eligible titles. Store A’s complete feed shows sales on fifteen of twenty titles.

Reviewer decision. The report should authorize follow-up on five confirmed misses in A and show twenty unresolved pairs in B. Route a missing-feed alert to the data owner. Opening twenty commercial incidents would turn one ingestion fault into twenty misleading business actions.

Further reading. The Data Warehouse Toolkit, 3rd ed., on comparing coverage with observed activity.

One more question

Can you infer that the five titles with no sale were out of stock?

Check your reasoning

No. Coverage plus activity establishes eligibility and absence of a qualifying sale. To measure out-of-stock exposure, obtain assortment, inventory or availability observations, and the periods during which shoppers could buy. Diagnosis requires more evidence than detection.

Previous · Accumulating snapshots remember milestones · Next · Store the interval between changes · Complete series map