data-dwh-dbt-project/models/intermediate
Oriol Roqué Paniagua f6d25f681f Merged PR 4907: KPIs Refactor Stage 2 - Decouple AM - Churn/Account Margin
# Description

Decouples Churn/Account Margin model of `int_monthly_aggregated_metrics_history_by_deal_by_time_window` from the model `int_monthly_aggregated_metrics_history_by_deal`.

Changes:
* Removes dependency and reads from KPIs models.
* Removes unused deal stage variable
* Jinja template for time windows with dynamic selection to DRY

This has been tested with dbt audit tools and the md5 for pure refactoring, so output is exactly the same.

# 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: #28947
2025-04-03 13:00:04 +00:00
..
athena Update athena models to remove id_accommodation 2025-02-24 15:21:44 +01:00
check_in_hero adding id_deal to api models 2025-03-19 09:23:23 +01:00
core Adding total_listings_with_active_product_bundle_with_paid_service 2025-04-01 15:37:41 +02:00
cross Merged PR 4907: KPIs Refactor Stage 2 - Decouple AM - Churn/Account Margin 2025-04-03 13:00:04 +00:00
edeposit Addressed comments 2025-03-19 12:06:05 +01:00
hubspot Merged PR 4782: Dashboard, Pricing and Services from Hubspot 2025-03-24 11:20:03 +00:00
kpis Changed loop 2025-04-02 12:55:04 +02:00
resolutions Calculator changes 2025-02-28 12:19:24 +01:00
screen_and_protect adding id_deal to api models 2025-03-19 09:23:23 +01:00
xero Merged PR 4734: Bugfix - Ensures accounts cannot be duplicated in Xero sales monthly trends 2025-03-19 08:19:20 +00:00