promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_

The cleaning log — every dropped row has a receipt — step 1 of 8

Dirty spreadsheet, trustworthy table

You're in the analytics studio. What you're doing this lesson: learn the question finance actually asks — where did those rows go — and the rule that makes AI-assisted cleaning safe: every dropped row needs a receipt. Demo code, if it appears later, is optional.

You got a dirty spreadsheet. Finance will ask where the rows went. Your job this hour: turn that export into a trustworthy table — every dropped row named, every change logged, original file untouched.

There are two questions that can be asked about any analysis. The comfortable one is "what does the data say?" The one that actually gets asked — in the QBR, by the finance partner reconciling your July MRR (monthly recurring revenue — the subscription dollars billed that month) against the billing system's July MRR — is "where did those rows go?" If you can't answer it row by row, it doesn't matter how good the chart is.

A shrunken but honest billing export has every classic defect in seven rows: a retry that wrote the same customer twice, a June row that snuck into a July file, an internal test account someone created in 2023 and nobody dares delete, a blank monthly-revenue cell on a row that definitely billed something (or didn't — that's a decision, not a fact), and a blank plan the source system introduced mid-quarter. Seven rows in, and already the export disagrees with itself about how many customers it contains.

At real scale — 80,000 rows, five source systems — you will not eyeball this. You'll hand it to the AI, and the AI is genuinely good at drafting the cleaning: the documented pattern across practitioner surveys is exactly that split — AI drafts the SQL and the cleaning steps, humans validate on samples and own the interpretation. The part that goes wrong is never the drafting. It's that a drafted cleaning pass runs silently. Rows leave, values change, and no record exists of what left or why. Three weeks later finance says your number is $4,400 light, and the answer is somewhere in a notebook cell that no longer exists.

So this lesson installs the one rule that makes AI-assisted cleaning safe to use at all:

Every transform gets a receipt: rows in, rows out, and a named reason for every row dropped or changed. The original file is never touched.

Not "cleanup." Not "fixed dates." A receipt names what was wrong: dedupe on id — export writes one row per retry, -2. When the reconciliation question comes — and in this job it always comes — you read the log instead of re-running archaeology on your own notebook.

The next step turns that rule into a checklist you can run. The rest of the lesson makes you catch the AI breaking it.