From 4b9babf6b4c22b770f8beccf92b715d9bc4ebbd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oriol=20Roqu=C3=A9=20Paniagua?= Date: Fri, 4 Apr 2025 14:49:43 +0000 Subject: [PATCH] Merged PR 4928: KPIs Refactor Stage 3 - Expose Churn from KPIs # Description Small but important change. Churn metrics will be propagated in production by sourcing intermediate/kpis rather than the cross models. # 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. - [X] I have checked for DRY opportunities with other models and docs. - [X] 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: #28948 --- .../cross/int_mtd_vs_previous_year_metrics.sql | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/models/intermediate/cross/int_mtd_vs_previous_year_metrics.sql b/models/intermediate/cross/int_mtd_vs_previous_year_metrics.sql index 95a93b1..51e6ada 100644 --- a/models/intermediate/cross/int_mtd_vs_previous_year_metrics.sql +++ b/models/intermediate/cross/int_mtd_vs_previous_year_metrics.sql @@ -163,7 +163,10 @@ with dimension in ('global', 'by_number_of_listings', 'by_billing_country', 'by_business_scope') and dimension_value <> 'UNSET' ), - int_monthly_churn_metrics as (select * from {{ ref("int_monthly_churn_metrics") }}), + int_kpis__agg_monthly_churn_contribution as ( + select * + from {{ ref("int_kpis__agg_monthly_churn_contribution") }} + ), int_kpis__agg_dates_main_kpis as ( select * from {{ ref("int_kpis__agg_dates_main_kpis") }} @@ -423,7 +426,7 @@ with and d.dimension = host_resolutions.dimension and d.dimension_value = host_resolutions.dimension_value left join - int_monthly_churn_metrics churn + int_kpis__agg_monthly_churn_contribution churn on d.date = churn.date and d.dimension = churn.dimension and d.dimension_value = churn.dimension_value