Request a demo
All articles How it works

Validation rules and data profiling: checking the data, not just the copy

Two tables can match perfectly and both be wrong. How InsightReconcile's validation rules and data profiler check completeness, accuracy and shape, and how profile history turns into anomaly and schema-drift checks.

November 9, 2026 · 6 min read

Reconciliation answers "did the data arrive as it left?" It does not answer "was it right to begin with?" A billing table with a negative credit limit, or customers with no email, will reconcile perfectly into the warehouse. InsightReconcile has two tools for the second question: validation rules and the data profiler.

Validation rules

Rules live under Quality → Validation Rules. Each has a name, a type, a severity (critical, high, medium or low), a target column, a configuration and a category such as completeness, accuracy, validity or uniqueness. A rule either belongs to a recon job, in which case it runs on every run of that job, or to a connection and data store, in which case you test it on its own.

Rule typeWhat it checksConfiguration
Null checkThe column has no empty valuesnone
RangeValues fall between a minimum and a maximummin, max
UniquenessNo value appears twicenone
RegexValues match a patternpattern
Custom SQLYour own SQL conditiona query
ReferentialValues exist in another table's columnreference table and column
Cross-dataset (with a job)Every value in a source column appears in a column of the target datareference_column

The rules list shows each rule's expression in plain form (0.01 ≤ amount ≤ 1000000, invoice_id IS NOT NULL, UNIQUE(invoice_id), invoice_id ~ /^INV-\d{4}-\d{4}$/), what it applies to, and a run button. There is also a library of reusable rules.

The Validation Rules page listing six made-up rules: range, null check, uniqueness and regex on invoices, and a null check and range on customers.
Validation rules on the demo database. Four belong to the invoice job; two check the customers table on their own.

Testing a rule reports how many records it checked and how many failed. On the demo customers table the Customer email present null check fails on 2 of 10 rows, and Credit limit not negative finds one customer with a limit below zero. Neither would ever show up in a reconciliation, because the warehouse faithfully copies both problems.

Give a range rule both ends. A range test takes both a minimum and a maximum; set a generous maximum if you only care about the lower bound.

Tested on their own or run with a job: not quite the same

The same rule behaves slightly differently depending on where it runs, and the differences matter when you read a result:

Tested on its ownRun with a job
Data checkedThe rule's connection and table, counted in SQLThe source query's result, already fetched for the run
Custom SQLRuns your query; passes when it returns no rowsTest it on its own against the connection
ReferentialLooks for values with no match in the reference tableUse the cross-dataset rule inside a run
RegexReads up to 1,000 rows of the columnEvery row of the source result
RangeNeeds both a minimum and a maximumEither end may be left empty

Writing a custom SQL rule

A custom SQL rule is a query that returns the violations. Zero rows means the rule passes; any rows fail it, and the first few are kept as samples. For example, with made-up table names, a rule that every paid invoice has a payment date:

SELECT invoice_id, status, paid_at
FROM public.ar_invoices
WHERE status = 'PAID' AND paid_at IS NULL

Writing it this way round also makes the samples useful: they are the rows someone has to fix. Regex patterns are anchored at the start of the value, so add $ at the end if the whole value must match.

The data profiler

The Data Profiler takes a connection and a data store (a table) and records, for every column: its type, total and null counts, null percentage, distinct values, minimum, maximum, mean, median, standard deviation and its most frequent values. Each profile run is kept, so you can compare runs over time.

The Data Profiler page for the made-up billing connection, with profile cards for the payments, invoices and customers tables showing rows, columns and null percentage.
Profiles of three made-up tables. Each card shows rows, columns and the share of null values; the detail view lists every column's statistics.

From history to checks

Two checks use that history:

  • Anomalies. For each column, the latest null count is compared with the history of earlier profiles. If it is higher than the historical mean plus two standard deviations (or 1.5 times the mean when the history is flat), the column is flagged, with the numbers that triggered it.
  • Schema drift. Each profile run also stores a schema snapshot. Comparing the two most recent snapshots lists columns that were added, removed or changed type. A renamed column shows as one removed and one added, which is exactly the kind of upstream change that breaks a reconciliation silently.

Both need at least two profile runs of the same table; on a first profile the page says there is not enough history yet.

A profile reads a sample of up to 10,000 rows of the table, so for large tables the statistics describe that sample rather than every row. That is usually enough to catch a column that suddenly fills with nulls, but it is not a substitute for a null check rule on a column that must never be empty.

Rules on a job or on their own

Attach a rule to a job when it guards the data that job compares; it then runs on every run and its results sit in the run's Validations tab, next to the comparison. Keep a rule on its own, bound to a connection and table, when it describes the data itself, such as a customer master's completeness, and run it when you profile that table. Either way the result says how many records were checked, how many failed and shows a few examples.

A sensible set of checks

  • Keys: null check and uniqueness, critical severity, attached to the recon job.
  • Amounts and dates: ranges that reflect the business (no invoice below one cent, no date in the future).
  • Identifiers: a regex for the format your systems issue.
  • Reference data: a referential rule from transactions to the customer master.
  • Every important table: a profile run on a regular cadence so anomalies and drift have history to work from.

Frequently asked questions

Do rule failures create exceptions?

No. Exceptions come from the comparison. Rule results are stored with the run, or returned by the test, with the records checked, the failures and samples.

What does severity change?

It is how you rank the rule for the people reading results; the engine runs every rule the same way. Use critical for the rules that should stop a sign-off.

How often should we profile?

As often as the table changes in ways you care about, and at least before and after a known upstream change. The anomaly check needs a history, so a regular cadence is worth more than an occasional deep look.

Reconcile two of your own tables

Pick a source and a target you argue about at month-end. We set up the job with you and walk through the first run's differences.

Request a demo