The Thursday Tips · Edition No. 1 · 2 min read

Find your Pop-Tart

The Technique

It's Monday review, and someone senior asks the question that sounds easy and never is: "Anything unusual last week?" You scroll the dashboards. Everything looks... normal? Probably? The truth is you're checking the ten things you always check, and unusual—by definition—lives somewhere else.

The tip

Don't look for anomalies; rank for them. One query that compares every product against its own trailing baseline surfaces the outliers you'd never think to check—the way Walmart's analysts surfaced a breakfast pastry nobody would have nominated

The how

Aggregate to weeks, compute each item's trailing baseline with a window function, and keep only the rows that beat it decisively:

-- rank every product against its own trailing baseline
SELECT product, wk, units,
       ROUND(units * 1.0 / baseline, 2) AS uplift
FROM scored
WHERE baseline >= 20
  AND units >= 1.8 * baseline
ORDER BY uplift DESC;

Three choices do the real work: the window excludes the current week so an item never dilutes its own baseline; the volume floor keeps low sellers from producing absurd ratios; the threshold is a dial, not a truth—start near 1.8× and tighten until the list fits one screen.

The Catch

This scan finds departures from baseline, not demand signals—and most departures are self-inflicted. A promotion, a stockout last month, or a double-loaded file will all top this list, looking exactly like a Pop-Tart. Before you announce a discovery, join the boring tables first: the promo calendar, the stock movement log, and the load history. The query finds the candidates; the elimination is the analysis.

This is Tuesday's story at your desk: Walmart's team didn't have better intuition—they had a query that didn't need any. File this for the next Monday if someone asks what's unusual—and this time, have a list.

ShareLinkedInXWhatsApp

Have a tip that earns its keep?

Send it in — submitted tips get credited in one of the next editions.

Submit a tip
Also in Edition No. 1StorySeven Times Normal
Read

Subscribe to the PetaFold Journal