> ## Documentation Index
> Fetch the complete documentation index at: https://elementary-devin-1782754750-bigquery-permissions-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# where_expression

<Card title="Generate your anomaly test with Elementary AI" icon="wand-magic-sparkles" horizontal="true" href="https://elementary-data.com/community">
  Let our Slack chatbot create the anomaly test you need.
</Card>

`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
```

<RequestExample>
  ```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'"
  ```
</RequestExample>
