Merged PR 4439: First version of int_ytd_mtd_main_metrics_overview

# Description

New model for the purpose of Main KPIs - Overview.

It computes:
* Current MTD value
* Previous Month EOM value
* Previous Year MTD value (12 months ago)
* Current YTD value
* Previous Year YTD value

for the metrics:
* Total Revenue
* Revenue Retained Post-Resolutions
* Guest Revenue
* Invoiced Operator Revenue
* Invoiced APIs Revenue
* Host Resolutions Amount Paid
* Damage Host Waiver Payments
* Billable Bookings
* New Deals
* Churning Deals
* Live Deals (dedicated logic handling)
* Waiver Revenue

Additionally it properly computes the following derived metrics:
* Waiver Payout Rate
* Resolutions Payout Rate
* Operator Revenue per Billable Booking
* Waiver Revenue per Billable Booking

Only for dimension = 'global', though should be easy to extend to other dimensions.

This does not handle (yet) Onboarding MRR nor Revenue Churn Rate, mostly because I need to think how this can be properly attributed in a YTD basis.
This does not compute variations (abs. diff. or rel. diff.) yet.
This does not handle the "hiding" of invoicing metrics due to the invoicing cycle yet.
This does not handle targets... yet!

# 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: #27609
This commit is contained in:
Oriol Roqué Paniagua 2025-02-18 14:30:12 +00:00
parent 6e26a2a761
commit 073620bd3d
2 changed files with 674 additions and 0 deletions

View file

@ -1806,3 +1806,368 @@ models:
Total expected Onboarding MRR.
This is calculated by multiplying the expected MRR per deal by the number of new deals.
For the "global" dimension, it is the sum of all expected MRRs across segments.
- name: int_ytd_mtd_main_metrics_overview
description: |
This model provides a high-level overview of the main metrics for the month-to-date
and financial year-to-date periods.
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 and year-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
- name: dimension_value
data_type: string
description: The value or segment available for the selected dimension.
data_tests:
- not_null
- name: calendar_year
data_type: integer
description: The calendar year associated with the data.
- name: financial_year
data_type: integer
description: The financial year associated with the data.
- name: previous_year_date
data_type: date
description: The equivalent date in the previous year.
- name: current_month_mtd_billable_bookings
data_type: integer
description: Total billable bookings for the current month MTD.
- name: current_month_mtd_churning_deals
data_type: integer
description: Number of churning deals for the current month MTD.
- name: current_month_mtd_live_deals
data_type: integer
description: Number of live deals for the current month MTD.
- name: current_month_mtd_new_deals
data_type: integer
description: Number of new deals for the current month MTD.
- name: current_month_mtd_operator_revenue_per_billable_booking
data_type: numeric
description: Operator revenue per billable booking for the current month MTD.
- name: current_month_mtd_resolutions_payout_rate
data_type: numeric
description: Resolutions payout rate for the current month MTD.
- name: current_month_mtd_revenue_retained_post_resolutions_in_gbp
data_type: numeric
description: Revenue retained after resolutions for the current month MTD in GBP.
- name: current_month_mtd_total_guest_payments_in_gbp
data_type: numeric
description: Total guest payments for the current month MTD in GBP.
- name: current_month_mtd_total_revenue_in_gbp
data_type: numeric
description: Total revenue for the current month MTD in GBP.
- name: current_month_mtd_waiver_payments_in_gbp
data_type: numeric
description: Total waiver payments made in GBP for the current month MTD.
- name: current_month_mtd_waiver_payout_rate
data_type: numeric
description: Waiver payout rate for the current month MTD.
- name: current_month_mtd_waiver_revenue_per_billable_booking
data_type: numeric
description: Waiver revenue per billable booking for the current month MTD.
- name: current_month_mtd_xero_apis_net_fees_in_gbp
data_type: numeric
description: Net fees for APIs processed through Xero for the current month MTD in GBP.
- name: current_month_mtd_xero_host_resolution_amount_paid_in_gbp
data_type: numeric
description: Amount paid to hosts for resolutions processed through Xero for the current month MTD in GBP.
- name: current_month_mtd_xero_operator_net_fees_in_gbp
data_type: numeric
description: Net fees for operators processed through Xero for the current month MTD in GBP.
- name: current_month_mtd_xero_waiver_paid_back_to_host_in_gbp
data_type: numeric
description: Waiver amounts paid back to hosts via Xero for the current month MTD in GBP.
- name: previous_year_mtd_billable_bookings
data_type: integer
description: Total billable bookings for the previous year (12 months ago) MTD.
- name: previous_year_mtd_churning_deals
data_type: integer
description: Number of churning deals for the previous year (12 months ago) MTD.
- name: previous_year_mtd_live_deals
data_type: integer
description: Number of live deals for the previous year (12 months ago) MTD.
- name: previous_year_mtd_new_deals
data_type: integer
description: Number of new deals for the previous year (12 months ago) MTD.
- name: previous_year_mtd_operator_revenue_per_billable_booking
data_type: numeric
description: Operator revenue per billable booking for the previous year (12 months ago) MTD.
- name: previous_year_mtd_resolutions_payout_rate
data_type: numeric
description: Resolutions payout rate for the previous year (12 months ago) MTD.
- name: previous_year_mtd_revenue_retained_post_resolutions_in_gbp
data_type: numeric
description: Revenue retained after resolutions for the previous year (12 months ago) MTD in GBP.
- name: previous_year_mtd_total_guest_payments_in_gbp
data_type: numeric
description: Total guest payments for the previous year (12 months ago) MTD in GBP.
- name: previous_year_mtd_total_revenue_in_gbp
data_type: numeric
description: Total revenue for the previous year (12 months ago) MTD in GBP.
- name: previous_year_mtd_waiver_payments_in_gbp
data_type: numeric
description: Total waiver payments made in GBP for the previous year (12 months ago) MTD.
- name: previous_year_mtd_waiver_payout_rate
data_type: numeric
description: Waiver payout rate for the previous year (12 months ago) MTD.
- name: previous_year_mtd_waiver_revenue_per_billable_booking
data_type: numeric
description: Waiver revenue per billable booking for the previous year (12 months ago) MTD.
- name: previous_year_mtd_xero_apis_net_fees_in_gbp
data_type: numeric
description: Net fees for APIs processed through Xero for the previous year (12 months ago) MTD in GBP.
- name: previous_year_mtd_xero_host_resolution_amount_paid_in_gbp
data_type: numeric
description: Amount paid to hosts for resolutions processed through Xero for the previous year (12 months ago) MTD in GBP.
- name: previous_year_mtd_xero_operator_net_fees_in_gbp
data_type: numeric
description: Net fees for operators processed through Xero for the previous year (12 months ago) MTD in GBP.
- name: previous_year_mtd_xero_waiver_paid_back_to_host_in_gbp
data_type: numeric
description: Waiver amounts paid back to hosts via Xero for the previous year (12 months ago) MTD in GBP.
- name: current_ytd_billable_bookings
data_type: integer
description: Total billable bookings for the current financial year YTD.
- name: current_ytd_churning_deals
data_type: integer
description: Number of churning deals for the current financial year YTD.
- name: current_ytd_live_deals
data_type: integer
description: Number of live deals for the current financial year YTD.
- name: current_ytd_new_deals
data_type: integer
description: Number of new deals for the current financial year YTD.
- name: current_ytd_operator_revenue_per_billable_booking
data_type: numeric
description: Operator revenue per billable booking for the current financial year YTD.
- name: current_ytd_resolutions_payout_rate
data_type: numeric
description: Resolutions payout rate for the current financial year YTD.
- name: current_ytd_revenue_retained_post_resolutions_in_gbp
data_type: numeric
description: Revenue retained after resolutions for the current financial year YTD in GBP.
- name: current_ytd_total_guest_payments_in_gbp
data_type: numeric
description: Total guest payments for the current financial year YTD in GBP.
- name: current_ytd_total_revenue_in_gbp
data_type: numeric
description: Total revenue for the current financial year YTD in GBP.
- name: current_ytd_waiver_payments_in_gbp
data_type: numeric
description: Total waiver payments made in GBP for the current financial year YTD.
- name: current_ytd_waiver_payout_rate
data_type: numeric
description: Waiver payout rate for the current financial year YTD.
- name: current_ytd_waiver_revenue_per_billable_booking
data_type: numeric
description: Waiver revenue per billable booking for the current financial year YTD.
- name: current_ytd_xero_apis_net_fees_in_gbp
data_type: numeric
description: Net fees for APIs processed through Xero for the current financial year YTD in GBP.
- name: current_ytd_xero_host_resolution_amount_paid_in_gbp
data_type: numeric
description: Amount paid to hosts for resolutions processed through Xero for the current financial year YTD in GBP.
- name: current_ytd_xero_operator_net_fees_in_gbp
data_type: numeric
description: Net fees for operators processed through Xero for the current financial year YTD in GBP.
- name: current_ytd_xero_waiver_paid_back_to_host_in_gbp
data_type: numeric
description: Waiver amounts paid back to hosts via Xero for the current financial year YTD in GBP.
- name: previous_ytd_billable_bookings
data_type: integer
description: Total billable bookings for the previous financial year YTD.
- name: previous_ytd_churning_deals
data_type: integer
description: Number of churning deals for the previous financial year YTD.
- name: previous_ytd_live_deals
data_type: integer
description: Number of live deals for the previous financial year YTD.
- name: previous_ytd_new_deals
data_type: integer
description: Number of new deals for the previous financial year YTD.
- name: previous_ytd_operator_revenue_per_billable_booking
data_type: numeric
description: Operator revenue per billable booking for the previous financial year YTD.
- name: previous_ytd_resolutions_payout_rate
data_type: numeric
description: Resolutions payout rate for the previous financial year YTD.
- name: previous_ytd_revenue_retained_post_resolutions_in_gbp
data_type: numeric
description: Revenue retained after resolutions for the previous financial year YTD in GBP.
- name: previous_ytd_total_guest_payments_in_gbp
data_type: numeric
description: Total guest payments for the previous financial year YTD in GBP.
- name: previous_ytd_total_revenue_in_gbp
data_type: numeric
description: Total revenue for the previous financial year YTD in GBP.
- name: previous_ytd_waiver_payments_in_gbp
data_type: numeric
description: Total waiver payments made in GBP for the previous financial year YTD.
- name: previous_ytd_waiver_payout_rate
data_type: numeric
description: Waiver payout rate for the previous financial year YTD.
- name: previous_ytd_waiver_revenue_per_billable_booking
data_type: numeric
description: Waiver revenue per billable booking for the previous financial year YTD.
- name: previous_ytd_xero_apis_net_fees_in_gbp
data_type: numeric
description: Net fees for APIs processed through Xero for the previous financial year YTD in GBP.
- name: previous_ytd_xero_host_resolution_amount_paid_in_gbp
data_type: numeric
description: Amount paid to hosts for resolutions processed through Xero for the previous financial year YTD in GBP.
- name: previous_ytd_xero_operator_net_fees_in_gbp
data_type: numeric
description: Net fees for operators processed through Xero for the previous financial year YTD in GBP.
- name: previous_ytd_xero_waiver_paid_back_to_host_in_gbp
data_type: numeric
description: Waiver amounts paid back to hosts via Xero for the previous financial year YTD in GBP.
- name: previous_month_eom_billable_bookings
data_type: integer
description: Total billable bookings for the previous month, at the end of the month.
- name: previous_month_eom_churning_deals
data_type: integer
description: Number of churning deals for the previous month, at the end of the month.
- name: previous_month_eom_live_deals
data_type: integer
description: Number of live deals for the previous month, at the end of the month.
- name: previous_month_eom_new_deals
data_type: integer
description: Number of new deals for the previous month, at the end of the month.
- name: previous_month_eom_operator_revenue_per_billable_booking
data_type: numeric
description: Operator revenue per billable booking for the previous month, at the end of the month.
- name: previous_month_eom_resolutions_payout_rate
data_type: numeric
description: Resolutions payout rate for the previous month, at the end of the month.
- name: previous_month_eom_revenue_retained_post_resolutions_in_gbp
data_type: numeric
description: Revenue retained after resolutions for the previous month, at the end of the month in GBP.
- name: previous_month_eom_total_guest_payments_in_gbp
data_type: numeric
description: Total guest payments for the previous month, at the end of the month in GBP.
- name: previous_month_eom_total_revenue_in_gbp
data_type: numeric
description: Total revenue for the previous month, at the end of the month in GBP.
- name: previous_month_eom_waiver_payments_in_gbp
data_type: numeric
description: Total waiver payments made in GBP for the previous month, at the end of the month.
- name: previous_month_eom_waiver_payout_rate
data_type: numeric
description: Waiver payout rate for the previous month, at the end of the month.
- name: previous_month_eom_waiver_revenue_per_billable_booking
data_type: numeric
description: Waiver revenue per billable booking for the previous month, at the end of the month.
- name: previous_month_eom_xero_apis_net_fees_in_gbp
data_type: numeric
description: Net fees for APIs processed through Xero for the previous month, at the end of the month in GBP.
- name: previous_month_eom_xero_host_resolution_amount_paid_in_gbp
data_type: numeric
description: Amount paid to hosts for resolutions processed through Xero for the previous month, at the end of the month in GBP.
- name: previous_month_eom_xero_operator_net_fees_in_gbp
data_type: numeric
description: Net fees for operators processed through Xero for the previous month, at the end of the month in GBP.
- name: previous_month_eom_xero_waiver_paid_back_to_host_in_gbp
data_type: numeric
description: Waiver amounts paid back to hosts via Xero for the previous month, at the end of the month in GBP.