What dirty data costs: the risks, the impact and real failures
TL;DR
Difficulty: Beginner
Dirty data rarely breaks anything loudly. It bends the numbers you steer by.
- Duplicate customers make retention look weak and new customers look less expensive than they are.
- Ad platforms optimise for the value you send them, so VAT, returns and test orders in that value steer your budget the wrong way.
- Missing returns inflate stock orders, and data that is missing for some groups more than others biases every model.
- Customers see some errors directly, and the law asks for accurate personal data, untouched financial records and correct prices.
- PHE, Reinhart and Rogoff, the Mars Climate Orbiter, gene names in Excel and the London Whale all failed on a small, quiet data problem nobody checked for.
- Price your own: list each problem, how often it happens and what it costs, then fix the most expensive one at the source.
What to read first
Most data problems never crash anything. The shop keeps selling, the dashboard keeps drawing, and a wrong number that looks right gets believed. This chapter walks through every way dirty data costs a business, with worked examples on one invented shop, five documented failures checked against their original reports, and a simple table to put a figure on it for your own.
Dirty data rarely breaks anything loudly
Most data problems do not crash a website or send an error message. The shop keeps selling, the dashboard keeps drawing its charts, and every number on it looks perfectly reasonable. That is exactly the danger. A wrong number that looks right gets believed, and then it gets acted on.
This chapter answers one question: what actually goes wrong when nobody cleans the data? Not in theory, but in money, in stock, in customers' inboxes and in front of a regulator. I walk through each risk with a worked example, then through five documented failures from public health, economics, space flight, genetics and banking, each one checked against its original report. At the end you get a simple way to put a pound figure on dirty data in your own business.
A few words first, so nobody is left behind. Dirty data is any data that does not describe the world correctly for the purpose you are using it for: a customer stored twice, a test order counted as a sale, a size in millimetres read as centimetres, a value missing for one group of people more than for another. Cleaning means finding those problems and correcting, flagging or excluding the affected rows, while keeping the original so you can always explain what changed. If the idea of a data engineer and a pipeline is new to you, the first chapter of this series, what data engineering is and what a data engineer does, sets the scene.
Throughout this series I use one invented business. Wrenfield Home is an online homeware shop in Leeds (wrenfieldhome.example). Priya owns it, and Callum is its developer and data engineer. The shop has about 1,400 products, 110,000 sessions a month and 1,980 orders a month with an average order value of £72 including VAT. It runs on Ruby on Rails and Solidus with a PostgreSQL database, uses GA4 with the daily BigQuery export, buys ads on Google and Meta for £14,000 a month, ships through a third party logistics warehouse (a 3PL) and has five years of order history. Every number about Wrenfield in this article is invented for the example.
Example: one month at Wrenfield Home, three revenue numbers
On the first Monday of November, Priya asks a simple question: how much did we sell in October? She gets three answers.
| Source | October revenue | What it counts |
|---|---|---|
| Solidus admin | £142,560 | Every completed order, including VAT, before any return |
| GA4 | £121,176 | Purchases the browser reported, about 15% fewer because of consent choices and blockers |
| Accountant's figure | £107,720 | Sales after refunds, net of VAT, without test orders |
None of the three is a typo. Each is correct for its own definition, and each contains a different mix of dirt. The Solidus figure includes four test orders Callum placed while checking a new payment method, and it knows nothing about 30 returns that the 3PL has not reported yet. GA4 is missing purchases from visitors who declined analytics cookies. The accountant's figure is the closest to the truth, but it arrives three weeks later.
Priya cannot decide anything until someone explains the gap. The rest of this article is a tour of what that gap costs when nobody does.
Wrong decisions: duplicates and test orders bend the numbers you steer by
The first and most common cost of dirty data is a wrong decision made in good faith. Two problems do most of the damage in a shop: duplicate customers and test orders.
A duplicate customer is one person stored as two or more customer records. In Wrenfield's database 3.1% of customer accounts are duplicates: the same person with an email address that differs only in capital letters or a trailing space, or one person who once checked out as a guest and later opened an account. The shop's software treats each record as a separate customer, so every report built on "customers" inherits the error.
A test order is an order placed by staff or by a developer to check that something works. About 40 of them a year land in Wrenfield's order table. They look like real orders because, to the database, they are real orders.
The effects are not what most people expect. Duplicates make you look as if you have more customers than you do, and each of those customers looks less loyal than they really are. Test orders add revenue that never existed, and they tend to cluster around exactly the products and weeks someone was testing.
Two simple ratios show it. Revenue per customer over twelve months is total revenue divided by the number of customers, and the repeat rate is the share of customers who ordered at least twice (Foundations: ratios and rates):
where is the revenue per customer over twelve months, is the revenue in those twelve months, is the number of customers who ordered at least once, is the repeat rate, and is the number of customers with two or more orders.
Example: Wrenfield's customer numbers before and after cleaning
Callum takes the last twelve months. The raw data says:
- 16,000 customer records placed at least one order
- 23,760 orders worth £1,710,720 including VAT
- 4,800 customer records placed two or more orders
Now the dirt. Of the 16,000 records, 3.1% are duplicates:
So there are really people. In this example each duplicate belongs to a returning customer whose orders were split across two records, so each record looks like a one time buyer. Merging them turns 496 "one time buyers" into 496 repeat customers.
The 40 test orders were worth £4,800 in total, so the real figures are 23,720 orders and £1,705,920.
Revenue per customer, raw:
That is per customer record. Revenue per customer, cleaned:
That is per real person. Repeat rate, raw:
So on the raw data. Repeat rate, cleaned, with the 496 merged customers added to the repeat buyers:
So once the duplicates are merged.
| Metric | Raw | Cleaned | Change |
|---|---|---|---|
| Customers | 16,000 | 15,504 | 3.1% fewer |
| Orders per customer | 1.485 | 1.530 | 3.0% more |
| Revenue per customer | £106.92 | £110.03 | 2.9% more |
| Repeat rate | 30.0% | 34.2% | 4.2 points more |
Revenue per customer moves by less than 3%. The repeat rate moves by more than four percentage points, and that is the number Priya uses to decide whether to spend more on retention emails or on finding new customers. On the raw data, retention looks weak. On the cleaned data, it looks healthy.
The same duplicates distort acquisition. Wrenfield records about 1,300 new customers a month. Suppose 60 of them are existing customers who checked out as guests with a slightly different email. Customer acquisition cost (CAC) is ad spend divided by new customers:
Here is the number of genuinely new customers. So the raw data makes new customers look about 5% less expensive than they are, and makes existing customers look less valuable than they are. The two errors point in opposite directions, which is why their ratio barely moves (£106.92 / £10.77 is 9.9, £110.03 / £11.29 is 9.7). An honest warning hides in that: a ratio that looks stable can sit on top of two numbers that are both wrong. If you want the full method for these two figures, customer acquisition cost, payback and LTV to CAC and repeat purchase when customers never cancel go deeper.
Test orders do their damage in a different place. The 40 test orders are spread unevenly: 14 of them came in one week, when Callum tested a new payment provider by buying the same £320 armchair again and again. That week the armchair had 9 real orders and 14 test orders, 23 in total, and topped the bestseller list. An automatic reorder rule saw the spike and ordered six more armchairs. They sat in the warehouse until the January sale.
Wrong bidding: ad platforms optimise for the value you send them
Google Ads and Meta can bid automatically. With a target return on ad spend (ROAS) strategy, Google says its system predicts the value of a potential conversion for each search and adjusts the bid to maximise the return1. The important word is value. The platform has no idea what a sale was really worth to you. It only knows the conversion value you send it.
If that value includes VAT, ignores returns, or counts a test order, the platform learns from a fiction and spends your money accordingly. It is not malicious and not broken. It is doing exactly what it was told, very efficiently. Auto bidding on your own data and the purchase event done right cover how to send the right value. Here the point is what the wrong value costs.
Return on ad spend is the value of conversions divided by the ad spend. The value worth optimising for is the sent value with VAT taken out and the expected returns removed (Foundations: percentages):
where is the return on ad spend, is the conversion value, is the ad spend, is the value the shop sends to the ad platform, is the VAT rate as a decimal (0.20 in the UK), is the share of the value that comes back as returns, and is the value that actually stays in the business before costs.
Example: rugs against candles
Wrenfield spends £2,000 a month on campaigns for rugs and £2,000 a month on campaigns for candles. It sends the order total including VAT as the conversion value. Rugs are returned often, because colours look different at home: 25% of rug value comes back. Candles almost never come back: 3%. (Both rates are invented. Across all products Wrenfield's return rate is 9% of orders.)
What the platform sees:
With for UK VAT and the return share of each category, here is what stays in the business:
For candles , so far less of the value comes back:
So the true return on ad spend is for rugs and for candles.
The platform sees rugs as 25% better than candles. In truth candles are slightly better. A bidding system told to maximise value will move budget towards rugs, bid more for the customers most likely to send a rug back, and learn more about them with every week. The error compounds, because the platform's next prediction is trained on the conversions its last bids bought.
Wrong stock and cash: returns that never come back into the count
Stock planning in a shop usually starts from net sales: what was sold minus what came back and can be sold again. When returns are missing from the data, net sales look higher than they are, and the planning system orders stock nobody needs. In a small business that is cash, sitting on a shelf.
Wrenfield's returns data comes from the 3PL's daily CSV file. Two known problems live there. The file arrives up to five days late for returns, and the 3PL writes product codes (SKUs, stock keeping units) in its own format with a prefix. The shop's variant SKU for a woven throw is THR-0412. The 3PL writes it as WH-THR-0412. A simple join between the two finds nothing.
Example: the woven throw
The woven throw sells 120 a month. One in five comes back in resellable condition, so 24 return to stock each month. True net demand is a month.
Callum's first returns import joined on the raw SKU, so no return from the 3PL file ever matched a product. The reorder report therefore saw net demand of 120. Wrenfield buys three months of cover at a time, and the throw costs £18 per unit from the supplier.
| Monthly net demand | Three months of cover | Stock cost | |
|---|---|---|---|
| Reorder on the raw data | 120 | 360 | £6,480 |
| Reorder on the cleaned data | 96 | 288 | £5,184 |
| Difference | 24 | 72 | £1,296 |
One product, one reorder: £1,296 of cash tied up in throws that will sell eventually but not soon. Across the 15 products with a return rate above 15%, the same mistake ties up about £19,440. The forecasting article shows how a forecast becomes a purchase order. Every forecast in it assumes the history is right.
The late file adds a second, quieter error. On the last day of October, the 30 returns that happened in the final five days are not in the data yet. October's net sales look about £2,160 too high (30 returns at £72) until the file arrives, and anyone who closed the month on the 31st reported a number that was later revised.
Biased models and forecasts: missing data is rarely missing at random
Missing data is not only a gap. When the gap is bigger for some groups than for others, the data that remains is no longer a fair picture, and every model trained on it learns that unfair picture. Statisticians call this data that is not missing at random. A later chapter in this series is all about it. Here the point is the cost.
Wrenfield's GA4 property shows about 15% fewer purchases than the shop database, because some visitors decline analytics cookies and some use blockers. The 15% is an average. It is not spread evenly.
Example: which channel GA4 under counts
Callum compares one month of purchases from three channels in the shop database (which stores the campaign parameters of each order) with the purchases GA4 reports for the same channels. The split below is invented for the example.
| Channel | Purchases in the shop | Missing in GA4 | Purchases in GA4 |
|---|---|---|---|
| 300 | 6% | 282 | |
| Paid search | 600 | 12% | 528 |
| Paid social | 400 | 24% | 304 |
| Total | 1,300 | 14.3% | 1,114 |
Paid social's share of these purchases is in the shop and in GA4. Any model trained on the GA4 numbers, from a simple channel report to a media mix model, will conclude that paid social works less well than it does. If Priya cuts paid social on that basis, she cuts the channel the data under counted most.
Forecasts have the same weakness. A demand forecast trained on order history that includes the armchair's test week learns a spike that never happened, and it will expect the next one in the same week next year. When analytics, ads and orders disagree explains how to reconcile the sources so that a model learns from the right one.
Customers harmed: the errors people actually see
Some dirty data never reaches a report. It reaches a customer. These errors cost the least to spot, because customers report them for you, and the most in goodwill, because the customer has already been let down.
Example: the same newsletter twice
Wrenfield's newsletter list has 38,000 addresses. When Callum lower cases every address and strips spaces, 912 of them turn out to be second copies of an address already on the list (2.4%, invented). Those 912 people receive every campaign twice. At eight campaigns a month that is 7,296 duplicate emails a month, and the people most likely to unsubscribe in irritation are exactly the loyal customers who signed up twice over the years.
Example: a price without its VAT
A spreadsheet of new prices for 120 lighting products is imported with the column for the price excluding VAT mapped to the shop's price field. For three days a table lamp shows £45.00 on the product page and £54.00 at checkout, once VAT is added. Customers notice, abandon their baskets and write in. In the UK the selling price shown to a consumer must be the final price including VAT and all other taxes2, so this is not only a lost sale, it is a pricing breach.
Example: the customer who asked to be forgotten
A customer asks Wrenfield to delete her data. Callum deletes her account in Solidus. But the newsletter tool is filled once a week from a warehouse table, and that table is rebuilt from a snapshot of the customer list taken before the deletion. The following Tuesday she receives a promotional email. Under UK GDPR, once a person objects to direct marketing, their data must no longer be processed for that purpose3, and sending her that email is exactly the kind of failure that turns into a complaint to the Information Commission (formerly the Information Commissioner's Office, ICO).
Legal exposure: accuracy, records and prices
Dirty data is not only an internal problem. The law has opinions about it, and they pull in two directions at once: personal data must be accurate, and financial records must not be changed. Cleaning has to satisfy both.
What follows is general information about UK law, not legal advice. For your own situation, ask a solicitor or your accountant.
Accuracy of personal data. UK GDPR Article 5(1)(d) says personal data must be "accurate and, where necessary, kept up to date", and that "every reasonable step must be taken" to erase or rectify inaccurate data without delay4. Article 16 gives every person the right to have inaccurate data about them rectified5. The Information Commission's guidance puts it plainly: take all reasonable steps to ensure the personal data you hold is not incorrect or misleading as to any matter of fact6. A duplicate account with an old address, used to send a parcel, is an accuracy problem in this sense.
Financial records. A company must keep adequate accounting records (Companies Act 2006, section 386), and a private company must preserve them for three years from the date they were made7. HMRC asks for six years from the end of the last company financial year they relate to8. Cleaning for analysis must therefore never overwrite the shop's order, payment and refund records. You clean a copy, in the warehouse, and you keep the link back to the original row.
Prices on display. Under the Price Marking Order 2004, a trader who offers a product to consumers must indicate its selling price, which means the final price including VAT and all other taxes2. A dirty price import is a legal problem the moment it is on the page.
Example: Callum's cleaning plan meets the law
Callum plans to merge Wrenfield's 496 duplicate customers. Three rules come straight from the law above:
- He keeps the original Solidus records untouched and builds the merged customer in the warehouse, with a mapping table from every original customer id to the merged id. The financial records stay exactly as they were, and he can always show which orders belong to which original record.
- When two records disagree on the delivery address, the merged customer takes the most recently used one and keeps the others as history, because sending a parcel to an outdated address is an accuracy failure under Article 5(1)(d).
- If either of the two records has opted out of marketing, the merged customer is opted out. The merge must never turn an objection back into consent.
Lost trust: when nobody believes any report
The last risk is the most expensive and the hardest to measure. Once people have caught a report being wrong twice, they stop believing all reports, including the correct ones. Decisions drift back to gut feeling, and the money spent on data becomes money spent on arguments.
Example: the Monday meeting
Back to Priya's three October numbers: £142,560, £121,176 and £107,720. In the Monday meeting the person who runs her ads quotes GA4, her accountant quotes the ledger, and Priya has the Solidus admin open on her laptop. Each person defends their number. Nobody can explain the difference, so the meeting ends without a decision on the November ad budget.
Callum spends the afternoon rebuilding the bridge by hand. The waterfall below is what he arrives at, and it is the single most useful chart in this article: a step by step path from the number on the dashboard to the number that is true.
The steps, worked through:
| Step | Calculation | Running total |
|---|---|---|
| Dashboard revenue | 1,980 orders at £72 | £142,560 |
| Test orders | 4 orders, £480 | £142,080 |
| Refunds booked | 148 returns at £72 = £10,656 | £131,424 |
| Returns not yet reported by the 3PL | 30 returns at £72 = £2,160 | £129,264 |
| VAT at 20% | £129,264 / 6 = £21,544 | £107,720 |
The VAT step divides by six because a price that includes 20% VAT is 120% of the net price, and the VAT part is of it. Notice that only two of the four steps are dirty data in the strict sense (the test orders and the late returns). The other two are differences of definition. Half of all "wrong numbers" in a business are really two people using the same word for different things, which is why the later chapters on metric definitions matter as much as the ones on cleaning.
Callum's afternoon of reconciliation happens every month. At six hours, valued at £60 an hour, that is £360 a month, before counting the meeting that did not decide anything.
Five documented failures, and what each one teaches a shop
Every risk above comes from an invented shop. The failures below are real, documented in official reports or peer reviewed papers, and none of them involved anyone being careless in an obvious way. Each was a small, quiet data problem that nobody checked for. After each one, the same failure at Wrenfield.
Public Health England, October 2020: a file format that silently dropped rows
On 4 October 2020, Public Health England (PHE) announced that 15,841 positive COVID 19 cases between 25 September and 2 October had not been included in the reported daily figures. The cause, in PHE's words, was that some files containing positive test results exceeded the maximum file size of the process that loads them into central systems9. The BBC reported the detail: the process used the old XLS spreadsheet format, which holds only about 65,000 rows, and because each test result produced several rows, each template could hold about 1,400 cases. Further cases were simply left off10. The current Excel format holds 1,048,576 rows per worksheet11.
The lesson is not "do not use Excel". It is that the data was lost silently. Nothing failed, nothing warned, and the totals simply came out low. PHE also stated that every person who tested positive still received their result, so the loss was in the reporting and in contact tracing, which is exactly where analytics sits in a business.
Example at Wrenfield Home. Wrenfield's newsletter tool lets Callum export the subscriber list as a CSV file. Suppose, as an invented case, that the export stops at 25,000 rows without saying so. The list has 38,000 addresses, so 13,000 never reach the warehouse, and every analysis of newsletter subscribers is about two thirds of the list. The fix costs one line of logic: compare the row count of every load with the count the source reports, and stop the pipeline if they differ.
Reinhart and Rogoff, 2010 to 2013: a spreadsheet range and the choices around it
In 2010 the economists Carmen Reinhart and Kenneth Rogoff published "Growth in a time of debt", which found that countries with public debt above 90% of GDP had sharply lower growth12. It was widely quoted in arguments for austerity. In 2013 Thomas Herndon, Michael Ash and Robert Pollin replicated the analysis with the authors' own working spreadsheet and found three problems: a coding error in the spreadsheet that left five countries (Australia, Austria, Belgium, Canada and Denmark) out of the calculation, the exclusion of some available years of data, and an unusual way of weighting the averages13. Corrected, average growth for countries above the 90% threshold was 2.2%, not minus 0.1%.
The famous part is the spreadsheet error. The detail most retellings miss is that it was the smallest of the three: Herndon and colleagues attribute about 0.3 points of the difference to it, and almost 2 points to the weighting alone13. Dirty data is often less about one broken cell than about many undocumented choices.
Example at Wrenfield Home. Priya keeps a spreadsheet of marketing costs by hand: an influencer fee here, a photographer there, £3,200 in a typical month. In March she adds a new row for a £850 trade show stand, below the range the total formula covers. The total stays at £3,200. Wrenfield's full marketing cost for March is understated by £850, so its blended CAC is understated too:
That is against a true , about 5% too low. And Priya has been computing the yearly conversion rate as the average of twelve monthly conversion rates, which gives a quiet February the same weight as a busy November. Both are exactly the two kinds of error Herndon and colleagues found.
NASA Mars Climate Orbiter, 1999: two units, one number
NASA's Mars Climate Orbiter was lost on 23 September 1999 as it tried to enter orbit around Mars. The Mishap Investigation Board found one root cause: ground software produced thruster data in English units (pound seconds) where the interface specification required metric units (newton seconds)14. The small forces the navigation team used were therefore low by a factor of 4.45, the small errors added up over the nine month journey, and the spacecraft arrived about 170 kilometres lower than planned.
The detail that matters for a business is that the units were written down. A software interface specification defined both the format and the units of the file, and it was not followed14. An agreement nobody checks is not a control.
Example at Wrenfield Home. One of Wrenfield's suppliers sends product dimensions in millimetres, the others in centimetres. A new rug arrives in the feed as 2000 by 3000. Read as centimetres, it is a rug twenty metres by thirty. The product page shows absurd dimensions, the shipping rules put it in the oversize class, and the checkout quotes an £89 delivery charge. The rug normally sells about ten a month. Until someone notices, it sells none.
Gene names turned into dates, 2016 and 2020
In 2016 Mark Ziemann, Yotam Eren and Assam El Osta scanned the supplementary Excel files of 3,597 papers in 18 leading genomics journals. In 704 of them, gene names had been converted into something else, mostly dates: Excel with default settings turns the gene symbol SEPT2 into "2 Sep" and MARCH1 into "1 Mar". That is 19.6% of the papers with gene lists, roughly one in five15. In 2020 the HUGO Gene Nomenclature Committee, which names human genes, changed every gene symbol that auto converted to a date in Excel, so SEPT1 became SEPTIN1 and MARCH1 became MARCHF116. A scientific naming system changed because a spreadsheet kept guessing.
The lesson: any tool that guesses the type of a value will sometimes guess wrong, and it will do so without telling you.
Example at Wrenfield Home. Barcodes (EAN codes) are 13 digit codes, and some of Wrenfield's start with a zero. When a member of staff opens a supplier's CSV in a spreadsheet, checks a few prices and saves it again, the barcodes are read as numbers: the leading zero disappears and long codes may be shown in scientific notation. The next import matches these products to nothing. The same thing happens to SKUs that look like numbers. The fix is to read every file with explicit column types, never with a guess, which a later chapter on data types covers line by line.
JPMorgan Chase, the "London Whale", 2012: a sum where an average was meant
In 2012 JPMorgan Chase's Chief Investment Office lost about 5.8 billion US dollars in the first half of the year on a portfolio of credit derivatives. The bank's own Management Task Force report of January 2013 places the main responsibility on the trading strategy and the people who ran it17. But it also describes how the new risk model, which measured value at risk (VaR), "operated through a series of Excel spreadsheets, which had to be completed manually, by a process of copying and pasting data from one spreadsheet to another"17. And it describes an error: after subtracting the old rate from the new rate, the spreadsheet divided by their sum instead of their average, as the modeller had intended. The report says this likely muted volatility by a factor of two and lowered the VaR17.
The data problem did not cause the trading loss. It made the risk look smaller while it grew, which is what dirty data does best.
Example at Wrenfield Home. Callum's pricing spreadsheet measures how much each price changed as the difference divided by the average of the old and new price. A lamp goes from £40 to £44:
That is , the change Callum meant to measure. Now suppose someone copies the formula into a new sheet and divides by the sum instead of the average:
That is . Every price change in the new sheet looks half as large as it is, and a 9.5% increase reads as 4.8%. If Priya's rule is "check any increase above 8% against competitors", no increase will ever trigger the check.
What dirty data costs: the big numbers, and what they are worth
You will see two large figures quoted in almost every article about data quality. Both are estimates, and both are worth reading for what they are.
The first comes from Gartner. IBM, quoting a Gartner report, writes that poor data quality costs organisations an average of USD 12.9 million each year18. The number describes large organisations, and the method behind it is not published in the material quoted, so it says little about a shop with £1.7 million of revenue.
The second comes from Thomas Redman, who titled a 2016 Harvard Business Review article "Bad data costs the U.S. 3 trillion dollars per year" (the headline uses the dollar sign), a figure he attributed to IBM19. It is an estimate for a whole economy. I could not trace the method behind it, so I treat it as an illustration of scale, not a measurement.
More useful for a small business is a rule of thumb from quality management, the 1 10 100 rule, usually attributed to George Labovitz and Yu Sang Chang in the early 1990s20. It says that preventing a bad record at the point of entry costs about 1 unit, correcting it later costs about 10, and doing nothing about it costs about 100, in the failures it causes further down the line. The numbers are illustrative, not measured. The shape is what matters: each step a dirty row travels makes it more expensive.
Example: one millimetre row at entry, in the pipeline and in a decision
Take the rug from the Mars Climate Orbiter example and price each point at which Wrenfield could catch it. All figures are invented for the example.
- At entry. A validation rule on the supplier feed checks that a rug is between 30 and 500 centimetres long. The row fails, the feed import rejects it and emails the supplier, and the supplier resends it. Cost: two minutes of someone's attention, about £2.
- In the pipeline. The row is loaded, and a data test in the warehouse flags a product more than ten metres long. Callum traces the row to the supplier file, fixes the mapping and reloads. Cost: 45 minutes at £60 an hour, £45.
- In a decision. Nothing catches it. The rug shows an £89 delivery charge, and its usual ten sales a month at £72 do not happen. Cost: £720 of revenue in the first month, plus whatever Priya concludes about a product that "suddenly stopped selling".
The ratio here is 1 to about 22 to 360, steeper than the rule of thumb. That is typical of problems that reach customers, because lost sales keep adding up for as long as nobody notices.
Estimate what dirty data costs your own business
You do not need Gartner to tell you what dirty data costs you. You need a list of your problems, how often each one happens, and what one occurrence costs. Multiply and add. This is an expected value, the average cost you should plan for (Foundations: expected value):
where is the expected yearly cost of dirty data, is the number of problems on your list, is how many times problem happens in a year, and is what one occurrence of problem costs, in time, lost sales, wasted stock or wasted ad spend.
Four rules keep the estimate honest:
- Count only what you can trace to a cause. "Better decisions in general" is not a line.
- Price staff time at what it really costs the business, not at zero because people are salaried anyway.
- Keep legal risk on a separate line, unpriced. A fine is not an expected value you can average away, and pretending otherwise invites the wrong trade off.
- Write down your assumptions next to each line, so the estimate can be challenged and improved.
Example: Wrenfield's yearly cost of dirty data
Callum fills in the table with the problems from this article.
| Problem | Times a year | Cost each | Yearly cost |
|---|---|---|---|
| Month end reconciliation by hand | 12 | £360 (6 hours at £60) | £4,320 |
| Ad budget pulled towards rugs by the wrong value | 12 | £217 | £2,604 |
| Stock tied up by unmatched returns (15 products) | 15 | £324 | £4,860 |
| Supplier unit errors that reach the shop | 4 | £720 | £2,880 |
| Prices shown without VAT by mistake | 1 | £1,500 | £1,500 |
| Test orders triggering a reorder | 1 | £576 | £576 |
| Total | £16,740 |
The working behind three of the lines:
- Rugs. If the £2,000 a month on rugs had gone to candles, it would have kept , about £217 more a month in true value (using the unrounded returns, 3.2333 and 3.125, the difference is £216.67).
- Stock. £1,296 of extra stock per product, held for a year at a holding cost of 25% of its value (storage, the cost of the money and the risk of a markdown), is per product.
- Armchairs. Six armchairs ordered because of the test week, cost price £320 each, sold in the January sale at 30% off: .
Not priced, on a separate line: the erased customer who received an email, the 912 people who got every newsletter twice, the meeting that did not decide the ad budget, and the retention strategy built on a repeat rate four points too low.
£16,740 is about 1% of Wrenfield's yearly revenue (). That is not a catastrophe, and it is worth saying so plainly: most small shops are not losing millions to dirty data. They are losing a steady 1% or 2% of revenue in small leaks, plus the occasional decision that goes the wrong way because the number behind it was wrong. The comparison that matters is with the cost of fixing the causes, which for most of the lines above is a few days of work, once.
A first look at your own data
You can start the list with two queries on the shop database. Both run on PostgreSQL against the standard Solidus tables, where spree_users holds customer accounts and spree_orders holds orders with their email, total and completed_at columns.
The first finds email addresses that belong to more than one account once capital letters and surrounding spaces are ignored:
-- PostgreSQL: accounts whose email collides once case and spaces are ignored
SELECT lower(btrim(email)) AS email_key,
count(*) AS accounts
FROM spree_users
GROUP BY lower(btrim(email))
HAVING count(*) > 1
ORDER BY accounts DESC;
btrim removes spaces from both ends and lower turns the address into lower case, so " Priya@Example.com" and "priya@example.com" fall into the same group. Each group with more than one account is a candidate duplicate. It is only a candidate: a later chapter on entity resolution covers guest checkouts, typos and the cases where two accounts with one address really are two people.
The second counts likely test and staff orders in the last twelve months:
-- PostgreSQL: completed orders placed with the shop's own domain in the last 12 months
SELECT count(*) AS orders,
sum(total) AS order_value
FROM spree_orders
WHERE completed_at >= now() - interval '12 months'
AND lower(btrim(email)) LIKE '%@wrenfieldhome.example';
On Wrenfield's data the result might look like this:
| orders | order_value |
|---|---|
| 31 | 3,940.00 |
That is 31 of the 40 test orders. The other nine were placed with personal email addresses, which is why a rule based on the email domain alone is a start, not a solution. Do not be tempted to add OR email LIKE '%test%' either: it would catch a real customer called Celeste Tester. Rules like these need a written definition, an owner and a review, which is exactly what the cleaning chapters of this series build.
What to do first
If this article has made you uneasy about your own numbers, that is the right reaction, and the first steps cost little.
- Write down your three revenue numbers. The shop, the analytics tool and the accountant. Build the waterfall between them, by hand, once. Every step you cannot explain is a problem on your list.
- Run the two queries above. Count duplicate accounts and orders from your own domain. Now you have two lines of the cost table with real frequencies.
- Check what you send to the ad platforms. Is it net of VAT? Does it ever get corrected for returns? Are test orders excluded? If you do not know, that is the answer.
- Pick the most expensive line and fix it at the source. A validation rule at entry beats a cleaning step in the pipeline, and a cleaning step in the pipeline beats a correction in a meeting.
The next chapters of this series take these problems one at a time: where raw data comes from and why it is never clean, the data types and formats that break pipelines, how to measure data quality and how to profile a table before you touch it, and then a whole block on cleaning itself, from deciding what to clean to reporting honestly on data you have changed.
Conclusion
Dirty data rarely announces itself. It shows up as a repeat rate four points too low, an ad platform that prefers the products customers send back, a reorder that ties up cash, a newsletter that arrives twice, and a meeting where three people hold three revenue numbers and nobody can bridge them. The documented failures, from PHE's lost test results to the Mars Climate Orbiter, share one pattern: a small, quiet data problem that no step checked for, and a lot of trust placed in a number that looked fine. For a shop the size of Wrenfield Home the cost is real but measurable, about 1% of revenue in this example, plus legal risk and lost trust that do not fit in a sum. The way out is not heroics. It is a list of problems, a cost for each, and checks placed as close to the source as possible, so the dirty row is stopped while it still costs two pounds.
