Skip to content

Not Exists In Check Examples

Three real-world scenarios that show how the Not Exists In check is typically used in production: keeping suppressed contacts out of a mailing set, blocking retired codes with both filters, and auditing a legacy overlap. The first two run at 100% coverage and report Record Anomalies; the third lowers coverage and reports a Shape Anomaly instead.

The situation: Contacts who opted out are recorded on a suppression list. Any address that appears there must not be present in the active mailing audience, or the next campaign sends mail someone explicitly refused.

Check configuration

Field Value
Rule Not Exists In
Field email
Filter (none)
Custom Anomaly Description Off
Reference Container SUPPRESSION_LIST
Reference Field email
Reference Filter (none)
Coverage 100%
Owner (check creator)
Anomaly Assignee (Compliance team)
Description Active contacts must not appear on the suppression list.
Tags compliance, integrity
Additional Metadata jira: DATA-10001
Status Active

Payload

{
    "description": "Active contacts must not appear on the suppression list.",
    "rule": "notExistsIn",
    "fields": ["email"],
    "container_id": 145,
    "coverage": 1,
    "filter": null,
    "properties": {"ref_container_id": 178, "field_name": "email"},
    "tags": ["compliance", "integrity"],
    "additional_metadata": {"jira": "DATA-10001"},
    "anomaly_message_field": null,
    "template_id": null,
    "status": "Active",
    "owner_id": 7,
    "default_anomaly_assignee_id": 12
}

Sample Data

contact_id email on suppression list?
K-01 ana@example.com no
K-02 opted.out@example.com yes
K-03 bruno@example.org no
K-04 (null) not evaluated

What gets flagged

Contact K-02 is on the suppression list and should not be in the active audience. K-04 has no address, so there is nothing to look up and the row passes. Coverage is 100%, so the failing row is reported as a Record Anomaly.

Record Anomaly

The field 'email' has value 'opted.out@example.com', which unexpectedly exists in 'email'

Flowchart

graph TD
    A["Build the lookup set<br/>from the reference field"] --> B["Read email"]
    B --> C{"Is value NULL?"}
    C -->|Yes| D["Row passes"]
    C -->|No| E{"Is email absent from<br/>the suppression set?"}
    E -->|Yes| D
    E -->|No| F["Flag row.<br/>Record Anomaly per failing row."]

Equivalent SQL

-- Rows the Not Exists In check would flag.
SELECT c.*
FROM contacts c
WHERE c.email IS NOT NULL
  AND c.email IN (SELECT email FROM suppression_list);

The situation: New products may not reuse a code that was retired. Legacy products keep theirs, so the target filter limits the check to recent rows, and the reference filter limits the blocked set to codes retired in the current policy window.

Check configuration

Field Value
Rule Not Exists In
Field product_code
Filter created_at >= '2026-01-01'
Custom Anomaly Description Off
Reference Container RETIRED_CODE
Reference Field code
Reference Filter retired_at >= '2020-01-01'
Coverage 100%
Owner (check creator)
Anomaly Assignee (Catalog Data team)
Description New products must not reuse a retired code.
Tags catalog, integrity
Additional Metadata jira: DATA-10044
Status Active

Payload

{
    "description": "New products must not reuse a retired code.",
    "rule": "notExistsIn",
    "fields": ["product_code"],
    "container_id": 512,
    "coverage": 1,
    "filter": "created_at >= '2026-01-01'",
    "properties": {"ref_container_id": 803, "field_name": "code", "ref_filter": "retired_at >= '2020-01-01'"},
    "tags": ["catalog", "integrity"],
    "additional_metadata": {"jira": "DATA-10044"},
    "anomaly_message_field": null,
    "template_id": null,
    "status": "Active",
    "owner_id": 7,
    "default_anomaly_assignee_id": 22
}

Sample Data (target filtered to created_at >= '2026-01-01', reference filtered to retired_at >= '2020-01-01')

sku product_code retired since 2020?
SKU-01 PC-9001 no
SKU-02 PC-4410 yes
SKU-03 PC-9003 no

Why the filter matters

The target filter keeps legacy products out of the evaluation. The reference filter narrows the blocked set to recently retired codes, so a code retired decades ago can legitimately be reused.

What gets flagged

SKU-02 reuses a code retired in the current policy window. Coverage is 100%, so the failure is reported as a Record Anomaly, and the message ends with the target filter that scoped the evaluation.

Record Anomaly

The field 'product_code' has value 'PC-4410', which unexpectedly exists in 'code' [filter: created_at >= '2026-01-01']

Flowchart

graph TD
    A["Apply target filter: created_at >= '2026-01-01'"] --> B["Build the lookup set<br/>from the reference field"]
    B --> C{"Is product_code absent from<br/>the retired-code set?"}
    C -->|Yes| D["Row passes"]
    C -->|No| E["Flag row.<br/>Anomaly message ends with<br/>[filter: created_at >= '2026-01-01']"]

Equivalent SQL

-- Rows the check would flag among recent products.
SELECT p.*
FROM products p
WHERE p.created_at >= DATE '2026-01-01'
  AND p.product_code IS NOT NULL
  AND p.product_code IN (SELECT code FROM retired_code WHERE retired_at >= DATE '2020-01-01');

The situation: Two systems were merged and a handful of identifiers ended up in both the active table and the archive, which must stay disjoint. A deduplication job is resolving them, so the check tolerates up to 0.5% failures while it runs.

Check configuration

Field Value
Rule Not Exists In
Field record_id
Filter (none)
Custom Anomaly Description Off
Reference Container ARCHIVE
Reference Field record_id
Reference Filter (none)
Coverage 99.5%
Owner (check creator)
Anomaly Assignee (Migration team)
Description Active records must not also exist in the archive.
Tags integrity, legacy
Additional Metadata jira: DATA-10088
Status Active

Payload

{
    "description": "Active records must not also exist in the archive.",
    "rule": "notExistsIn",
    "fields": ["record_id"],
    "container_id": 733,
    "coverage": 0.995,
    "filter": null,
    "properties": {"ref_container_id": 905, "field_name": "record_id"},
    "tags": ["integrity", "legacy"],
    "additional_metadata": {"jira": "DATA-10088"},
    "anomaly_message_field": null,
    "template_id": null,
    "status": "Active",
    "owner_id": 7,
    "default_anomaly_assignee_id": 41
}

Sample Data

record_id also in archive?
R-1001 no
R-1002 yes
R-1003 yes
(null) not evaluated

What gets flagged

Records R-1002 and R-1003 exist in both tables, which the merge was supposed to prevent. The NULL row passes without firing an anomaly but still counts in the scanned total. Only 50% of the rows pass, which is below the 99.5% coverage threshold, so the check reports a single Shape Anomaly for the dataset with a sample of the offending rows. Coverage below 100% does not produce Record Anomalies.

Shape Anomaly

For the field 'record_id', 50.000% of 4 records (2) have values that unexpectedly exist in 'record_id'

Flowchart

graph TD
    A["Build the lookup set<br/>from the reference field"] --> B["Read record_id"]
    B --> C{"Is value NULL?"}
    C -->|Yes| D["Row passes"]
    C -->|No| E{"Is record_id absent<br/>from the archive?"}
    E -->|Yes| D
    E -->|No| F["Flag row.<br/>Passing rate falls below the 99.5%<br/>coverage, so one Shape Anomaly is reported."]

Equivalent SQL

-- Rows the check would flag.
SELECT a.*
FROM active_records a
WHERE a.record_id IS NOT NULL
  AND a.record_id IN (SELECT record_id FROM archive);

See Also