diff --git a/models/intermediate/cross/int_billable_items_growth_score_by_deal.sql b/models/intermediate/cross/int_billable_items_growth_score_by_deal.sql index b380f89..def724e 100644 --- a/models/intermediate/cross/int_billable_items_growth_score_by_deal.sql +++ b/models/intermediate/cross/int_billable_items_growth_score_by_deal.sql @@ -45,6 +45,12 @@ with as projection_mean_absolute_percentage_error, true as are_billable_items_projected from int_kpis_projected__agg_monthly_billable_items + -- The following condition forces the exclusion of projected data on the 1st + -- day of the month to avoid duplicates: + -- On the 1st day of the month we will already have the actual Billable Items + -- of the previous month. In this case, the projected items are equal to the + -- actual, and it creates duplicates. + where current_date <> date_trunc('month', end_date + interval '1 day')::date union all select start_date,