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
This commit is contained in:
Oriol Roqué Paniagua 2025-04-04 14:49:43 +00:00
parent e8a2fb1ae5
commit 4b9babf6b4

View file

@ -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