diff --git a/models/intermediate/kpis/int_kpis__product_new_dash_agg_metrics.sql b/models/intermediate/kpis/int_kpis__product_new_dash_agg_metrics.sql index f6719e2..88b174f 100644 --- a/models/intermediate/kpis/int_kpis__product_new_dash_agg_metrics.sql +++ b/models/intermediate/kpis/int_kpis__product_new_dash_agg_metrics.sql @@ -120,10 +120,6 @@ with ) {% for time_granularity in ["daily", "weekly", "monthly"] %} - {% if time_granularity != "daily" %} - union all - {% endif %} - select d.date, '{{ time_granularity }}' as time_granularity, @@ -145,4 +141,8 @@ with {% if time_granularity == "weekly" %} where d.is_end_of_week {% elif time_granularity == "monthly" %} where d.is_end_of_month {% endif %} + + {% if not loop.last %} + union all + {% endif %} {% endfor %}