Data quality rule
A data quality rule is an automated test that checks data against a stated expectation, for example that a maturity date falls after the trade date or that a mandatory field is filled. Each rule belongs to a quality dimension and has a threshold, an owner and an escalation route.
What it is
A data quality rule is a precise, testable statement of what valid data looks like, written so that a system can check every record against it and report the failures. The rule turns a general wish for good data into a pass or fail result.
A rule has these parts:
- A condition, for example “the maturity date is later than the trade date” or “the country code appears in the reference list”.
- A scope: the dataset, the fields and the records it applies to.
- A quality dimension, such as completeness, validity, accuracy, consistency, uniqueness or timeliness.
- A threshold: the share of failing records, or the number of failures, that the data owner accepts before the result counts as a breach.
- An owner who answers for the data and an escalation path that says who is told, and how fast, when the threshold is breached.
The result is usually expressed as a pass rate:
pass rate = records passing the rule / records tested
Rules run inside the loading process, in the data store, or on a schedule, and their results are logged for review and trend analysis.
Why it matters
Reports, risk figures and regulatory returns are built on data that passes through many systems. An error that nobody tests for travels to every report downstream.
Supervisory and international standards on risk data call for accurate and reliable data, for completeness across the group, for reconciliation to sources and for validation rules with exceptions identified and explained. Data quality rules are the working form of these expectations.
A rule also assigns a person to a failure. Without an owner and an escalation route, a failed test is noted and left.
Worked example
Illustrative numbers. A rule on a trade table states that the maturity date must be later than the trade date.
- Records tested in the daily load: 50,000.
- Records failing: 150.
- Pass rate: (50,000 minus 150) / 50,000 = 49,850 / 50,000 = 99.7 percent.
- Threshold set by the data owner: 99.9 percent.
The result is below the threshold, so the rule is in breach. The failure is escalated to the data steward, who finds that 120 of the 150 records come from one feed with swapped date fields. Fixing the feed removes those 120. The remaining 30 failures give 49,970 / 50,000 = 99.94 percent, which is above the threshold.
How to read it
A single pass rate says little. The trend over time, the size of the breach and the importance of the field matter more. A high pass rate on a field that nobody uses is of less concern than a small failure rate on a field that feeds a regulatory return.
Who uses it
- Data governance analysts define the rules with data owners, set thresholds and maintain the rule catalogue.
- Data analysts write the rules as queries or checks and investigate the failing records.
- Master data specialists run rules on customer and reference records and correct the failures at source.
- Regulatory reporting analysts check that the data feeding a return passes its rules before submission.
Common confusions
- A rule is not a dimension. The dimension is the aspect of quality, such as validity; the rule is the specific test that measures it.
- Passing all rules does not prove the data is right. Rules test only what they state, and a plausible but wrong value passes.
- A data quality rule and a reconciliation differ. A rule tests data against an expectation; a reconciliation compares two sources with each other.
- The threshold belongs to the data owner. A rule without an agreed threshold and owner only produces counts.