Florian Dawans
06/20/2025, 1:32 PMkapa.ai
06/20/2025, 1:32 PMkapa.ai
06/20/2025, 1:32 PMyaml models: - name: your_model_name tests: - elementary.volume_anomalies: detection_delay: period: day count: 1 - period: The time unit to delay (e.g., hour, day, week, month). - count: The number of periods to delay. This configuration will exclude the most recent day from anomaly detection, which is useful if your data for the current day is not yet complete or fully loaded. The detection_delay parameter only works for tests that have a timestamp_column configured and does not affect other duration parameters like detection_period or training_period. The default value is 0 (no delay) [Detection Delay Documentation](https://docs.elementary-data.com/data-tests/anomaly-detection-configuration/detection-delay). If you need to exclude specific values or periods in a more granular way, you can use the anomaly_exclude_metrics parameter with a SQL expression, but this requires explicitly specifying the cases to exclude [Anomaly Params](https://docs.elementary-data.com/data-tests/anomaly-detection-configuration/anomaly-params). For most use cases where you want to ignore the latest period (e.g., "today"), detection_delay is the recommended approach.Florian Dawans
06/20/2025, 2:21 PMFlorian Dawans
06/20/2025, 2:22 PMkapa.ai
06/20/2025, 2:22 PMkapa.ai
06/20/2025, 2:22 PMyaml models: - name: your_model tests: - elementary.volume_anomalies: anomaly_exclude_metrics: "metric_date = '2024-07-04' AND dimension_value = 'US'" This would exclude July 4th for the dimension value 'US' from the anomaly detection training set. You can adjust the SQL expression to match your specific use case and dimensions. The filter can be configured using fields like metric_date, metric_time_bucket, and metric_value, and is supported in all anomaly detection tests [anomaly_exclude_metrics documentation](https://docs.elementary-data.com/data-tests/anomaly-detection-configuration/anomaly-exclude-metrics). Keep in mind that you need to specify the correct dimension field in your expression, and this approach requires you to enumerate the dates and dimensions you want to exclude. There is currently no built-in feature to exclude dates for dimensions via a calendar table, but you can use SQL logic in anomaly_exclude_metrics to achieve similar results.