1818 z .last_median_absolute_deviation ,
1919 z .last_mean_absolute_deviation ,
2020 z .last_iqr ,
21- z .last_first_quartile - (cast( {{ fivetran_utils . json_extract (' m.anomaly_detector' , ' whisker_boundary_multiplier' ) }} as {{numeric_type()}} ) * z .last_iqr ) lower_bound,
22- z .last_third_quartile + (cast( {{ fivetran_utils . json_extract (' m.anomaly_detector' , ' whisker_boundary_multiplier' ) }} as {{numeric_type()}} ) * z .last_iqr ) upper_bound,
21+ z .last_first_quartile - (cast( {{ json_extract(' m.anomaly_detector' , ' whisker_boundary_multiplier' ) }} as {{numeric_type()}} ) * z .last_iqr ) lower_bound,
22+ z .last_third_quartile + (cast( {{ json_extract(' m.anomaly_detector' , ' whisker_boundary_multiplier' ) }} as {{numeric_type()}} ) * z .last_iqr ) upper_bound,
2323 z .last_first_quartile ,
2424 z .last_third_quartile ,
2525 z .time_window_end ,
@@ -35,15 +35,15 @@ and {{ split_and_return_nth_value('table_name', '.', 2) }} = m.schema
3535and {{ split_and_return_nth_value(' table_name' , ' .' , 3 ) }} = m .name
3636where
3737 case
38- when {{ fivetran_utils . json_extract (' m.anomaly_detector' , ' name' ) }} = ' z_score'
39- then abs(z_score_value) > cast({{ fivetran_utils . json_extract (' m.anomaly_detector' , ' threshold' ) }} as {{ numeric_type() }})
40- when {{ fivetran_utils . json_extract (' m.anomaly_detector' , ' name' ) }} = ' modified_z_score'
41- then abs(modified_z_score_value) > cast( {{ fivetran_utils . json_extract (' m.anomaly_detector' , ' threshold' ) }} as {{numeric_type()}} )
42- when {{ fivetran_utils . json_extract (' m.anomaly_detector' , ' name' ) }} = ' boxplot'
38+ when {{ json_extract(' m.anomaly_detector' , ' name' ) }} = ' z_score'
39+ then abs(z_score_value) > cast({{ json_extract(' m.anomaly_detector' , ' threshold' ) }} as {{ numeric_type() }})
40+ when {{ json_extract(' m.anomaly_detector' , ' name' ) }} = ' modified_z_score'
41+ then abs(modified_z_score_value) > cast( {{ json_extract(' m.anomaly_detector' , ' threshold' ) }} as {{numeric_type()}} )
42+ when {{ json_extract(' m.anomaly_detector' , ' name' ) }} = ' boxplot'
4343 then (
44- z .last_value < z .last_first_quartile - (cast( {{ fivetran_utils . json_extract (' m.anomaly_detector' , ' whisker_boundary_multiplier' ) }} as {{numeric_type()}} ) * z .last_iqr )
44+ z .last_value < z .last_first_quartile - (cast( {{ json_extract(' m.anomaly_detector' , ' whisker_boundary_multiplier' ) }} as {{numeric_type()}} ) * z .last_iqr )
4545 or
46- z .last_value > z .last_third_quartile + (cast( {{ fivetran_utils . json_extract (' m.anomaly_detector' , ' whisker_boundary_multiplier' ) }} as {{numeric_type()}} ) * z .last_iqr )
46+ z .last_value > z .last_third_quartile + (cast( {{ json_extract(' m.anomaly_detector' , ' whisker_boundary_multiplier' ) }} as {{numeric_type()}} ) * z .last_iqr )
4747 )
4848 else false
4949 end
0 commit comments