> AI agents: this is one page from Mammoth Analytics documentation. The index of all pages as Markdown is https://mammoth.io/docs/llms.txt. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get Markdown.

# Data Check types: row count, nulls, unique values and ranges

> Every Mammoth Data Check rule: row count, null percentage, unique values, value range with tolerance, and custom prompts, plus parameter thresholds.
>
> Applies to: Where: View › Describe your transformation › Controls › Data Check

A **Data Check** in the **Controls** category tests the output of the task before it. Choose a type from the tiles when you open the form, or from the type dropdown on each check. To add a Data Check, see [Remove duplicate rows and add data quality checks](https://mammoth.io/docs/learn/clean-and-shape/duplicates-and-checks/).

![Check type dropdown open, listing Row count, Null percentage and Unique values with a short description for each](https://mammoth.io/docs/images/20261009_132022_DataCheck-CheckType-Dropdown.webp)

## Check the percentage of empty values (Null percentage)

Tests the share of null or empty values in a column. You set the column and a percentage threshold.

| Condition | Passes when |
| --- | --- |
| is less than | Null % is below the threshold |
| is greater than | Null % is above the threshold |
| is exactly | Null % equals the threshold |

**Example:** make sure `customer_email` has fewer than 1% nulls after a join, to catch a broken join before it drops records.

## Check the number of rows (Row count)

Tests the total number of rows in the output. You set one value, or a min and max for "is between".

| Condition | Passes when |
| --- | --- |
| is at least | Row count ≥ value |
| is at most | Row count ≤ value |
| is exactly | Row count equals value |
| is between | Row count is within the min–max range |

**Example:** make sure a daily sales feed has at least 1,000 rows, to catch a source failure before it produces empty reports.

## Check that values are unique (Unique values)

Tests whether a column's values are unique. Empty values are not counted. You set the column, plus a percentage for the second condition.

| Condition | Passes when |
| --- | --- |
| 100% unique (no duplicates) | Every value is distinct |
| Uniqueness at least... | At least the percentage you enter is unique |

**Example:** make sure `order_id` has no duplicates after a join, to catch fan-out that would inflate totals.

## Check that numbers fall within a range (Value range)

Tests whether a number column stays within bounds. You set the column, a value or min and max, and a **tolerance**.

| Condition | Passes when |
| --- | --- |
| between | Values are within the min–max range |
| is at least | Values are ≥ value |
| is at most | Values are ≤ value |
| is positive | Values are &gt; 0 |
| is negative | Values are &lt; 0 |

The tolerance options are *Fail if any row violates*, *Fail if > 1% violate*, *Fail if > 5% violate* and *Fail if > 10% violate*. A 1% tolerance means the check passes if at most 1% of rows break the rule. Use it for real-world data where a few edge cases are fine.

**Example:** require `transaction_amount` to be positive with a 1% tolerance, so rare refunds don't fail the whole pipeline.

## Write your own rule in plain words (Custom prompt)

Describe a rule and Mammoth writes the SQL for it.

![Data Check with Custom prompt selected, showing a plain-language prompt box and a Generate SQL button](https://mammoth.io/docs/images/20261009_132022_DataCheck-CustomPrompt.webp)

1. Select **Custom prompt** as the check type. The tile reads *Write your own rule*.
2. Type the rule, for example *"all prices must be positive"* or *"revenue should not exceed 10 million"*.
3. Click **Generate SQL**. Mammoth sends the description to an AI model, which writes a SQL condition.
4. Review the **Generated SQL** under the text box.
5. Click **Apply**.

The SQL runs as a condition against the whole pipeline output. For example, *"the discount percentage should never exceed 100"* becomes `discount_pct <= 100`.

## Use a parameter as a check threshold

Bind a check's number to a **parameter** instead of a fixed value, so the same pipeline works with different thresholds in different runs.

![Data Check configuration form showing a Row count check with an is at least operator and a threshold of rows](https://mammoth.io/docs/images/20261009_132022_DataCheck-Panel-RowCount.webp)

**Example:** a pipeline runs on small test data in development and full data in production.

1. Create a Number parameter `min_rows`.
2. In the Data Check, click the parameter icon next to the row count value.
3. Select `min_rows`.
4. Set `min_rows = 10` for development runs and `min_rows = 50000` for production runs.

See [Parameters and snippets](https://mammoth.io/docs/learn/organise/parameters-and-snippets/) to create a parameter.

## Related

- [What happens when a Data Check fails](https://mammoth.io/docs/learn/clean-and-shape/data-check-failures/): Any or All, pause or flag, results.
- [Use a project parameter as a value in a task](https://mammoth.io/docs/learn/clean-and-shape/parameters-in-tasks/): binding values in other tasks.
- [Column types, IDs, currency and percentages](https://mammoth.io/docs/learn/clean-and-shape/column-types/): types that get suggested checks.

---
Source: https://mammoth.io/docs/learn/clean-and-shape/data-check-types.md · Updated: 2026-11-08
