Merged PR 4931: KPIs Refactor Stage 3 - Remove previous Churn models
# Description Removes the models: * int_monthly_12m_window_contribution_by_deal * int_monthly_churn_metrics as well as their entries in the schema files. Project compiles and KPIs run works. This closes stage 3 of the refactor. # Checklist - [ ] The edited models and dependants run properly with production data. - [ ] The edited models are sufficiently documented. - [ ] The edited models contain PK tests, and I've ran and passed them. - [ ] I have checked for DRY opportunities with other models and docs. - [ ] I've picked the right materialization for the affected models. # Other - [ ] Check if a full-refresh is required after this PR is merged. Remove previous Churn models Related work items: #28948
This commit is contained in:
parent
4b9babf6b4
commit
63aebf4220
3 changed files with 0 additions and 427 deletions
|
|
@ -1106,210 +1106,6 @@ models:
|
|||
- MAJOR GAIN
|
||||
- UNSET
|
||||
|
||||
- name: int_monthly_12m_window_contribution_by_deal
|
||||
deprecation_date: 2025-04-08
|
||||
description: |
|
||||
The main goal of this model is to provide how much a deal
|
||||
contributes to a given metric on the global amount over a
|
||||
period of 12 months.
|
||||
|
||||
At the moment, this is only done for 3 metrics:
|
||||
- total_revenue_in_gbp
|
||||
- created_bookings
|
||||
- listings_booked_in_month
|
||||
|
||||
The contribution is based on an Average approach:
|
||||
Over a period of 12 months, sum the value of a given a metric
|
||||
for each deal, and divide it by the amount of months we're considering
|
||||
for that deal. Sum all the average amounts per deals to get a global.
|
||||
Divide the avg per deal value vs. the sum of avgs global one.
|
||||
The average approach "boosts" the contribution of those accounts
|
||||
that have been active for less than 12 months.
|
||||
|
||||
data_tests:
|
||||
- dbt_utils.unique_combination_of_columns:
|
||||
combination_of_columns:
|
||||
- date
|
||||
- id_deal
|
||||
|
||||
columns:
|
||||
- name: date
|
||||
data_type: date
|
||||
description: |
|
||||
Date corresponding to the last day of the month.
|
||||
Metrics are inclusive to this date. Together with id_deal, it
|
||||
acts as the primary key of this model.
|
||||
data_tests:
|
||||
- not_null
|
||||
|
||||
- name: id_deal
|
||||
data_type: string
|
||||
description: |
|
||||
Unique identifier of a Deal. Together with date, it acts as
|
||||
the primary key of this model.
|
||||
data_tests:
|
||||
- not_null
|
||||
|
||||
- name: deal_lifecycle_state
|
||||
data_type: string
|
||||
description: |
|
||||
Identifier of the lifecycle state of a given deal
|
||||
in a given month.
|
||||
|
||||
- name: preceding_months_count_by_deal
|
||||
data_type: integer
|
||||
description: |
|
||||
Number of months preceding to the one given by date
|
||||
that are used for the historic metric retrieval for
|
||||
a given deal. In essence it states the amount of
|
||||
months a given deal has been active before a the month
|
||||
given by date, capped at 12 months.
|
||||
data_tests:
|
||||
- dbt_expectations.expect_column_values_to_be_between:
|
||||
min_value: 0
|
||||
max_value: 12
|
||||
strictly: false
|
||||
|
||||
- name: has_deal_been_created_less_than_12_months_ago
|
||||
data_type: boolean
|
||||
description: |
|
||||
Flag to identify if a given deal has been created less
|
||||
than 12 months ago (true) or not (false). It's based on the
|
||||
preceding_months_count_by_deal, and will be true on the first
|
||||
year of deal activity.
|
||||
|
||||
- name: total_revenue_12m_average_contribution
|
||||
data_type: numeric
|
||||
description: |
|
||||
Share of the deal contribution on total revenue
|
||||
vs. the global amount, on the preceding 12 months
|
||||
with respect to date. It uses the average approach.
|
||||
It can be negative.
|
||||
data_tests:
|
||||
- not_null
|
||||
|
||||
- name: created_bookings_12m_average_contribution
|
||||
data_type: numeric
|
||||
description: |
|
||||
Share of the deal contribution on created bookings
|
||||
vs. the global amount, on the preceding 12 months
|
||||
with respect to date. It uses the average approach.
|
||||
data_tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_between:
|
||||
min_value: 0
|
||||
max_value: 1
|
||||
strictly: false
|
||||
|
||||
- name: listings_booked_in_month_12m_average_contribution
|
||||
data_type: numeric
|
||||
description: |
|
||||
Share of the deal contribution on listings booked in month
|
||||
vs. the global amount, on the preceding 12 months
|
||||
with respect to date. It uses the average approach.
|
||||
data_tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_between:
|
||||
min_value: 0
|
||||
max_value: 1
|
||||
strictly: false
|
||||
|
||||
- name: avg_total_revenue_preceding_12_months
|
||||
data_type: numeric
|
||||
description: |
|
||||
Total revenue in GBP generated by a single deal
|
||||
in the 12 months period. This uses an average approach,
|
||||
meaning that the revenue of that deal is divided by the
|
||||
amount of months it has been active.
|
||||
|
||||
- name: avg_global_total_revenue_preceding_12_months
|
||||
data_type: numeric
|
||||
description: |
|
||||
Total revenue in GBP generated by a all deals
|
||||
in the 12 months period. This uses an average approach,
|
||||
meaning that the revenue of each deal is divided by the
|
||||
amount of months it has been active.
|
||||
|
||||
- name: int_monthly_churn_metrics
|
||||
deprecation_date: 2025-04-08
|
||||
description: |
|
||||
This model is used for global KPIs.
|
||||
|
||||
It computes the churn contribution by dimension, dimension value
|
||||
and date, in a monthly basis. This model is different from the
|
||||
usual mtd ones since it strictly depends on the monthly computation
|
||||
of metrics by deal, which is done in a monthly basis rather than mtd.
|
||||
In essence, it means we won't have data for the current month.
|
||||
|
||||
This model retrieves the 12 month contribution to global metrics
|
||||
by deal and aggregates it to dimension and dimension value for those
|
||||
deals that are tagged as '05-Churning' in that month. Thus, it provides
|
||||
a total of 3 churn related metrics, represented as ratios over the total:
|
||||
- Total Revenue (in GBP)
|
||||
- Created Bookings
|
||||
- Listings Booked in Month
|
||||
by using the Average contribution method. For further
|
||||
information, please refer to the documentation of the model:
|
||||
- int_monthly_12m_window_contribution_by_deal
|
||||
|
||||
Lastly, when checking data at any dimension distinct from Global, at the
|
||||
moment these values represent the additive contribution of churn with respect
|
||||
to the global amount. This means that, for instance, if we have 10% of churn
|
||||
in a month, it can be divided by 9% USA and 1% GBR since 9%+1% = 10%.
|
||||
|
||||
data_tests:
|
||||
- dbt_utils.unique_combination_of_columns:
|
||||
combination_of_columns:
|
||||
- date
|
||||
- dimension
|
||||
- dimension_value
|
||||
|
||||
columns:
|
||||
- name: date
|
||||
data_type: date
|
||||
description: The date for the month-to-date metrics.
|
||||
data_tests:
|
||||
- not_null
|
||||
|
||||
- name: dimension
|
||||
data_type: string
|
||||
description: The dimension or granularity of the metrics.
|
||||
data_tests:
|
||||
- accepted_values:
|
||||
values:
|
||||
- global
|
||||
- by_number_of_listings
|
||||
- by_billing_country
|
||||
|
||||
- name: dimension_value
|
||||
data_type: string
|
||||
description: The value or segment available for the selected dimension.
|
||||
data_tests:
|
||||
- not_null
|
||||
|
||||
- name: total_revenue_churn_preceding_12_months
|
||||
data_type: numeric
|
||||
description: |
|
||||
Total Revenue attributed to have churned considering the
|
||||
revenue generated by the deals in the 12 months period.
|
||||
|
||||
- name: total_revenue_global_preceding_12_months
|
||||
data_type: numeric
|
||||
description: |
|
||||
Total Revenue generated by all deals in the 12 months period.
|
||||
|
||||
- name: total_revenue_churn_average_contribution
|
||||
data_type: numeric
|
||||
description: Total Revenue churn rate (average approach).
|
||||
|
||||
- name: created_bookings_churn_average_contribution
|
||||
data_type: numeric
|
||||
description: Created Bookings churn rate (average approach).
|
||||
|
||||
- name: listings_booked_in_month_churn_average_contribution
|
||||
data_type: numeric
|
||||
description: Listings Booked in Month churn rate (average approach).
|
||||
|
||||
- name: int_edeposit_and_athena_verifications
|
||||
description:
|
||||
"This table holds records on verifications for Guesty and Edeposit bookings.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue