fixed outlier_detector
This commit is contained in:
parent
42d70f72d5
commit
0ea07ed6bf
1 changed files with 2 additions and 1 deletions
|
|
@ -4,12 +4,13 @@
|
||||||
with
|
with
|
||||||
-- Retrieve recent data based on the defined days_to_consider
|
-- Retrieve recent data based on the defined days_to_consider
|
||||||
recent_data as (
|
recent_data as (
|
||||||
select {{ date_column }}, {{ column_name }}
|
select {{ date_column }}, sum({{ column_name }}) as {{ column_name }}
|
||||||
from {{ model }}
|
from {{ model }}
|
||||||
where
|
where
|
||||||
{{ date_column }} between (
|
{{ date_column }} between (
|
||||||
current_date - interval '{{ days_to_consider + 1 }} days'
|
current_date - interval '{{ days_to_consider + 1 }} days'
|
||||||
) and (current_date - interval '1 day')
|
) and (current_date - interval '1 day')
|
||||||
|
group by {{ date_column }}
|
||||||
),
|
),
|
||||||
metrics_stats as (
|
metrics_stats as (
|
||||||
select
|
select
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue