From 9f7f92912f23b2b6ad6d1977a0472ec366b88519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oriol=20Roqu=C3=A9=20Paniagua?= Date: Mon, 26 May 2025 09:22:15 +0000 Subject: [PATCH] Merged PR 5311: Adds Confident Stay Revenue as a Main KPIs and Account Performance metric # Description Creates a new metric: Confident Stay Revenue. This includes: * Setting the computation in `int_mtd_vs_previous_year_metrics` * Configuring the metric behavior in `int_mtd_aggregated_metrics`. It follows the same as CIH. * Adding the metric in the completion test. I didn't add it in the outlier test in purpose as any new value would trigger the outlier since there's no history to compare against. Few notes: * I confirm it displays no value, as the product has not been launched. * Note that the inclusion of Confident Stay in Guest Revenue was already handled in the previous PR. Next steps to complete the ticket: * Add in the Data Glossary of Main KPIs the definition of Confident Stay Revenue * Add in the Data Glossary of Account Performance the definition of Confident Stay Revenue # 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. - [N/A] I have checked for DRY opportunities with other models and docs. - [N/A] 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: #30278 --- .../intermediate/cross/int_mtd_aggregated_metrics.sql | 11 +++++++++++ .../cross/int_mtd_vs_previous_year_metrics.sql | 2 ++ ..._additive_metrics_per_dimension_are_consistent.sql | 1 + 3 files changed, 14 insertions(+) diff --git a/models/intermediate/cross/int_mtd_aggregated_metrics.sql b/models/intermediate/cross/int_mtd_aggregated_metrics.sql index 4472bcf..737e064 100644 --- a/models/intermediate/cross/int_mtd_aggregated_metrics.sql +++ b/models/intermediate/cross/int_mtd_aggregated_metrics.sql @@ -780,6 +780,17 @@ "display_exclusion": "NONE", "include_in_account_reporting": true, }, + { + "order_by": 266, + "metric": "Confident Stay Revenue", + "value": "stay_disrupt_fees_in_gbp", + "previous_year_value": "previous_year_stay_disrupt_fees_in_gbp", + "relative_increment": "relative_increment_stay_disrupt_fees_in_gbp", + "number_format": "currency_gbp", + "increment_sign_format": "positive", + "display_exclusion": "NONE", + "include_in_account_reporting": true, + }, { "order_by": 270, "metric": "Host Resolutions Payouts", 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 117059f..56d554d 100644 --- a/models/intermediate/cross/int_mtd_vs_previous_year_metrics.sql +++ b/models/intermediate/cross/int_mtd_vs_previous_year_metrics.sql @@ -260,6 +260,7 @@ with 0 ) as waiver_net_fees_in_gbp, guest_payments.checkin_cover_fees_in_gbp, + guest_payments.stay_disrupt_fees_in_gbp, guest_payments.total_guest_payments_in_gbp, -- TOTAL REVENUE -- @@ -509,6 +510,7 @@ select {{ calculate_safe_relative_increment("xero_waiver_paid_back_to_host_in_gbp") }}, {{ calculate_safe_relative_increment("waiver_net_fees_in_gbp") }}, {{ calculate_safe_relative_increment("checkin_cover_fees_in_gbp") }}, + {{ calculate_safe_relative_increment("stay_disrupt_fees_in_gbp") }}, {{ calculate_safe_relative_increment("total_guest_payments_in_gbp") }}, -- TOTAL REVENUE -- diff --git a/tests/kpis_additive_metrics_per_dimension_are_consistent.sql b/tests/kpis_additive_metrics_per_dimension_are_consistent.sql index 06579d4..79ec94f 100644 --- a/tests/kpis_additive_metrics_per_dimension_are_consistent.sql +++ b/tests/kpis_additive_metrics_per_dimension_are_consistent.sql @@ -22,6 +22,7 @@ than the value reported in the Global dimension. "Check Out Bookings (Excl. Cancelled)", "Churning Deals", "Churning Listings", + "Confident Stay Revenue", "Created Bookings (Excl. Cancelled)", "Damage Waiver Payouts", "Deals Booked in 12 Months",