Business Analysis / Learning brief

The streak that was too long

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.

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

REVIEWED 2026-10-18

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
  1. 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)

    §3.5 window placement, partition/order/frame. PostgreSQL18 implementation, not a universal SQL mandate. · Checked 2026-11-06

    PostgreSQL18 publisher documentation opened on6November2026: §3.5 window placement, partition/order/frame. No execution on PostgreSQL is claimed; engine-specific examples remain scoped to18.

  2. 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)

    §9.22 rank, ROW_NUMBER bigint, LAG/LEAD. PostgreSQL18 implementation, not a universal SQL mandate. · Checked 2026-11-06

    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.

  3. Simplified educational illustration

    Payments Signal editorial teaching models — Payments Signal

    This site's own simplified teaching models. · Checked 2026-07-12

    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.

Learn this properly

START HERESQL for BAs: running totals, month-on-month change and streaksWrite a running total or a moving average, compare one month with the last using LAG, find days in a row, and say why the frame of a window should be spelled out.Opens at L0 Explain simply · about 16 min

Related briefs

The title that was too long

Lily types a very long task title and the app does something odd. Sam draws a small activity diagram with one diamond and two guards, and the team agrees what should happen.

READ BRIEF

The desk that was too small

Sam pastes six long interview transcripts into the chat tool and gets themes from only two. A short story about tokens, the context window and splitting a long job.

READ BRIEF