Business Analysis / Learning brief
The streak that was too long
In simple terms / 01
What this means in plain language
Daily List wants a badge for finishing a task every day. Tom finds that the streak query gives Lily a run that is too long, because one day was counted twice. A short story about running totals and streaks.
Complete lesson / 02
Understand the full idea, step by step
A streak is a promise that every day in a run was real.
This brief follows a tester who finds that a streak badge is too generous and an analyst who traces it to one repeated day.
What matters is what a row means: a day, or just an event. A query that counts events will call a busy day two days long, and a streak made that way is not a streak at all.
Evidence & review / 03
Evidence & review
The date on this lesson is when it went up on Payments Signal, not when its material was written — most of these were brought across from an earlier catalogue in a single run, which is why so many of them share a date. What the lesson says about the world is dated by the review above and by the sources below it.
Running totals, month-on-month change and streaks as taught in this academy. The app, the data and the people are invented.
What this brief simplifies: Fiction labelled SYNTHETIC / TRAINING ONLY. Real streak rules also decide about time zones and what counts as a day.
Sources for this brief — 3 sources
- Market practice
Window Functions (PostgreSQL tutorial) ↗ — PostgreSQL Global Development Group · Window Functions (PostgreSQL tutorial): the default frame with ORDER BY runs from the start of the partition to the current row and its peers (search excerpt, page not opened)
PostgreSQL18 publisher documentation opened on6November2026: §3.5 window placement, partition/order/frame. No execution on PostgreSQL is claimed; engine-specific examples remain scoped to18.
- Market practice
Window Functions (PostgreSQL function reference) ↗ — PostgreSQL Global Development Group · Window Functions (PostgreSQL function reference): lag and lead read another row of the same partition (search excerpt, page not opened)
PostgreSQL18 publisher documentation opened on6November2026: §9.22 rank, ROW_NUMBER bigint, LAG/LEAD. No execution on PostgreSQL is claimed; engine-specific examples remain scoped to18.
- Simplified educational illustration
Payments Signal editorial teaching models — Payments Signal
Used wherever diagrams, scenarios, figures, or example values are didactic constructions rather than sourced facts; every such use carries a simplifications disclosure. All people, companies, banks, and list entries in examples are fictional.