Anna Vasileva
12/14/2023, 2:32 PMSamuel Garfield
12/14/2023, 10:03 PMtable_1 I'd create table_1_derived_anomaly_detection_metrics as something like
{% set list_of_columns = [list here] %}
select
date(timestamp) as dt,
{% for col in column %}
sum(case when {{col}} is not null then 1 else 0 end) as num_non_null_{{col}},
count(distinct {{col}}) as num_distinct_val_{{col}}{%if not loop.last%},{% endif %}
{% endfor%}
from {{ ref('table_1') }}
group by 1
I'd then add elementary column sum tests for each of the relevant columns in table_1_derived_anomaly_detection_metricsAnna Vasileva
12/15/2023, 2:19 PM