> ## 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.

# where_expression

> [card] [Generate your anomaly test with Elementary AI](https://elementary-data.com/community)
>
> Let our Slack chatbot create the anomaly test you need.

`where_expression: [sql expression]`

Filter the tested data using a valid sql expression.

* *Default: None*
* *Relevant tests: All anomaly detection tests*

The `where_expression` is used to filter out the data that you want to test. For example, to only test weekdays for anomalies, you can filter on the day of the week:

```yml theme={null}
where_expression: EXTRACT(DOW FROM timestamp_column) BETWEEN 2 AND 6 
#Test Monday through Friday
```

```yml test theme={null}
models:
  - name: this_is_a_model
    data_tests:
      - elementary.volume_anomalies:
          arguments:
            where_expression: "user_name != 'test'"
```

```yml model theme={null}
models:
  - name: this_is_a_model
    config:
      elementary:
        where_expression: "loaded_at is not null"
```

```yml dbt_project.yml theme={null}
vars:
  where_expression: "loaded_at > '2022-01-01'"
```


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