Data quality management is the ongoing work of deciding how good each important dataset needs to be, checking it automatically where data enters and changes, and making sure someone fixes the cause when a check fails. In practice that means a short list of critical tables, a few rules for each across six dimensions (completeness, uniqueness, validity, consistency, timeliness and accuracy), checks that run inside the pipeline, and a named person who gets the alert. Most teams can have a first version running within a month without buying anything.
We build data pipelines for clients: live odds feeds from 44 sportsbooks, monthly supplier files for a procurement catalog, migrations between funeral-home systems, and LLM extraction from oilfield field tickets. We also added quality checks to an AI bookkeeper's invoice extraction. The client examples below come from that work.
What it involves
Take away the vendor diagrams and data quality management is four activities on a loop:
- Define what "good enough" means for each critical dataset: which rules apply and how many failures are acceptable.
- Measure: profile the data you already have, then run checks on every load.
- Monitor: schedule the checks, alert when they fail and keep a history of results.
- Improve: fix the cause, preferably at the source, and add a check that would catch the same problem next time.
Many organizations never get to the second step. According to Gartner, 59% of organizations do not measure data quality at all. The same page puts the cost of poor data quality at $12.9 million a year or more on average, a figure from Gartner research in 2020. You don't need a number like that to justify the work: one wrong invoice run, or one board report with a revenue figure nobody can explain, usually does it.
Who sets the thresholds and who answers for each dataset is a governance question, which our post on data governance strategy covers. This post is about the checks.
The six dimensions, with a check for each
The six dimensions you will see most often come from a 2013 DAMA UK white paper. The UK Government Data Quality Framework adopts the same six and says plainly that the list isn't prescriptive. Treat them as a checklist: for each critical table, do you have at least one check for every dimension that matters to it?
Dimension | The question | A check that answers it |
|---|---|---|
Completeness | Is everything there that should be? | Null rate on required columns; row count compared with the source |
Uniqueness | Is each thing recorded once? | Unique primary keys; a duplicate search on natural keys such as email or tax number |
Validity | Is each value in the allowed format and range? | Accepted values for status fields, ranges for amounts and dates, check digits on ID numbers |
Consistency | Do related values agree, within a record and across systems? | Order total equals the sum of its lines; a customer has the same country in the CRM and in billing |
Timeliness | Is it recent enough for the decision it feeds? | Time since the last successful load, compared with an agreed limit |
Accuracy | Does it match the real world? | Reconciliation with an independent source; a manual sample |
A few things the table hides.
Validity and accuracy are different, and automated checks are far better at the first. An email address can pass every format check and still belong to someone else. "Shipped" is a valid status even for a parcel that is still in the warehouse. Accuracy needs a second source of truth: a bank statement, the ledger, another data provider, or a person looking at the original document. When we built a data migration platform for Tribute Technology, their product owner judged success by matching migrated data against accounts-receivable reports and case counts, plus spot checks. That is what accuracy checking usually looks like in practice: totals, counts and a sample.
Timeliness is the dimension teams forget, and it can make a spotless table useless. For EdgeHunters, a betting-analytics company whose odds pipelines we built and ran from 2023 to early 2026, a price could be complete, valid and matched to the right game and still be worthless once it went stale, because the product's betting recommendations depend on current prices. The pipelines packaged the latest odds and pushed them to the product every five minutes. Set each freshness limit from how the data is used: minutes for a feed like that, a day for most finance tables, a month for a reference list that rarely changes.
Uniqueness problems often come from systems you don't control. The hospital HR and payroll systems that send staff and leave data to Oplist, a shift-scheduling client we build for, can contain duplicate staff records, and some leave types take precedence over others when they overlap. Rather than trust the source, we handle both in Oplist's own system: records are deduplicated, and overlapping leave is resolved with a precedence order.
Where the checks should run
Checks are cheapest where data enters and most valuable just before someone sees it. Put them in three places:
- At the boundary, when data arrives from a source system, a file or a scraper: schema, required fields, row counts and freshness. A bad batch goes to a quarantine table and stays out of the warehouse.
- In the transformation layer, on the models that join and clean the data: keys, relationships, accepted values and rules that span fields.
- Before publishing, as a gate: the tables behind dashboards, exports and customer-facing features refresh only when their checks pass.
Decide in advance whether each check blocks or warns. Block when publishing wrong data is worse than publishing late data: invoices, payouts, anything a customer or a regulator sees. Warn when stale data would do more harm than a few imperfect rows: an internal dashboard shouldn't freeze on yesterday's numbers because a handful of customers have no email address. In dbt, dbt build gives you the gate: when a test on a model fails at error severity, everything downstream of that model is skipped.
Set thresholds from profiling. Look at each column's null rate, distinct values and range over the last few months, and put the limit just outside what is normal. A 95% or 99% completeness target copied from a template means little until you know what the column looks like today. Primary keys are the exception: a duplicate or missing key should always fail.
A starter set of checks in dbt
If your transformations run in dbt, the first checks are a few lines of YAML. Here is a day-one set for an orders table, in a file such as models/staging/_shop.yml: keys, a relationship, allowed statuses, a warning threshold and source freshness.
sources:
- name: shop
schema: raw
config:
freshness:
warn_after: {count: 6, period: hour}
error_after: {count: 24, period: hour}
loaded_at_field: _loaded_at
tables:
- name: orders
- name: order_lines
- name: customers
models:
- name: stg_orders
columns:
- name: order_id
data_tests:
- unique
- not_null
- name: customer_id
data_tests:
- not_null
- relationships:
arguments:
to: ref('stg_customers')
field: customer_id
- name: status
data_tests:
- not_null
- accepted_values:
arguments:
values: ['placed', 'shipped', 'completed', 'returned']
- name: stg_customers
columns:
- name: customer_id
data_tests:
- unique
- not_null
- name: email
data_tests:
- not_null:
config:
warn_if: ">0"
error_if: ">100"status gets not_null as well as accepted_values because accepted_values lets nulls through. relationships does the same, which is why customer_id has both.
A rule that spans tables goes into a singular test: a SQL file in tests/ that selects the rows breaking the rule. It passes when it returns nothing.
-- tests/order_total_matches_lines.sql
-- Returns every order whose total differs from its line items by more than
-- a cent, including orders that have no line items at all
select
o.order_id,
o.total_amount,
coalesce(sum(l.quantity * l.unit_price), 0) as lines_total
from {{ ref('stg_orders') }} as o
left join {{ ref('stg_order_lines') }} as l
on l.order_id = o.order_id
group by o.order_id, o.total_amount
having abs(o.total_amount - coalesce(sum(l.quantity * l.unit_price), 0)) > 0.01Use a left join here. With a plain join, an order that has no lines at all drops out of the query and the test passes.
Some version notes, because dbt changed a lot this year. Test inputs such as values and to sit under arguments:. dbt's documentation says that works from v1.10.5 and is required in dbt v2, the Rust rewrite you now get by default when you install dbt. Freshness settings and loaded_at_field go under config:. On v2, dbt freshness checks sources and models in one command, and dbt source freshness still works.
We ran the example with DuckDB on dbt Core 1.12 and on dbt v2 (the open-source dbt-oss 2.0 build), with seed data containing an unknown status, a missing status, a total that doesn't match its lines, an order with no lines, a missing email and a day-old source. Both versions failed the status and total tests, raised a warning for the email and reported the orders source as stale.
Two things to know before you schedule it. dbt build doesn't check source freshness, so run dbt source freshness (or dbt freshness on v2) as a separate step before the build; it exits with an error when a source is past error_after, which stops the job there. And if _loaded_at is a timestamp without a time zone, dbt treats it as UTC (v2 prints a warning saying so). A loader that writes local time instead will make every source look fresher or staler than it really is, by the size of your UTC offset.
What rules miss
Rules catch the failures you thought of. The rest show up as numbers that are technically valid but odd: half the usual row count, a column that is suddenly 40% empty, a price distribution that moved overnight, a new column nobody announced.
EdgeHunters is a good example. Each of the 44 sportsbooks had its own scraper, and sportsbooks change their sites without warning, so a scraper could break in ways nobody had written a rule for. We added validation and anomaly checks that posted alerts to Slack, and when a scraper failed, a third-party odds API took over automatically. If you depend on sources you don't control, decide before the first outage what the product does when one breaks: show nothing, show stale data with a warning, or switch to a backup. For EdgeHunters it was the backup API.
The simplest anomaly check is a volume check: compare yesterday's row count with the average for the same weekday over the previous four weeks, and alert below half or above double. Anomaly checks need a few weeks of history before they know what normal looks like. If you use dbt, Elementary's open-source package adds anomaly tests for volume, freshness and column values, plus schema-change tests, next to the tests you already have. Commercial observability platforms such as Monte Carlo offer the same kind of monitoring as a hosted service across many warehouses and tools.
Data extracted by LLMs needs the same checks
More pipelines now have a language model in the middle, reading invoices, emails or PDFs and returning structured fields. Treat that output like any other source you don't trust yet.
At Jenesys AI, a London fintech whose AI bookkeeper reads invoices and receipts, our engineer built checks into the orchestration service that raise an alert when key fields (category, VAT percentage, tracking category) come back empty. Before that, missing values passed silently. Customer corrections were also fed back into the store the models learn from. Corrections are worth keeping for another reason: the share of extractions people had to correct is an accuracy figure you get every day without extra work.
For an oilfield services company we built, with an agency partner, an n8n workflow that reads field tickets with an LLM and has run every day since September 2025, at about 100 documents a day. The LLM steps did break, mostly on API rate limits (HTTP 429), and the fix was falling back to alternative models so that every document still gets processed. A ticket that silently drops out is a completeness failure, however well the others were read.
The checks we would put on any LLM extraction:
- validate the output against a schema (types, required fields, allowed values) before storing it
- count documents in and records out on every run
- compare a sample with the original documents every week, since that is the only real accuracy check
- record which model and prompt version handled each document, so a drop in quality can be traced to a change
Routing failures and fixing the cause
An alert nobody owns is noise. Every check needs a named owner and a destination: a Slack channel the owner actually reads, or a ticket in their queue. Severity should follow impact. A failure on the payout table should reach someone today; a warning on a marketing attribute can wait for Monday.
Then fix the cause. The UK framework tells teams to use root cause analysis and solve issues at source rather than apply temporary fixes, and that is right when the source is yours: add the form validation, the database constraint, the required field in the upstream app. When the source belongs to someone else, as the hospital systems behind Oplist do, handle it in your own layer, write the rule down, and keep a check that tells you how often it fires.
For recurring deliveries, write the quality bar into the agreement. Every month we deliver more than 20 data files for Method Procurement's dental-supply catalog; they have to pass the client's quality checks, and we work to a two-day SLA. If you send or receive files like these, agree in writing which checks a delivery has to pass and how quickly a file that fails gets fixed, so nobody has to negotiate it in the middle of a problem. Our post on support SLAs covers how to write one.
Tools, by the size of the problem
Tool | What it is | Good fit |
|---|---|---|
dbt data tests | Built into dbt, written in YAML and SQL | Any team already transforming data in dbt |
Elementary | Open-source dbt package and CLI (Apache 2.0) with anomaly tests and reports | dbt teams that want anomaly detection without another platform |
Great Expectations (GX Core) | Open-source Python library (Apache 2.0) | Python pipelines, dataframes, scrapers, stacks without dbt |
Soda Core | YAML data contracts and checks, under the Elastic License 2.0 | Teams that want explicit contracts between data producers and consumers |
Commercial observability (Monte Carlo and others) | Hosted anomaly detection, lineage and incident workflow | Hundreds of tables, several teams and a budget for a platform |
Two changes this year matter if you are choosing now. GX Cloud, the hosted Great Expectations product, was acquired by FICO and has not been publicly available since 1 June 2026; Fivetran took over stewardship of the open-source GX Core, whose repository now sits under Fivetran's GitHub organization. And in January 2026 Soda moved Soda Core from Apache 2.0 to the Elastic License 2.0, which still allows free internal and production use but isn't an OSI-approved open-source license and forbids offering it to others as a managed service.
Our view: if you already use dbt, start with its tests and add Elementary before paying for anything. A paid platform earns its cost when the hard part is coordinating many teams across hundreds of tables. Bought before the first twenty tests exist, it mostly produces alerts nobody owns.
What to measure
A single data quality score averaged across everything hides the one table that matters. Track a few numbers per critical dataset instead and review them monthly with the owners:
- the share of critical tables with key tests and a freshness check
- checks failing right now, and for how long
- who found each incident first: a check or a person
- time from alert to fix
- freshness breaches per month
The third tells you the most. If people downstream still spot most problems before your checks do, the checks are in the wrong places.
Personal data: accuracy is a legal duty too
Article 5(1)(d) of the GDPR requires personal data to be accurate and, where necessary, kept up to date, and requires every reasonable step to erase or correct inaccurate data without delay. Article 16 gives people the right to have inaccurate data about them corrected without undue delay. Article 19 then requires you to pass the correction on to every recipient the data was disclosed to, unless that proves impossible or takes disproportionate effort. That last duty is hard to meet if you can't say which systems and partners received a record. Turkey's data protection law, KVKK, has the same accuracy principle in Article 4.
A first month
- Week 1: list the five to ten tables behind money, customers or leadership reports, and profile each one (row counts, null rates, distinct values, ranges).
- Week 2: on those tables, add
uniqueandnot_nullto every primary key, freshness to every source that feeds a dashboard or export,accepted_valuesto the status and type columns your logic branches on, andrelationshipsto the foreign keys your reports join on. Leave everything except the key tests at warn, and route alerts to a channel the owners read. - Week 3: write one reconciliation for each headline number against its source system, as a singular test like the one above.
- Week 4: review what fired. Make the checks that caught real problems blocking, loosen or delete the noisy ones, and pick the next set of tables.
Frequently asked questions
What is the difference between data quality management and data governance?
Governance decides who owns each dataset, what its definitions are and what "good enough" means. Data quality management is the work of checking data against those decisions and fixing what fails. You can start writing checks before governance is formal, but each threshold eventually needs an owner who agreed to it.
Should I use dbt tests or Great Expectations?
If your transformations run in dbt, start with dbt tests: they live next to the models and run in the same job. Great Expectations fits better when data has to be checked in Python before it reaches a warehouse, for example in scrapers or dataframe pipelines. The two also work together: GX before the load, dbt tests after it.
What is a data contract?
A written agreement between whoever produces a dataset (a team, a supplier, a partner's API) and the people who use it: the schema, types, required fields, allowed values, how fresh the data must be and who to contact when it breaks. It is checked automatically at the boundary, so a delivery that breaks it is rejected before it reaches a report. Soda Core is built around contracts written in YAML; if you already use dbt, tests on your sources cover much of the same ground.
If you'd like help working out where the checks belong in your own pipelines, that is part of what our data and AI team does.
Related Articles
MLOps Guide: What to Set Up First, and What Can Wait
MLOps gets a model into production and keeps it useful there. Here is the order we'd set it up in, with current MLflow and DVC examples, and what changes for LLM features.
Read More: MLOps Guide: What to Set Up First, and What Can WaitComputer Vision Applications: Where It Works and Where It Struggles
Where computer vision works today, from inspection lines to invoices and medical scans, what makes some applications hard, and when a general vision model saves you training your own.
Read More: Computer Vision Applications: Where It Works and Where It StrugglesAI Agent Development: When You Need One and How to Build It
An AI agent is a language model working in a loop with tools. When you need one, the loop in Python, choosing a framework, keeping it safe, and what each run costs.
Read More: AI Agent Development: When You Need One and How to Build It
