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

# detection_delay

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

```
detection_delay:
  period: < time period > # supported periods: hour, day, week, month
  count: < number of periods >
```

The duration for retracting the detection period.
That's useful in cases which the latest data should be excluded from the test. For example, this can happen because of scheduling issues- if the test is running before the table is populated for some reason. The detection delay is the period of time to ignore, after the detection period.

* *Default: 0*
* *Relevant tests: Anomaly detection tests with `timestamp_column`*

<img src="https://mintcdn.com/elementary-devin-1782754750-bigquery-permissions-docs/zLPVq6zLYCQB7e8x/pics/anomalies/detection-delay.png?fit=max&auto=format&n=zLPVq6zLYCQB7e8x&q=85&s=cf312157e5bf79bace0a3dc27d1fdca2" alt="Detection Delay" width="3018" height="3087" data-path="pics/anomalies/detection-delay.png" />

<RequestExample>
  ```yml test theme={null}
  models:
    - name: this_is_a_model
      data_tests:
        - elementary.volume_anomalies:
            arguments:
              detection_delay:
                period: day
                count: 1
  ```

  ```yml model theme={null}
  models:
    - name: this_is_a_model
      config:
        elementary:
          detection_delay:
            period: day
            count: 1
  ```

  ```yml dbt_project.yml theme={null}
  vars:
    detection_delay:
      period: day
      count: 1
  ```
</RequestExample>

#### How it works?

The `detection_delay` param only works for tests that have `timestamp_column` configuration.
It does not affect the other duration parameters, like `detection_period` or `training_period`.
