Addressed comments
This commit is contained in:
parent
bede588062
commit
0f5eb5fba2
5 changed files with 14 additions and 11 deletions
|
|
@ -4,7 +4,7 @@
|
|||
with
|
||||
-- Retrieve recent data based on the defined days_to_consider
|
||||
recent_data as (
|
||||
select *
|
||||
select date_day, {{ column_name }}
|
||||
from {{ model }}
|
||||
where
|
||||
date_day between (
|
||||
|
|
@ -20,8 +20,11 @@
|
|||
outliers as (
|
||||
select
|
||||
{{ column_name }} as value,
|
||||
abs({{ column_name }} - metrics_stats.avg_value)
|
||||
> (metrics_stats.stddev_value * {{ sigma_threshold }}) as is_outlier
|
||||
(abs({{ column_name }} - metrics_stats.avg_value))
|
||||
/ (metrics_stats.stddev_value) as absolute_deviation_z_score,
|
||||
(abs({{ column_name }} - metrics_stats.avg_value))
|
||||
/ (metrics_stats.stddev_value)
|
||||
> {{ sigma_threshold }} as is_outlier
|
||||
from {{ model }}
|
||||
cross join metrics_stats
|
||||
where date_day = current_date - interval '1 day'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue