fixed outlier_detector

This commit is contained in:
Joaquin Ossa 2024-11-26 16:10:41 +01:00
parent 42d70f72d5
commit 0ea07ed6bf

View file

@ -4,12 +4,13 @@
with
-- Retrieve recent data based on the defined days_to_consider
recent_data as (
select {{ date_column }}, {{ column_name }}
select {{ date_column }}, sum({{ column_name }}) as {{ column_name }}
from {{ model }}
where
{{ date_column }} between (
current_date - interval '{{ days_to_consider + 1 }} days'
) and (current_date - interval '1 day')
group by {{ date_column }}
),
metrics_stats as (
select