Value List Validation
Detects values of a field that are not in a list of accepted values.
The Value List Validation monitor checks that a field only contains values from a list you provide.
When to Use
- Status fields: A status field must only contain the statuses that downstream processes handle.
- Reference codes: A field of codes, such as country codes, must only contain the codes your business uses.
When the accepted values are stored in another table, use Referential Integrity instead.
How It Works
For each data point, Sifflet counts the rows where the field value is not in the list, and computes:
- Count (default value mode): The number of rows with a value outside the list.
- Percentage: The share of these rows among the rows checked for the data point, in percent. These are the rows of the period in incremental scan mode (for example, all the rows created that day), or all the rows of the table in full dataset scan mode. Rows excluded by the where clause are not counted.
Null values are not counted as values outside the list. To detect them, use Nulls.
Sifflet compares values as strings, with an exact match: whether the comparison is case-sensitive depends on the collation of your data source.
The default static threshold fails when the data point is greater than 0, that is, as soon as one row has a value outside the list.
Example
You want the status of every order to be one of the four known statuses. Create a Value List Validation monitor on orders with the following settings:
- Column to monitor:
status. - Value list:
pending,shipped,delivered,cancelled. - Monitoring mode: Incremental scan, with
created_atas the time window column and a daily time-based data aggregation. - Threshold: Static, Greater than
0(default).
On June 8, a new version of the sales website introduces a returned status, and 140 orders of the day get it. The data point of June 8 is 140, greater than 0, so the monitor fails.
Configure the Monitor
Value List Validation Settings
| Setting | Description | Default |
|---|---|---|
| Column to monitor | The field to check. | None |
| Value list | The accepted values. | None |
Common Settings
- Value mode: Count (default) or Percentage.
- Threshold: Static (default), relative, or dynamic. See Thresholds.
- Scan mode: Incremental or full dataset. See Scan Modes.
- Where clause and group by: See Where Clause, Group By, and Joins.
- Joins: Join a second dataset to filter or group by its fields. See Joins.
Monitor as Code
The monitor kind is FieldInList. The following YAML creates the monitor of the example:
kind: FieldInList
field: status
values:
- pending
- shipped
- delivered
- cancelled
timeWindow:
field: created_at
firstRun: P365D
frequency: P1D| Parameter | Required | Description |
|---|---|---|
field | Yes | The field to check. |
values | Yes | The list of accepted values (at least one). |
For the shared parameters, see the Parameters reference.
Updated 5 days ago

