Business Data Cleaning
Every analysis of sales, customers or operations starts from an extract. It might come from a CRM, an ERP or a spreadsheet someone maintains by hand. Extracts arrive with repeated orders, blank fields, three spellings of the same city and the occasional impossible number. Data cleaning is the process of detecting problem records and correcting, flagging or removing them so the data set fits the decision it will support. It comes before any summary, chart or model, because a total computed on dirty data can be wrong even when the arithmetic is right.
Five common problems in business extracts
Most issues you will meet fall into a handful of types. Naming the type tells you which treatment to consider.
Problem | What it looks like | Usual treatment |
|---|---|---|
Duplicate record | The same invoice exported twice from two systems | Keep one copy, matched on a key such as the invoice number |
Missing value | A blank postcode on a customer record | Recover it from the source; otherwise leave it blank and flag it |
Inconsistent format | NY, New York and new york in one column, or dates in two layouts | Map every entry to one standard list or format |
Invalid value | A quantity of -5 where the extract permits only positive sales quantities | Correct it from the source, or quarantine the row |
Outlier | One order 40 times larger than any other | Verify it before acting; keep it if it is genuine |
The last two rows are easy to confuse. An invalid value fails an applicable validation rule; it may reflect an error, a genuine rule-breaking transaction or a record outside the extract's permitted scope. An outlier is unusual and needs verification, but may satisfy every rule. A genuine bulk order may be the most important row in the file, so verify an outlier before you change or drop it.
For dates, a common standard is ISO 8601. It sorts correctly as text and removes the doubt over whether 03/04 means March or April.
Validation rules make cleaning repeatable
A validation rule is a stated condition used to check whether a record meets the requirements for its intended use. Typical rules are that quantity is a whole number of at least 1, region is one of North, South, East or West, and order date is no later than the extract date. Written rules turn subjective scanning into a check you can rerun on next month's extract. Confirm the rules and permitted exceptions with the process owner, who understands the business context.
A workable sequence is:
- Save an untouched copy of the raw extract.
- Profile each column: row count, blanks, distinct values, minimum and maximum.
- Write or confirm the validation rules, using what profiling revealed.
- Correct, flag or quarantine each record that fails a rule.
- Rerun the rules, report unresolved exceptions and reconcile the row counts.
- Record every change in a cleaning log.
The reconciliation in step 5 is an identity that must hold exactly:
Here, the clean count includes retained, flagged records approved for specified uses. Each raw row belongs to exactly one of the three groups. If the counts do not balance, a step dropped or created rows you did not intend.
Fix, flag or remove
Each failing record gets one of three treatments.
- Fix it when a trustworthy source, such as the invoice or the order system, confirms the correct value.
- Flag it when the true value is unknown but the rest of the row is still useful. For example, retain a sale with a blank region and label the region Unknown. It can contribute to overall revenue, but cannot be assigned to a named region; report its revenue separately as Unknown.
- Remove or quarantine it when it cannot be used as recorded. Drop extra copies of a duplicate. Set rule-breaking rows aside in a separate table for follow-up rather than deleting them.
When validation is rerun, Unknown still fails the four-region rule. Report retained exceptions separately from passing records and quarantined rows, with their counts, affected totals and permitted uses. A flag documents an unresolved issue; it does not make the value pass.
Whatever you choose, never overwrite the raw extract. The cleaned table is a new file, and the log lets anyone trace every change back to the original.
What to remember
- Classify each problem: duplicate, missing, inconsistent format, invalid or outlier.
- Write validation rules with the process owner and rerun them on every extract.
- Fix from a source, document flagged exceptions and their permitted uses, quarantine the unusable, and verify outliers first.
- Keep the raw file, log every change and reconcile row counts.
Example: Cleaning a week of order data
A regional distributor exports one week of orders to report revenue by region. The company's validation rules are:
- Each order ID appears once.
- Validated geographical regions are North, South, East and West. For total-revenue analysis, a missing region may be retained as Unknown with a flag. Unknown is not a validated geographical region and must be reported separately in regional summaries.
- Dates use YYYY-MM-DD.
- Qty is a whole number of at least 1.
- Catalogue unit prices run from 15 to 250 USD.
Returns are recorded in a separate system, not in this extract.
Row | Order ID | Customer | Region | Order date | Qty | Unit price (USD) |
|---|---|---|---|---|---|---|
1 | 1001 | Acme Ltd | West | 2026-03-02 | 10 | 25.00 |
2 | 1002 | Birch Co | west | 2026-03-02 | 4 | 40.00 |
3 | 1003 | Cobalt Inc | East | 03/04/2026 | 6 | 15.00 |
4 | 1002 | Birch Co | west | 2026-03-02 | 4 | 40.00 |
5 | 1004 | Dune LLC | (blank) | 2026-03-05 | 8 | 20.00 |
6 | 1005 | Elm Partners | East | 2026-03-06 | -3 | 30.00 |
7 | 1006 | Fir Group | W. | 2026-03-06 | 5 | 2500.00 |
8 | 1007 | Acme Ltd | West | 2026-03-07 | 12 | 25.00 |
You also know three facts from the sources:
- The invoice for order 1006 shows a unit price of 25.00 USD.
- Row 3 came from the US branch, which exports dates as MM/DD/YYYY.
- Nothing in the available sources gives Dune LLC's region.
a) Identify each problem in the extract and the type of issue it is.
Check the rules column by column.
- Duplicate record: row 4 repeats every field of row ________, including order ID 1002, so it breaks the unique-ID rule.
- Inconsistent format, region: rows 2 and 4 say west and row 7 says W. These ________ rows mean West but do not match the standard list.
- Inconsistent format, date: row 3 uses 03/04/2026 instead of YYYY-MM-DD.
- Missing value: row 5 has no region.
- Invalid value: row 6 has a quantity of -3, which breaks the rule that Qty is at least 1. It looks like a return entered in the wrong system.
- Out-of-range price: row 7's unit price of 2500.00 USD is ten times the catalogue maximum of 250 USD. It is a suspected typing error, so check it against the source before changing it.
Rows 1 and 8 pass every rule.
b) Choose a treatment for each problem row and state how many rows remain in the analysis table.
Apply fix, flag or remove to each problem row.
- Row 4: remove it as an extra copy of order 1002.
- Rows 2 and 7: map the region to West. Row 3: the US layout means 4 March, so rewrite it as 2026-03-04.
- Row 7: the invoice confirms 25.00 USD, so correct the price and log the change.
- Row 5: no source gives the region, so keep the sale, set Region to Unknown and flag it as the permitted exception for total-revenue analysis. Report its revenue separately from validated geographical regions.
- Row 6: quarantine it, meaning you move it to a separate table for the returns team instead of deleting it.
Removing the duplicate leaves ________. Quarantining row 6 leaves 6 rows in the analysis table.
Reconcile the counts:
This is 6 retained rows, 1 removed and 1 quarantined, which matches the 8 raw rows. The retained rows include 5 with validated regions and 1 flagged Unknown. The cleaned table is suitable for total-revenue analysis, with the regional exception still visible.
c) Compare total revenue (Qty × unit price) computed on the raw extract with total revenue on the cleaned table.
On the raw extract, row 6 contributes -90 USD and row 7 contributes ________. Summing all eight rows:
The cleaned table drops rows 4 and 6. Row 7 becomes 5×25.00, which is ________. Row 5's 160 USD remains in total revenue under the flagged Unknown category.
The raw total overstates revenue by 13,530−1,085=12,445 USD. The raw total itself is 13,530/1,085≈12.47 times the cleaned total. Almost all of the gap comes from one mistyped price, which is why out-of-range values are checked against the source.
d) A manager filters the raw extract on Region equal to West exactly. By how much does that filter understate clean West revenue?
An exact-match filter keeps only rows 1 and 8, so it returns 250+300, which is ________. Rows 2, 4 and 7 are missed because of their non-standard labels.
In the cleaned table, West contains rows 1, 2, 7 and 8:
The raw filter understates West revenue by 835−550=285 USD, which is about 34% of the true figure. Inconsistent labels do not throw an error; they quietly split a group, so standardise categories before you group or filter.
An analyst is preparing a monthly sales extract for a revenue dashboard. They follow a workflow in which a first look at the data shapes the rules that are then checked. Put the steps in the order the analyst should carry them out.
Loading ordering steps…
A retailer combines order rows from three channels. The cleaned table must store dates as YYYY-MM-DD, with two-digit months and days. Region must be one of North, South, East or West. Each raw entry below is listed with the convention of the system that produced it. Enter the cleaned value for each.
| Raw value | Source convention | Cleaned value |
| 03/14/2026 | US branch, MM/DD/YYYY | |
| 07.11.2026 | EU branch, DD.MM.YYYY | |
| 2026/1/9 | Web store, YYYY/M/D | |
| 05/06/2026 | EU branch, DD/MM/YYYY | |
| Sth | Free-text region entry | |
| Nth | Free-text region entry |