Turn data-quality findings into explicit rules
Learn the reasoning. Try the task. Compare your answer.
Prepared for DataCareerHub · Curriculum version 2026-10-15.4
By the end of this lesson
- Distinguish validity, completeness, uniqueness and consistency.
- Write testable rules tied to the dictionary.
- Prioritise defects by their effect on the intended analysis.
April–May teaching extract · Order values in EUR · Delivery blanks remain missing · Use a local spreadsheet; Python is optional.
Understand the method
Data quality is fitness for the question you are trying to answer. A blank delivery duration prevents a complete delivery comparison, but it does not automatically invalidate an otherwise verified order amount. A missing order amount directly blocks a sales total until it is resolved or the affected value is explicitly excluded. Avoid assigning one decorative quality score to the entire file. Write specific rules and connect each exception to a calculation or decision.
Translate definitions into tests
Uniqueness means order_id appears once at the analytical order grain. Validity means a field satisfies its declared representation or domain: an ISO calendar date must actually exist; channel must be web or store after an authorised formatting rule; status must be completed, returned or cancelled. order_value_eur must be a non-negative number for this exercise. A negative amount could be legitimate in another accounting model, but the supplied order-value contract does not represent refunds as negative orders.
Completeness depends on required fields. An order ID, date, status, channel and value are required for these grouped financial summaries. Delivery duration can be absent and must remain distinguishable from a valid zero. Consistency asks whether information agrees across records or sources, such as the conflicting channel labels attached to Y007. Accuracy requires an authoritative comparison: a plausible value or a passing format test cannot prove that a source amount is correct.
Count different kinds of exceptions separately
The raw file has one exact duplicate group, A004, and one conflicting duplicate group, Y007. Each group contributes one excess row. It also contains a channel spelling/whitespace variation at A005, an impossible April date at A008, a negative amount at A009, an unrecognised channel at Y003, a blank value at Y005 and invalid delivery text at Y006. These are eight investigation entries. They are not eight interchangeable rows to delete.
There are also genuine missing delivery measurements. The raw blank count is affected by a duplicated blank record; profile it again after duplicate resolution. This illustrates why the order of checks matters. Keep separate counts for blank, malformed, outside-domain and conflicting values. A valid high-value order is not a validity exception merely because it is unusual. We investigate that order in the distribution lesson.
Choose a proportionate action
Use a severity statement that names the consequence. Y005 blocks a full sales sum because its amount is unavailable. Y007 blocks a trustworthy channel breakdown until the conflict is resolved. Y006 affects delivery analysis but leaves an independently verified sales amount usable. A formatting change at A005 is deterministic under the declared lowercase-and-trim rule. Mapping “mobile” to a channel would require source evidence because a device label does not establish whether the order belongs to web or store.
State what tests cannot establish
Passing these rules makes the fixture suitable for the defined exercise. It does not demonstrate that every real transaction was exported, that a reporting pipeline is timely or that an amount reflects accounting revenue. Maintain a separate list of questions for the source owner: export coverage, status timing, treatment of returns and the meaning of absent delivery records. These unanswered questions belong beside your findings rather than disappearing after a clean profile.
Practical exercise
Use quality_log_template.csv to write one issue statement for each of the eight listed identifiers. Add a rule, effect on sales/channel/delivery analysis, and the evidence needed to act. Separately record the count of genuine missing delivery observations after preparation. Distinguish a deterministic formatting fix from a value requiring authoritative confirmation.
Deliverable: an eight-entry quality log plus three prioritised questions for a source owner. Do not delete all flagged records or invent an accuracy percentage from the number of passing rules.
Open the worked solution
Eight issue entries are expected: A004 duplicate_exact; Y007 duplicate_conflict; A005 category_format; A008 date_invalid; A009 value_negative; Y003 category_unknown; Y005 value_missing; Y006 delivery_type. The downloadable quality_log_solution.csv gives observed values, actions and their authority. A005 can become web by the documented trim/lowercase rule. Y003 cannot safely become web simply because “mobile” sounds digital: the reference confirms store.
A009’s -110 becomes €110 only because the reference supports that correction. Y005’s amount is €190 in the reference. Y006’s delivery duration is four days. Without that reference, quarantine or mark unresolved values and state how totals are incomplete. Do not take absolute values, fill a mean or replace unknown channels with the largest category.
For the prepared completed population there are seven missing delivery observations, six in April and one in May. Their values remain blank. Questions for the source owner include whether all orders in the period were exported, whether returned status reflects order-date or later events, and whether absent delivery measurements cluster by channel. These questions address coverage and interpretation, beyond format checks.
One more question.
Method references: NIST exploratory data analysis and box plots and IQR fences. The case and exercises are authored for DataCareerHub; the quartile convention is stated in the dictionary.
How these learning materials are prepared and maintained · Report a correction: support@datacareerhub.io
Read and practice without an account. Sign in with an existing account to save lesson completion.
Next lesson →Fictional training data. Portfolio practice is not a claim of client work or an accredited qualification. Explore practical lessons, worked examples and projects. Follow a published path, practise the method and build work you can explain.