From b9ca7c5e8ca3b2015fd3d6334f12090d41e58b9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oriol=20Roqu=C3=A9=20Paniagua?= Date: Fri, 18 Oct 2024 08:14:24 +0000 Subject: [PATCH] Merged PR 3235: Ensure values to be treated as decimals # Description Small PR to ensure all values within the computation will be treated as decimals. I apply this at the beginning of the code for the 4 main inputs used. This avoids later integer divisions. # Checklist - [X] The edited models and dependants run properly with production data. - [X] The edited models are sufficiently documented. - [X] The edited models contain PK tests, and I've ran and passed them. - [NA] I have checked for DRY opportunities with other models and docs. - [NA] I've picked the right materialization for the affected models. # Other - [ ] Check if a full-refresh is required after this PR is merged. Related work items: #22691 --- .../cross/int_monthly_12m_window_contribution_by_deal.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/models/intermediate/cross/int_monthly_12m_window_contribution_by_deal.sql b/models/intermediate/cross/int_monthly_12m_window_contribution_by_deal.sql index 89b983d..8fde1ce 100644 --- a/models/intermediate/cross/int_monthly_12m_window_contribution_by_deal.sql +++ b/models/intermediate/cross/int_monthly_12m_window_contribution_by_deal.sql @@ -8,22 +8,22 @@ with am.date, am.id_deal, am.deal_lifecycle_state, - count(*) over ( + 1.0 * count(*) over ( partition by am.id_deal order by am.date rows between 12 preceding and 1 preceding ) as preceding_months_count_by_deal, - sum(am.total_revenue_in_gbp) over ( + 1.0 * sum(am.total_revenue_in_gbp) over ( partition by am.id_deal order by am.date rows between 12 preceding and 1 preceding ) as sum_total_revenue_preceding_12_months, - sum(am.created_bookings) over ( + 1.0 * sum(am.created_bookings) over ( partition by am.id_deal order by am.date rows between 12 preceding and 1 preceding ) as sum_created_bookings_preceding_12_months, - sum(am.listings_booked_in_month) over ( + 1.0 * sum(am.listings_booked_in_month) over ( partition by am.id_deal order by am.date rows between 12 preceding and 1 preceding