<@U088WCP3B4P> can we set something in the config ...
# ask-elementary-ai
y
@kapa.ai can we set something in the config so that we can start recalculating the metrics starting from today if we have significantly more or fewer rows today
k
A message from kapa.ai
There’s no config that says “start from today” automatically when volume changes a lot, but there are two supported ways to effectively restart metrics from now: ### 1. Force a full metrics recomputation (recommended) Run your tests with:
Copy code
bash dbt test --vars '{"force_metrics_backfill": true}'
This forces Elementary to recalculate metrics instead of relying on cached history, so the anomaly model is retrained on the current data pattern. [[Retraining tests](https://slack.com/archives/C02CTC89LAX/p1698154501770259); [force_metrics_backfill](https://slack.com/archives/C02CTC89LAX/p1705323587448999)] You can combine this with a shorter
training_period
(or
days_back
on older configs) so only recent data (e.g., last 7–14 days) is used going forward. [[training_period behavior](https://docs.elementary-data.com/data-tests/anomaly-detection-configuration/training-period)] ### 2. Manually clear old metrics for that table If you want to truly “start from today” for a specific table: 1. Delete that table’s rows from
elementary.data_monitoring_metrics
with a
DELETE ... WHERE
on the relevant identifiers. [[Reset metrics for a table](https://elementary-community.slack.com/archives/C02CTC89LAX/p1681289966274379)] 2. Run
dbt test
again (optionally with
force_metrics_backfill: true
). Elementary will then rebuild metrics only from the remaining (new) data. --- There is no documented per‑test YAML flag that automatically discards all history when today’s volume changes a lot; you need to use
force_metrics_backfill
and/or delete old metrics as above.