Merged PR 5322: First version of Stay Disrupt conversion funnel

# Description

First version of Stay Disrupt conversion funnel. It's a simple monthly compute of:
Active accounts -> Accounts that offered SD in GJ started in month -> Accounts that have had payments paid of SD in month
Total Guest Journeys Started -> GJ that offered SD in month-> Payments paid of SD in month

Some details:
* It also includes CIH, and data starts on 1st Jan 2025. This is to create report. This needs to be changed once the report is created.
* Note that Accounts that offered SD in GJ started in month and GJ that offered SD in month is equal to 0 as no data flows through the new flow. The rest has data.
* I consider all users, not only New Dash, knowing that I don't know if someone knows which users will have a certain Guest Product enabled.

Model is "agnostic" to the GP if we want, though the name still aims to be only for SD.

# 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. **View to start with**

# Other

- [ ] Check if a full-refresh is required after this PR is merged.

Related work items: #30277
This commit is contained in:
Oriol Roqué Paniagua 2025-05-27 09:41:49 +00:00
parent 42af06c4dd
commit 06a4f679ea
2 changed files with 290 additions and 0 deletions

View file

@ -3277,3 +3277,129 @@ models:
teams to act upon, although it's also possible that the account
has added new services that where not expressed as interest
during onboarding.
- name: int_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