The 88 percent
Nearly nine in ten sales went missing without anyone noticing. Why data quality is a task of its own.
The numbers looked good. Revenue per month, neatly split by channel, plausible curves, no error in the log. The only thing that didn’t fit was a feeling: one entire financial year looked remarkably quiet.
It wasn’t quiet. Almost everything was missing.
The filter that knew too much
Before Pythia calculates anything, it sorts receipts: sale, return, credit note, cancellation. To do that it reads a marker on each receipt. In an early version, that marker was hard-wired into the code – with exactly the value that receipts from the current year carried.
What nobody had considered: the ERP increments the first character of that marker at every year-end. To the filter, receipts from other years looked like something else, and they quietly dropped out. In the end, nearly nine in ten sales were missing from the reports.
Why nobody noticed
Pythia had a check that counts after every import whether everything arrived. It reported: all fine. The reason was as simple as it was uncomfortable – the check used the same filter as the import. It compared the error with itself and found no difference.
A check that uses the same logic as the thing it is meant to check checks nothing.
Two more silent errors
Once we looked closely, we found more:
- Quotation marks in item names. The ERP’s export files don’t follow the usual CSV rules: quotation marks in item names are not escaped. From one such point onwards, a lenient parser read a large part of an entire year’s file as a single, enormous field – and reported success.
- Two missing columns. One year’s file lacked two of its 76 columns. The import skipped the whole file as a result, and nobody noticed.
None of these errors was spectacular. They were dangerous because they were quiet. Each one would have distorted a forecast, a year-on-year comparison or a purchasing decision without a single warning light coming on.
What we did about it
- The check now counts independently of the import, separately for each receipt type, and reports its result to whoever started the import – not just to a log nobody reads.
- Every row of an export file must have the expected number of fields. A row that doesn’t is a finding, not a reason to guess.
- Columns that not every year’s file has are marked optional and no longer block the import.
Afterwards, the reports contained more than ten times as many sales as before. And the quiet financial year turned out to be a perfectly normal one.
It left us with a principle that has applied to everything Pythia reads ever since: data quality is not a by-product but a task of its own. Pythia doesn’t correct data on its own authority; it makes errors visible – ranked by how much they distort the result, not by how many there are.
Next month: once the data is right, we want to see all of it – every year, back to 2015.