Data Quality Checks for Analysis Workflows
A practical guide to defining, running, investigating, and documenting data-quality checks for analysis workflows.
Define expectations and run the checks
Define expectations before checking
A data-quality check is useful only if its result can be interpreted consistently. First record the scope: the table, reporting period, source, and filters being checked. Then specify which fields are required, what identifies a record, the date boundaries and time zone, and which counts or amounts should reconcile with the source. State any approved tolerance as well.
These choices depend on intended use. A repeated value might be valid in one dataset and a defect in another. Likewise, a repeated identifier is only meaningful when checked against the key for the correct . A single field may not identify a record; the agreed key might instead be a combination such as a source identifier and transaction identifier.
Check completeness and uniqueness
For every required field, count missing values—for example, count rows where an order identifier is null. Decide in advance whether an empty string also counts as missing; a null-only check will not answer that question unless the expectation includes it. If an identifier is required for every record, the expectation may be that it has no nulls.
For uniqueness, group records by the agreed business key and identify keys occurring more than once. The source’s example checks repeated order identifiers. A repeat is a signal to inspect, not proof of an error: compare the complete rows and their source identifiers before deciding what happened. Conversely, repeated values in a non-key field do not by themselves establish that records are duplicated.
Validate the reporting window
Define the start, end, time zone, and whether an end boundary is inclusive. A includes the start and excludes the end, which makes timestamp windows consistent. For example, the source represents January 2026 from the start of January 1 up to, but not including, the start of February 1. Check for rows before the start or at or after the end, and also check for missing dates. Confirm that timestamps use the expected time zone; otherwise a record may appear to fall on the wrong side of a boundary.
Reconcile source and analysis
Compare source and analysis row counts and relevant amounts only after aligning the source, batch, filters, date window, and aggregation grain. The source example compares source and analysis totals by batch. This makes a difference interpretable: unlike scopes can produce different totals even when neither side is defective.
Check both counts and amounts. A matching grand total alone can conceal offsetting omissions and overcounts. Apply only the tolerance approved for the check, and write the expectations clearly enough that another person can tell what passed and what a failure means.
Investigate, resolve, and record failures
Investigate before changing data
Treat a failed check as a signal to investigate, not as permission to delete or edit records automatically. Inspect the failing rows and determine whether the cause is an ingestion problem, a transformation defect, an incorrect expectation, or a legitimate exception.
Follow the failure to its likely source. For repeated keys, compare complete records and source identifiers. For missing values, confirm that the field is actually required and that the rule handles blanks as intended. For date or total mismatches, trace the affected batch and verify the filters, time zone, date window, and aggregation logic. Confirm proposed corrections with the data or source-system owner. When a defect is confirmed, prefer fixing the source or transformation rather than editing analytical results in place.
Record the outcome and rerun checks
Keep a run record containing the dataset and version, run time, scope, expectation, observed result, pass/fail status, failure count, investigation notes, and resolution or approved exception. Set thresholds deliberately: a required identifier may allow no nulls, while monitored volume or a reconciled amount may allow a documented tolerance.
After a fix, rerun the checks to confirm the result. Make failures visible before the data is used for decisions. Reusable tests such as not_null and unique can help make expectations repeatable in a data pipeline. Documenting both the check and its resolution helps distinguish a corrected defect from a revised expectation or an accepted exception.
: A testable rule describing what a dataset is expected to contain or how it should compare with a source.
: A check result that does not meet its stated expectation.
: A deliberately chosen limit for deciding when a check passes or requires attention.