You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: models/metrics/for_anomalies/re_data_last_stats.sql
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ with median_value as (
6
6
column_name,
7
7
metric,
8
8
interval_length_sec,
9
-
avg(value) {% if target.type!='postgres' %} over(partition by {{ columns_to_group_by }}) {% endif %} as last_avg,
9
+
avg(value) {% if target.typenot in postgres_type_db() %} over(partition by {{ columns_to_group_by }}) {% endif %} as last_avg,
10
10
{{ percentile(percentile_field='value', partition_field=columns_to_group_by, percent='0.25') }} as last_first_quartile,
11
11
{{ percentile(percentile_field='value', partition_field=columns_to_group_by, percent='0.5') }} as last_median,
12
12
{{ percentile(percentile_field='value', partition_field=columns_to_group_by, percent='0.75') }} as last_third_quartile
@@ -15,7 +15,7 @@ with median_value as (
15
15
where
16
16
time_window_end > {{- anamaly_detection_time_window_start() -}} and
17
17
time_window_end <= {{- time_window_end() -}}
18
-
{% if target.type=='postgres' %}
18
+
{% if target.typein postgres_type_db() %}
19
19
group by
20
20
{{ columns_to_group_by }}
21
21
{% endif %}
@@ -46,11 +46,11 @@ with median_value as (
46
46
column_name,
47
47
metric,
48
48
interval_length_sec,
49
-
avg(absolute_deviation_from_mean) {% if target.type!='postgres' %} over(partition by {{ columns_to_group_by }}) {% endif %} as mean_absolute_deviation,
49
+
avg(absolute_deviation_from_mean) {% if target.typenot in postgres_type_db() %} over(partition by {{ columns_to_group_by }}) {% endif %} as mean_absolute_deviation,
50
50
{{ percentile(percentile_field='absolute_deviation_from_median', partition_field=columns_to_group_by, percent='0.5') }} as median_absolute_deviation
0 commit comments