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:

  1. Save an untouched copy of the raw extract.
  2. Profile each column: row count, blanks, distinct values, minimum and maximum.
  3. Write or confirm the validation rules, using what profiling revealed.
  4. Correct, flag or quarantine each record that fails a rule.
  5. Rerun the rules, report unresolved exceptions and reconcile the row counts.
  6. Record every change in a cleaning log.


Flowchart showing a raw extract profiled, checked against validation rules, and routed to correction, flagging, removal or quarantine before usable records reach the clean table.


The reconciliation in step 5 is an identity that must hold exactly:


Nraw=Nclean+Nremoved+NquarantinedN_{\text{raw}} = N_{\text{clean}} + N_{\text{removed}} + N_{\text{quarantined}}


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:


Nraw=6+1+1=8N_{\text{raw}} = 6 + 1 + 1 = 8


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:


250+160+90+160+160−90+12,500+300=13,530 USD250 + 160 + 90 + 160 + 160 - 90 + 12{,}500 + 300 = 13{,}530\ \text{USD}


The cleaned table drops rows 4 and 6. Row 7 becomes 5×25.005 \times 25.00, which is ________. Row 5's 160 USD remains in total revenue under the flagged Unknown category.


250+160+90+160+125+300=1,085 USD250 + 160 + 90 + 160 + 125 + 300 = 1{,}085\ \text{USD}


The raw total overstates revenue by 13,530−1,085=12,44513{,}530 - 1{,}085 = 12{,}445 USD. The raw total itself is 13,530/1,085≈12.4713{,}530 / 1{,}085 \approx 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+300250 + 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:


250+160+125+300=835 USD250 + 160 + 125 + 300 = 835\ \text{USD}


The raw filter understates West revenue by 835−550=285835 - 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.

Match each data quality term to the example from a company's purchasing and customer records that best illustrates it.

Match each term
A.

One supplier invoice appears twice because two staff members exported the same batch

B.

Some rows store phone numbers with dashes and others with spaces

C.

The email field on a customer record is empty

D.

A confirmed, legitimate order is 30 times larger than the next-largest order

E.

A product's shipping weight is recorded as -2 kg

F.

A stated condition, such as discount at most 50%, that every record must satisfy

Inconsistent format

Duplicate record

Invalid value

Validation rule

Outlier

Missing value

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

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…

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

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 valueSource conventionCleaned value
03/14/2026US branch, MM/DD/YYYY
07.11.2026EU branch, DD.MM.YYYY
2026/1/9Web store, YYYY/M/D
05/06/2026EU branch, DD/MM/YYYY
SthFree-text region entry
NthFree-text region entry

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors