> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zeotap.com/llms.txt
> Use this file to discover all available pages before exploring further.

# NOT Logic vs. Does Not Exist

> Understand the difference between NOT logic blocks and the 'Does Not Exist' condition, and when to use each for accurate audience segmentation.

When building audience segments, the `NOT` logic block and the `Does Not Exist` condition can appear to serve the same purpose — but they operate differently and can produce significantly different audience counts. This page explains the distinction and guides you on when to use each approach.

<CardGroup>
  <Card title="Does Not Exist Condition" href="/articles/segment-customer/not-logic-vs-does-not-exist#does-not-exist-condition" icon="angles-right" iconType="solid" horizontal={true} />

  <Card title="NOT Logic Block" href="/articles/segment-customer/not-logic-vs-does-not-exist#not-logic-block" icon="angles-right" iconType="solid" horizontal={true} />

  <Card title="Comparison" href="/articles/segment-customer/not-logic-vs-does-not-exist#comparison-does-not-exist-vs-not-logic" icon="angles-right" iconType="solid" horizontal={true} />

  <Card title="Best Practices" href="/articles/segment-customer/not-logic-vs-does-not-exist#best-practices" icon="angles-right" iconType="solid" horizontal={true} />
</CardGroup>

## Does Not Exist Condition

The `Does Not Exist` condition is a null check. It matches all records where a specified field contains no value — that is, the field is empty, null, or has never been populated.

<Note>
  **When to use Does Not Exist**

  Use `Does Not Exist` when you want a simple, reliable check for records missing a specific data point. It evaluates a single field in isolation and is deterministic — its result does not depend on other conditions or blocks.
</Note>

**Common use cases:**

* Find contacts missing an email address or phone number
* Identify records where a preference field has never been set
* Build data quality segments to detect incomplete profiles

## NOT Logic Block

A `NOT` logic block excludes records that match the conditions defined within it. When applied to a single condition, it functionally inverts that condition. However, when multiple conditions are combined inside a `NOT` block, the exclusion logic operates on the **intersection** of all conditions in the block — not each condition independently.

<Warning>
  **NOT blocks with multiple conditions do not behave as a simple inversion of individual filters.** They apply compound exclusion logic, meaning the audience returned can be larger or smaller than expected depending on how the conditions are combined.
</Warning>

**Common use cases:**

* Exclude a complex multi-condition group of records (e.g., exclude anyone who is both a lead AND in a specific country)
* Invert compound logic where the combination of conditions — not each condition individually — defines who is excluded

## Comparison: Does Not Exist vs. NOT Logic

| **Scenario**                      | **Does Not Exist Behavior**                       | **NOT Logic Block Behavior**                                                |
| :-------------------------------- | :------------------------------------------------ | :-------------------------------------------------------------------------- |
| Single condition (field is empty) | Returns all records where the field has no value  | Returns all records **except** those where the field has no value           |
| Multiple conditions combined      | Each `Does Not Exist` check applies independently | Compound NOT blocks use exclusive logic — order and grouping affect results |
| Audience size expectation         | Smaller audience (only records with empty fields) | Larger audience (all records not matching the combined conditions)          |
| Risk of inaccuracy                | Low — straightforward null check                  | Higher — depends on block structure and field combinations                  |

### Why the Counts Differ

The core reason these two approaches return different audience counts comes down to scope:

* `Does Not Exist` evaluates a single field in isolation and returns all records where that field is null.
* A `NOT` block evaluates the entire set of conditions within the block, then excludes records that match **all** of those conditions simultaneously.
* If the conditions within the `NOT` block are not an exact mirror of a `Does Not Exist` check, the resulting set will differ — sometimes significantly.

<Note>
  **Avoid using multiple NOT blocks as a substitute for a single Does Not Exist check.** Doing so introduces unnecessary complexity and can produce unexpected audience sizes.
</Note>

## When to Use Each Approach

### Use Does Not Exist When

* You want to find records where a field has never been populated
* You need a simple, single-condition null check
* Predictability and consistency of audience size is important
* You are building a data quality segment (for example, contacts missing email or phone)

### Use NOT Logic Blocks When

* You need to exclude a complex multi-condition group of records
* You are inverting compound logic (for example, exclude anyone who is both a lead AND in a specific country)
* You understand that the exclusion applies to the combined match — not each condition independently

## Best Practices

Follow these recommendations when configuring audience logic in the Segment builder:

* **Start simple:** Build your audience using the most direct filter available. Add complexity only when needed.
* **Validate counts:** After building a segment, compare the audience count against a simpler equivalent version to confirm the logic is working as expected.
* **Use Does Not Exist for null checks:** Do not use a `NOT` block to replicate null-check logic. Use the dedicated `Does Not Exist` operator instead.
* **Document complex logic:** If a segment uses multiple `NOT` blocks, add a description or internal note explaining the intended logic.
* **Test with a small sample:** Before activating a segment, review a sample of audience members to verify they match the expected criteria.
* **Avoid redundant NOT blocks:** Combining multiple `NOT` conditions on the same field can produce unintuitive results. Simplify where possible.

## Troubleshooting Unexpected Audience Counts

If your audience count does not match your expectations, follow these steps:

1. **Simplify the logic:** Remove all `NOT` blocks and rebuild using basic filters to establish a baseline count.
2. **Compare approaches:** Build the same logical intent using `Does Not Exist` and again using `NOT` logic. Check whether both return the same count.
3. **Check for multiple NOT blocks:** If you have more than one `NOT` block, verify that you intend compound exclusion — not individual exclusions.
4. **Review field population:** If the field used in your filter is sparsely populated, `Does Not Exist` may return an unexpectedly large audience.
5. **Consult support:** If the issue persists after simplification, raise a support ticket with screenshots of both segment configurations and their respective counts.

## Related Topics

<CardGroup>
  <Card title="Operators Used in Audience Segmentation" href="/articles/segment-customer/work-with-operators" icon="angles-right" iconType="solid" horizontal={true} />

  <Card title="How do Conditional Blocks Work" href="/articles/segment-customer/how-do-conditional-blocks-work" icon="angles-right" iconType="solid" horizontal={true} />

  <Card title="Apply Attributes to Your Audience" href="/articles/segment-customer/apply-attributes-to-your-audience" icon="angles-right" iconType="solid" horizontal={true} />

  <Card title="Create an Audience" href="/articles/segment-customer/create-an-audience" icon="angles-right" iconType="solid" horizontal={true} />
</CardGroup>
