<@U088WCP3B4P> Hello ! In my dbt_project.yml, i ha...
# ask-elementary-ai
a
@kapa.ai Hello ! In my dbt_project.yml, i have set elementary days_back to 30. Now when i run edr send-report to update my elementary dashboard, should i always set the -d to 30 or does it make sense to put less since generally there should be no need to update the data from more than 20 days ago for example ?
k
A message from kapa.ai
Great question! The key point is that the days_back setting in your dbt_project.yml and the -d/--days-back flag in the CLI serve different purposes: - The days_back variable in dbt_project.yml controls how much historical data Elementary tests will collect and analyze when you run your dbt tests. For example, if you set days_back: 30, your anomaly detection tests will use the last 30 days of data for their calculations and context. - The -d/--days-back flag in the edr send-report (or edr report) CLI command controls how much historical data is included in the generated report or dashboard. This determines how many days of results are shown in the report, not how much data is collected by the tests themselves. So, if you generally only want to update or display the last 20 days in your dashboard, you can safely use edr send-report -d 20, even if your tests are configured to analyze 30 days of data. This will make your report smaller and potentially faster to generate, without affecting the underlying anomaly detection logic. In summary: You do not need to always set -d to 30 just because your tests use 30 days of history. Set -d to whatever window you want to display in your report/dashboard. The two settings are independent in this way [see explanation here](https://slack.com/archives/C02CTC89LAX/p1677183081530049) and [here](https://slack.com/archives/C02CTC89LAX/p1685471780142259).
a
@kapa.ai Ok i see, so if i still want to show 30 days of data in my dashboard, i should still put edr send-report -d 30 then right ? But i can also set edr monitor -d 1 so that i only send the new alerts since i run that daily, right ?
k
A message from kapa.ai
Yes, that's correct! - If you want your dashboard/report to show 30 days of data, you should run:
Copy code
edr send-report -d 30
or
Copy code
edr report --days-back 30
This will include the last 30 days of results in your report/dashboard, as long as your tests have collected that much history (which they will, since you set days_back: 30 in your dbt_project.yml) [see: "The whole report is 7 days back by default. You should generate the report and set this parameter to change the number of days in the report." and "you can control it by passing --days-back to the edr command like edr report --days-back 30"](https://slack.com/archives/C02CTC89LAX/p1699009117530779, https://slack.com/archives/C02CTC89LAX/p1686465000985369). - For alerts, you can run:
Copy code
edr monitor -d 1
This will only send alerts for issues that have happened during the last day, which is useful if you want to avoid duplicate or old alerts being sent every time you run the monitor command [see: "you can pass a —days-back 1 to limit the alerts just to a single day" and "one workaround for this could be to run two different command, one for generating / sending the report and one for sending the alerts. Then you can provide different days_back setting to each one of them"](https://slack.com/archives/C02CTC89LAX/p1669159603059669). This approach is commonly recommended and allows you to control the time window for both your dashboard and your alerting independently.