A Practical Data Quality Checklist Before Analysis
What should you check before analyzing a dataset?
Before analysis, confirm the dataset's grain, then check for duplicate business keys, missing critical values, invalid ranges and formats, invalid dates, broken references between tables, cross-field contradictions, and totals that don't reconcile with a trusted source. Measure each issue as a count and a rate with a stated denominator, and prioritize by the impact on the decision the data supports.
1. Confirm the grain
Grain is what one row represents: one order, one order line, one customer per day. Most reporting errors — double-counted revenue, inflated customer counts — come from assuming the wrong grain. Write it down before running any other check.
-- If grain is one row per order, this should return no rows
SELECT order_id, COUNT(*) AS row_count
FROM orders
GROUP BY order_id
HAVING COUNT(*) > 1;2. Run the core checks
- Uniqueness: duplicate business keys (order_id, customer_id).
- Completeness: nulls or blanks in fields the report depends on.
- Validity: values outside expected ranges, such as negative quantities or impossible ages.
- Format: dates, currency, and codes stored inconsistently.
- Referential integrity: child rows whose foreign key has no matching parent.
- Consistency: contradictions across fields, such as ship_date earlier than order_date.
- Timeliness: the latest record date matches when the data should have been refreshed.
- Reconciliation: row counts and totals match a trusted source system or report.
-- Completeness rate for a critical field, with the denominator stated
SELECT COUNT(*) AS total_rows,
SUM(CASE WHEN order_date IS NULL THEN 1 ELSE 0 END) AS missing_order_date,
ROUND(100 * SUM(CASE WHEN order_date IS NULL THEN 1 ELSE 0 END) / COUNT(*), 2) AS missing_pct
FROM orders;
-- Orphaned order lines
SELECT COUNT(*) AS orphan_lines
FROM order_lines l
LEFT JOIN orders o ON o.order_id = l.order_id
WHERE o.order_id IS NULL;3. Report and prioritize
Put the results in one table: rule, definition and impact, validation logic, count and rate, severity, root-cause hypothesis, and recommended action. Rank by business impact and reporting risk, not by raw count — 3 duplicated high-value invoices can matter more than 3,000 missing optional phone numbers.
Separate safe fixes (trimming whitespace, standardizing date formats) from decisions that need business approval (excluding records, redefining a metric).
Common mistakes
- Reporting a percentage without saying what the denominator is.
- Treating automated checks as proof of accuracy. A check can flag an implausible value, but it can't prove a plausible value is true.
- Presenting root causes as facts instead of hypotheses.
Related skills
Data Analyst Toolkit includes AI-agent skills that follow this method: