From a9a1e686246d6b34d2177b9ffebce923e305d6ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oriol=20Roqu=C3=A9=20Paniagua?= Date: Thu, 29 May 2025 14:57:07 +0000 Subject: [PATCH] Merged PR 5333: Reporting version of Stay Disrupt Conversion Funnel # Description Reporting version of Stay Disrupt Conversion Funnel. It's just a copy from the intermediate model. # 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: #30277 --- models/reporting/general/schema.yml | 126 ++++++++++++++++++ .../stay_disrupt_conversion_funnel.sql | 16 +++ 2 files changed, 142 insertions(+) create mode 100644 models/reporting/general/stay_disrupt_conversion_funnel.sql diff --git a/models/reporting/general/schema.yml b/models/reporting/general/schema.yml index 0b9eb65..1f88eba 100644 --- a/models/reporting/general/schema.yml +++ b/models/reporting/general/schema.yml @@ -2388,3 +2388,129 @@ models: during onboarding. data_tests: - not_null + + - name: stay_disrupt_conversion_funnel + description: | + This model tracks the conversion funnel of the Stay Disrupt product. + Data is aggregated in a monthly basis, up to yesterday. + There's 2 funnels tracked: + - At Account level + - At Guest Journey level + + data_tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - month_start_date + - guest_product_name + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - month_start_date + - guest_product_latest_display_name + columns: + - name: month_start_date + data_type: date + description: | + Start date of the month for which the funnel is computed. + Corresponds to the first day of the month. + data_tests: + - not_null + + - name: guest_product_name + data_type: string + description: | + Internal name of the guest product, ex: STAYDISRUPT. Use this for filtering. + It cannot be null. + data_tests: + - not_null + + - name: guest_product_latest_display_name + data_type: string + description: | + Latest display name of the guest product. This is the name that + should be used for display purposes, ex: Confident Stay. + data_tests: + - not_null + + - name: count_active_accounts + data_type: integer + description: | + Count of accounts that have been active in the month. It doesn't + necessarily mean that these offer the guest product. + data_tests: + - not_null + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + strictly: true + + - name: count_active_accounts_with_guest_product_offered + data_type: integer + description: | + Count of accounts that have been active in the month and that offered + the guest product via Guest Journey that month. + data_tests: + - not_null + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + max_value: count_active_accounts + strictly: false + + - name: count_active_accounts_with_guest_product_payments + data_type: integer + description: | + Count of accounts that have been active in the month and that had at + least one payment for the guest product via Guest Journey that month. + data_tests: + - not_null + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + max_value: count_active_accounts + strictly: false + + - name: count_guest_journeys_started + data_type: integer + description: | + Count of Guest Journeys that have been started in the month. + It cannot be null. + data_tests: + - not_null + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + strictly: false + + - name: count_guest_journeys_started_with_guest_product_offered + data_type: integer + description: | + Count of Guest Journeys that have been started in the month and that + offered the guest product via Guest Journey that month. + It cannot be null. + data_tests: + - not_null + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + max_value: count_guest_journeys_started + strictly: false + + - name: count_guest_product_payments + data_type: integer + description: | + Count of Guest Journeys that have been started in the month and that + had at least one payment for the guest product via Guest Journey that month. + It cannot be null. + data_tests: + - not_null + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + max_value: count_guest_journeys_started + strictly: false + + - name: sum_amount_paid_without_taxes_in_gbp + data_type: decimal + description: | + Sum of the amount paid for the guest product via Guest Journey in GBP, + without taxes. + It cannot be null. + data_tests: + - not_null + - dbt_expectations.expect_column_values_to_be_between: + min_value: 0 + strictly: false diff --git a/models/reporting/general/stay_disrupt_conversion_funnel.sql b/models/reporting/general/stay_disrupt_conversion_funnel.sql new file mode 100644 index 0000000..216a4b2 --- /dev/null +++ b/models/reporting/general/stay_disrupt_conversion_funnel.sql @@ -0,0 +1,16 @@ +with + int_stay_disrupt_conversion_funnel as ( + select * from {{ ref("int_stay_disrupt_conversion_funnel") }} + ) +select + month_start_date, + guest_product_name, + guest_product_latest_display_name, + count_active_accounts, + count_active_accounts_with_guest_product_offered, + count_active_accounts_with_guest_product_payments, + count_guest_journeys_started, + count_guest_journeys_started_with_guest_product_offered, + count_guest_product_payments, + sum_amount_paid_without_taxes_in_gbp +from int_stay_disrupt_conversion_funnel