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

# Completeness test

> Detect rows where a required value is null, empty, or zero.

Validates that a column or expression has a value in every row. Use it for required fields such as IDs, foreign keys, amounts, and status columns.

This is a [SQL data test](https://docs.elementary-data.com/cloud/features/data-tests/sql-data-tests.md): Elementary runs it against your warehouse on a schedule, with no SQL to write and no pull request.

> [!NOTE]
>
> SQL-based cloud tests read table data, so they need **data access** for the environment's warehouse connection. Data access is enabled in one of two ways:
>
> * Elementary enables data access on the warehouse connection. Contact the Elementary team to turn it on.
> * You connect an [Elementary Runtime](https://docs.elementary-data.com/cloud/features/elementary-runtime.md) to the warehouse connection.
>
> Until data access is available, these tests are hidden from the test catalog.

## How it works

On each run, Elementary returns every row where the tested value counts as missing. You choose what counts as missing:

| Missing value check | A row fails when |
| - | - |
| **Null** (default) | The value is `null` |
| **Empty** | The value is an empty string, `''`. Strings that contain only spaces are not empty |
| **Zero** | The value is `0`. Use it on numeric columns only |

When you select more than one check, a row fails if it matches any of them. Each failing row is one table row, and the row sample contains the full rows.

Results count toward the **Completeness** [data quality dimension](https://docs.elementary-data.com/cloud/features/collaboration-and-communication/data-quality-dimensions.md).

## Configuration

| Setting | Description |
| - | - |
| **Tested field** | The column, or an expression, that must have a value |
| **Missing values** | One or more of **Null**, **Empty**, and **Zero**. At least one is required |
| **Where clause** | Optional condition that limits the rows checked |

Severity, thresholds, sampled rows, and cadence work the same for all SQL data tests. See [Configuration](https://docs.elementary-data.com/cloud/features/data-tests/sql-data-tests.md#configuration).

## Examples

| Goal | Tested field | Missing values | Where clause |
| - | - | - | - |
| Every order has a customer | Column `customer_id` | Null | — |
| Every user has an email | Column `email` | Null, Empty | — |
| Every paid invoice has an amount | Column `amount` | Null, Zero | `status = 'paid'` |
| Trimmed names aren't empty | Expression `trim(name)` | Null, Empty | — |

> [!TIP]
>
> Allow a small number of missing values with a threshold instead of a filter, for example **Error if > 100**. See [Results](https://docs.elementary-data.com/cloud/features/data-tests/sql-data-tests.md#results).

## dbt equivalent

The dbt [`not_null`](https://docs.getdbt.com/reference/resource-properties/data-tests#not_null) test checks for nulls from your dbt project. Checks for empty strings or zeros need a package test or a custom test in dbt. See [Cloud tests or dbt tests](https://docs.elementary-data.com/cloud/features/data-tests/cloud-or-dbt-tests.md) to decide which to use.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.