Client projectPrivate
A customer portfolio analysis that rebuilds and checks itself every month
For a European parcel operator, 32 monthly sales exports turned into a workbook, a management summary, a deck and an offline view, with every figure checked before it ships.
- Industry
- European parcel operator
- What it shows
- Data analytics, Automated reporting, Verification
- Year
- 2026
- Status
- Private
In numbers
- monthly sales exports, rebuilt from scratch on every run
- 32
- summary cells checked against an independent calculation
- ~1,800
- figures quoted in the texts, recalculated from source rows
- 563
- for the monthly update, end to end
- <30 min
Figures come from the project’s own files and records.
What changes
The steps people did by hand, and the route the work takes now.
A new month of sales data arrives
Before
- Merge the exports by hand
- Rebuild the pivot tables
- Re-check every chart
- Rewrite the deck
With AI
- The pipeline rebuilds every output from scratch
- Independent checks must agree before anything ships
Workbook, summary, deck and offline view, ready to present
The problem
Management wanted answers that a monthly sales export can hold but rarely gives up easily. Is growth coming from new customers or existing ones? How much is price and how much is volume? How dependent is the business on a few large accounts, and which services are growing or declining? The data sat in dozens of monthly files with changing layouts, and one change of accounting system in the middle of the period.
What we built
A pipeline that answers eleven management questions and three costed proposals from 32 monthly files. One command runs about 26 steps, each in its own process, and publishes nothing if any step fails. Every run starts from the raw files, so nothing carries over by accident from the previous version.
It produces four things from the same numbers: a workbook for analysts, a two-page summary for management, a 16-slide deck, and an offline interactive view with a search for any customer.
Why the numbers can be trusted
Every figure is checked by something that shares no code with the thing that produced it. The raw files are read three separate ways: by the main reader, by a SQL path that exists only to check it, and by a third re-read of the service mix that stops the run if any month, customer and product sum differs. 23 checks compare about 1,800 summary cells against an independent calculation, and the 563 numbers quoted in the written texts are recalculated from the source rows.
Before the first presentation the pipeline was also tested against itself. A backtest on the earlier 11-sheet version of the workbook compared 806,179 filled cells across two runs: 806,173 matched, and all six differences were explained. Two were a tie in a most-common-value calculation being broken at random, now fixed, and four were sentences now generated from the data. It also caught empty text turning into a missing value in the SQL path, which dropped a line. Two forward tests followed, one removing the latest month and one adding a fake month, and they caught hard-coded dates, file names and lists that would have broken the next monthly update.
The last guard is about words, not numbers. If a new month contradicts a sentence in the deck, the run flags it and refuses to save the deck until the sentence is rewritten.
A monthly routine, not a one-off
Updating it takes under half an hour; the two logged monthly runs took 17 and 22 minutes. Add the new file, run it, read the run report and settle any flagged sentences. A follow-on monthly churn report reuses the same building blocks, with two calculation paths that must report zero mismatches, 14 tests on synthetic data and a verifier that checks the workbook.
The system map shows every part of the run and eight journeys through it, from a new month to a failed check, the backtest and where AI was used. It uses generic names, and the client stays anonymous.
Inside a monthly run
Pick a management question to see its answer, add a month and watch the run rebuild and recheck everything, or see how the pipeline was tested to break.
Interactive system map
One new month, read three ways, checked before it ships
28 parts and 8 journeys, from a new file to the four outputs, the checks, the narrative guard and the backtest. Generic part names; the client stays anonymous.
Play 8 journeys, or click any of its 28 parts.
- monthly files, read fresh on every run
- 32
- checks over about 1,800 summary cells
- 23
- quoted figures recalculated
- 563
How much of the growth is price, and how much is volume?
Is growth coming from new customers or existing ones?
How dependent are we on a few large, low-price accounts?
Which services are growing, and which are declining?
How many customers do we lose each month?
A new month arrives
- 1 Read three waysEvery monthly file is read by the main reader, again by a SQL path in DuckDB that exists only to check it, and a third time for the service mix.
- 2 Paths agreeThe SQL path recomputes the quoted figures, and the third read must match every month, customer and product sum. Any mismatch stops the run.
- 3 RulesProducts in 17 groups, customers matched across a change of file format, private persons masked.
- 4 NumbersOne numbers file, which every output is built from.
- 5 OutputsA 14-sheet workbook, a 2-page summary, a 16-slide deck and an offline view with customer search.
- 6 Checks
- Summary cells against an independent calculation, 23 checks~1,800
- Figures quoted in the texts, recalculated, from source rows563
- Error cells after recalculation0
- Second run byte-identical, SHA-256 recordedYes
- 7 Narrative guardEvery sentence in the texts is still supported by the numbers.Reads the texts once the checks pass.1 sentence flagged REVIEW. The deck will not save.The flagged sentence was rewritten and checked again.
- Workbook · 14 sheetsWritten
- Summary · 2 pagesWritten
- Offline view · customer searchWritten
- Deck · 16 slidesSavedWaitingNot savedSaved
Tested to break before the first presentation
- BacktestTwo runs of the earlier 11-sheet workbook, cell by cell806,179cells compared, 806,173 matchedAll 6 differences explained
- 2 ties in a most-common-value calculation, broken at random. Now fixed.
- 4 sentences, now generated from the data.
- Empty text loaded as NULL in the SQL path, which dropped a line. Now normalised.
- Forward test ARemove the latest month−1monthThe window shrank by itself, every check passed, and the guard flagged one sentence
- Forward test BAdd a fake month+1monthTotals matched to the cent, and the guard flagged the new versus existing customers sentence
- Hard-coded period keys
- Hard-coded file names and row counts
- A hard-coded date range in the SQL
- A document block a rerun did not rewrite
- Lists typed in by hand
What it shows
AI made building this fast: Claude helped write and review the code, including the independent re-reads, and the monthly run happens in a Claude session. No model runs inside the pipeline itself; every figure comes from deterministic scripts and checks. The trust comes from the design around it: independent checks, tests that try to break it, and a rule that the story cannot get ahead of the data. The same approach fits any recurring analysis that ends up in front of a board.
Under the hood
- Claude
- Python
- pandas
- DuckDB
- openpyxl
- LibreOffice
- python-pptx
- docx
01Read three ways
Every monthly file is read by the main reader, again by a separate SQL path in DuckDB that exists only to check it, and a third time to re-sum the service mix. Any mismatch stops the run.
02Rules
Products are grouped into 17 families, the same customer is matched across a change of file format, and the names of private persons are replaced while their sums still count.
03One numbers file
A single set of results feeds every output, so the workbook, summary, deck and offline view cannot disagree.
04Outputs
A 14-sheet workbook whose summaries are live formulas over the raw data, a two-page management summary, a 16-slide deck and an interactive view that works offline.
05Checks
23 checks compare about 1,800 summary cells with an independent calculation, 563 quoted figures are recalculated, no cell may show an error, and a rerun must produce byte-identical files.
06Narrative guard
Sentences the new numbers no longer support are flagged for review, and the deck refuses to save until they are rewritten.