Start learning
Explore Bezadome

Learn from the best to be the best.

Find your category

Agribusiness & Cooperative Management

Hospitality, Tourism & Events

Business & Entrepreneurship

Leadership & Career Development

Design, Media & Content Creation

Modern Workplace Skills

Procurement & Logistics

Fashion, Tailoring, Footwear & Accessories

Music, Dance & Sound

Computer & Digital Skills

Sales & Marketing

AI and Digital Productivity

Data and Business Analysis

Fitness, Movement & Wellbeing

Digital Marketing & Social Media

Human Resources & Workplace Safety

Project and Community Impact

Hair, Barbering, Beauty & Salon Services

Public Speaking, Communication & PR

Construction, Property & Facilities Operations

English for Life, Study, Work and Business

Household Services & Care

Customer Care & Service Operations

Energy & Mineral Industries

Finance, Bookkeeping & Money Management

Education, Tutoring & Training Design

Environment, Forestry & Sustainability

IT Support & Software Quality

Languages

Manufacturing & Quality Operations

Office Administration

Retail Operations

Healthcare Administration

Define what one clean row must represent

15 min estimated lesson time

View full course

Preview progress is not saved.

What this lesson teaches

Cleaning data means making recorded information fit for a defined purpose while preserving evidence of what changed.

Where you can use it Use this check when combining exports or reviewing sales records. In the practice extract, rows A01 and A02 both identify order 501, line 1. Their business values match, so check whether the same line was imported twice.

Key terms in this lesson
Record
One entry about an item, person or event. Decide what each row represents before counting or combining data.
Cleaning data
Making recorded information fit for a defined purpose while preserving evidence of what changed.
Duplicate
A second entry that may refer to an existing record. Check what the record represents before removing either entry.

Understand the method

Cleaning data means making recorded information fit for a defined purpose while preserving evidence of what changed. It is not making a sheet look tidy. Before using a command, define one row: in this course it is one order line, identified by order_id and line_no together. A repeated order number can be legitimate because an order can contain several products. Deleting every repeated order number would erase real sales.

Write a data contract listing each field, its meaning, expected type, allowed values and requiredness. The contract also states the reporting question: completed November line value by product, with quantities and saved unit prices. This is not a cash-flow or audited revenue report. Source extracts include cancelled lines, missing quantities, invalid dates and an unresolved product key; those facts need explicit decisions.

Separate a format defect from a fact defect. Extra spaces around completed can be standardized after confirming the vocabulary. A missing quantity cannot be recovered by changing the font or applying a number format. It needs source evidence or an unresolved status. A useful cleaning plan distinguishes rules that can be applied safely from questions requiring an authorized owner.

Plan the output before editing: an untouched Raw sheet, a Rules sheet, a Working sheet, an Exceptions sheet and a checked Output. Retain source_row_id throughout so every derived record can be traced. This structure supports review, reversal and a future refresh without pretending that software has verified facts outside the supplied records.

See the method in practice

Rows A01 and A02 both identify order 501, line 1 and contain the same business values. They are candidates for an exact repeated import. Two different line numbers in order 501 would not be duplicates. Row A04 lacks quantity: its line amount is unknown. Record the quantity as missing before calculating a value. The project therefore needs both a line key and a rule for incomplete required fields.

Expert demonstration

Compare the tidy and untidy tables. Say what one row represents in each, then check which two fields identify one order line in the lesson file. Use the table examples without running the R commands.

Assigned clip 1:40–4:24

What tidy data means, and why it matters — Posit PBC / Garrett Grohlman (opens in a new tab)

Follow three rows through the cleaning rules
  1. Same order, different linesOrder 620, line 1 and order 620, line 2 are separate transactions within one order. Keep both and use both fields to identify a line.
  2. Same key and same valuesA second copy of order 620, line 1 is a candidate for repeated import. Confirm the evidence and retain the source row references.
  3. Same key, different quantityIf one copy records 4 and another 6, log the conflict for review. Leave its amount unresolved until you can verify which quantity applies.

Before editing the practice file, write a rule for each of these cases and keep the raw sheet available to check your decisions.

Apply it to your project

Create the data contract for raw-orders.csv. Define the composite line key, required fields and the meaning of completed November line value. Explain which defects can be standardized and which require review.

Compare your reasoning after trying

The contract preserves source_row_id and uses order_id and line_no together as the business key. It requires a valid date, product, quantity, price and status, and keeps unknown facts in an exception workflow rather than guessing them.

YOUR NEXT STEP

Explore the complete course.

Review the curriculum, requirements and enrolment options before you decide.

PASS ON A POSSIBILITY

Share this course

Help a friend or colleague discover their next skill.

Share on WhatsAppChoose who to share with in WhatsApp. You decide what to send.
Recommend to your team by email