contact us

Rule-Driven Data Quality Framework for Customer Data

A governed Snowflake framework checks customer data across four systems and gives data owners scores plus record-level evidence to act on.

Confidential healthcare nutrition company NDA 2026

Status: Delivered and live in production.

IT & Data Healthcare Nutrition / FMCG Data Quality & Governance
Customer records pass through SQL rules to quality scores and row-level evidence.
Process overview. Open full image

Challenge

Customer data drifted across four systems, while report-based rules obscured failures and distorted scores.

Delivered solution

SQL entity views, a tested rule catalogue, a Snowflake evaluation engine and DirectQuery reporting.

Business value

Governed rules, honest scores and row-level evidence that data owners can use to correct records.

Challenge

A healthcare nutrition company manages its healthcare-professional customer data across four systems: a digital identity platform, a CRM, a marketing automation platform and an e-commerce shop. Each system holds its own version of the customer, so names, emails, addresses and consents can drift apart.

The existing data quality report had grown organically. Its rules were spread across report formulas and data transformations, and its scores were calculated once per refresh, so they did not respond to filters. Some records were filtered out before they were measured, which made the scores look better than they were. The report could also say that a percentage was low, but not which records were wrong or why.

Approach

We started by reverse-engineering the existing report: every source, transformation and measure was documented, and each issue in the logic was listed. That gave a clear baseline and a list of what had to change.

We then rebuilt data quality as a framework instead of a report:

  • Business data entities. One SQL view per business entity, such as customers, accounts, addresses, email events and orders, combining the underlying source tables. Each view has a defined grain and business-friendly column names. Values are passed through untouched, including placeholders, gaps and duplicates, so the checks see the data as it really is. A dedicated cross-system entity links each customer's digital identity to their CRM record through a shared key, and compares names and postcodes after normalisation.
  • A check catalogue. More than 120 rules, each a single SQL expression that returns true for a good record and false for a bad one. The rules cover five dimensions: completeness, validity, uniqueness, consistency and referential integrity. Every rule is tested automatically against good, bad and empty records before it is deployed. Each problem is reported once: a missing value fails completeness, not also format and uniqueness.
  • A rule-driven engine. A stored procedure reads the catalogue, evaluates every rule on every row, and separates errors from warnings. It writes run statistics per dimension, field, country and customer segment. For each failing record it logs only the fields that matter for that rule, so the evidence is immediately readable.
  • Reporting on top. A single statistics view feeds the report through DirectQuery, so the report shows the latest run without a separate refresh. No data is stored in Power BI: every query goes to the governed layer in Snowflake, so access rules and data stay in one place.
  • Data retention. Old and unused run results and error details are purged on a regular schedule, so only the data the report needs is kept.

Outcomes

Qualitative project outcomes; no measured savings are claimed.

  • One governed place for data quality rules, instead of logic spread across a report

  • Honest scores: nothing is removed before it is measured

  • Row-level evidence for every failure, so data owners can fix records rather than discuss percentages

  • Cross-system consistency made visible: whether the same customer looks the same in the identity platform and in the CRM

  • Results broken down by country and customer segment, with proper totals to calculate error rates

  • New checks are added as a row in the catalogue; no code changes needed

  • No copies of customer data in the reporting tool, and no build-up of outdated results: data stays in Snowflake and is kept only as long as it is needed

Snowflake SQL & Snowflake Scripting Power BI (DirectQuery)

Solution areas: Data Foundations · Data Governance

Want to discuss a similar challenge?

Tell us where you are today and what you're trying to move. We'll share what we've learned from comparable engagements and propose a focused way to start.

Book a 30-minute discussion