# Description This PR handles the computation of KPIs for New Dash, focusing on Created Services. New dimensions configured in `business_kpis_configuration` and applied in this new models for `NEW_DASH_CREATED_SERVICES`: * `dim_host`, * `dim_has_upgraded_service`, * `dim_new_dash_version`, * `dim_pricing_service` New daily metric model `int_kpis__metric_daily_new_dash_created_services` * Follows a similar pattern as for the rest of daily metric models. The only difference is that is aggregated to `id_booking` to ensure we can handle count distinct of bookings per different time granularities. * Reads from the new pricing tables `int_core__booking_summary` and `int_core__booking_service_detail`. The main filters applied are selecting only new dash users and only services created after the user move timestamp to new dash. An additional metric model at monthly level is created `int_kpis__metric_monthly_new_dash_created_services` These finally go to a dimension aggregated model (`dimension`, `dimension_value`), respectively: * Daily: `int_kpis__agg_daily_new_dash_created_services` * Monthly: `int_kpis__agg_monthly_new_dash_created_services` A final model aims to aggregate the different dimension aggregated metrics for New Dash: `int_kpis__product_new_dash_agg_metrics` * It computes a `time_granularity` aggregation * Here I will add additional metrics (such as revenue) once we have them. A final model reading from the previous is exposed to reporting: `kpis__product_new_dash_agg_metrics` # 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: #20809
270 lines
9.2 KiB
YAML
270 lines
9.2 KiB
YAML
version: 2
|
|
|
|
models:
|
|
- name: kpis__product_guest_daily_metrics
|
|
description: |
|
|
This model computes the Daily Guest Metrics at the deepest granularity.
|
|
Here all metrics are attributed to the Check-in Date of the associated
|
|
booking, except for payments which are attributed to payment date.
|
|
|
|
The unique key corresponds to the deepest granularity of the model,
|
|
in this case:
|
|
- date_day,
|
|
- py_date_day,
|
|
- id_deal,
|
|
- has_id_check.
|
|
|
|
tests:
|
|
- dbt_utils.unique_combination_of_columns:
|
|
combination_of_columns:
|
|
- date_day
|
|
- py_date_day
|
|
- has_payment
|
|
- has_id_check
|
|
columns:
|
|
- name: date_day
|
|
data_type: date
|
|
description: "Date of when Guest Journeys have been completed."
|
|
tests:
|
|
- not_null
|
|
|
|
- name: date_week
|
|
data_type: string
|
|
description: "Week number of when Guest Journeys have been completed."
|
|
tests:
|
|
- not_null
|
|
|
|
- name: py_date_day
|
|
data_type: date
|
|
description: |
|
|
Date on the previous year of when Guest Journeys have been completed.
|
|
Note that this date can be NULL for leap days (29th February)
|
|
|
|
- name: has_payment
|
|
data_type: string
|
|
description: Has there been any guest payments on the guest journey.
|
|
tests:
|
|
- not_null
|
|
- accepted_values:
|
|
values:
|
|
- W/O Payment
|
|
- With Payment
|
|
|
|
- name: has_id_check
|
|
data_type: string
|
|
description: Does the verification in the guest journey
|
|
includes Government Id Check for the bookings.
|
|
tests:
|
|
- not_null
|
|
- accepted_values:
|
|
values:
|
|
- W/O Id Check
|
|
- With Id Check
|
|
|
|
- name: created_guest_journeys_not_cancelled
|
|
data_type: bigint
|
|
description: |
|
|
Count of daily guest journeys created, excluding cancelled bookings,
|
|
in a given date and per specified dimension.
|
|
|
|
- name: started_guest_journeys_not_cancelled
|
|
data_type: bigint
|
|
description: |
|
|
Count of daily guest journeys started, excluding cancelled bookings,
|
|
in a given date and per specified dimension.
|
|
|
|
- name: completed_guest_journeys_not_cancelled
|
|
data_type: bigint
|
|
description: |
|
|
Count of daily guest journeys completed, excluding cancelled bookings,
|
|
in a given date and per specified dimension.
|
|
|
|
- name: created_guest_journeys
|
|
data_type: bigint
|
|
description: |
|
|
Count of daily guest journeys created in a given date and
|
|
per specified dimension.
|
|
|
|
- name: started_guest_journeys
|
|
data_type: bigint
|
|
description: |
|
|
Count of daily guest journeys started in a given date and
|
|
per specified dimension.
|
|
|
|
- name: completed_guest_journeys
|
|
data_type: bigint
|
|
description: |
|
|
Count of daily guest journeys completed in a given date and
|
|
per specified dimension.
|
|
|
|
- name: count_csat_score
|
|
data_type: bigint
|
|
description: |
|
|
Count of daily guest journeys with CSAT (customer satisfaction score)
|
|
in a given date and per specified dimension.
|
|
|
|
- name: average_csat_score
|
|
data_type: bigint
|
|
description: |
|
|
Average daily CSAT score in a given date and per specified dimension.
|
|
|
|
- name: deposit_fees_in_gbp
|
|
data_type: decimal
|
|
description: |
|
|
Sum of deposit fees paid by guests, without taxes, in GBP
|
|
in a given date and per specified dimension.
|
|
|
|
- name: waiver_payments_in_gbp
|
|
data_type: decimal
|
|
description: |
|
|
Sum of waiver payments paid by guests, without taxes, in GBP
|
|
in a given date and per specified dimension.
|
|
|
|
- name: checkin_cover_fees_in_gbp
|
|
data_type: decimal
|
|
description: |
|
|
Sum of checkin cover fees paid by guests, without taxes, in GBP
|
|
in a given date and per specified dimension.
|
|
|
|
- name: total_guest_payments_in_gbp
|
|
data_type: decimal
|
|
description: |
|
|
Sum of total payments paid by guests, without taxes, in GBP
|
|
in a given date and per specified dimension.
|
|
|
|
- name: py_created_guest_journeys_not_cancelled
|
|
data_type: bigint
|
|
description: |
|
|
Count of daily guest journeys created (excluding canceled bookings)
|
|
on the same date in the previous year, segmented by the specified dimension.
|
|
|
|
- name: py_started_guest_journeys_not_cancelled
|
|
data_type: bigint
|
|
description: |
|
|
Count of daily guest journeys started (excluding canceled bookings)
|
|
on the same date in the previous year, segmented by the specified dimension.
|
|
|
|
- name: py_completed_guest_journeys_not_cancelled
|
|
data_type: bigint
|
|
description: |
|
|
Count of daily guest journeys completed (excluding canceled bookings)
|
|
on the same date in the previous year, segmented by the specified dimension.
|
|
|
|
- name: py_created_guest_journeys
|
|
data_type: bigint
|
|
description: |
|
|
Count of daily guest journeys created on the same date in the previous year,
|
|
segmented by the specified dimension.
|
|
|
|
- name: py_started_guest_journeys
|
|
data_type: bigint
|
|
description: |
|
|
Count of daily guest journeys started on the same date in the previous year,
|
|
segmented by the specified dimension.
|
|
|
|
- name: py_completed_guest_journeys
|
|
data_type: bigint
|
|
description: |
|
|
Count of daily guest journeys completed on the same date in the previous year,
|
|
segmented by the specified dimension.
|
|
|
|
- name: py_count_csat_score
|
|
data_type: bigint
|
|
description: |
|
|
Count of daily guest journeys with CSAT (customer satisfaction score)
|
|
on the same date in the previous year, segmented by the specified dimension.
|
|
|
|
- name: py_average_csat_score
|
|
data_type: bigint
|
|
description: |
|
|
Average daily CSAT score on the same date in the previous year,
|
|
segmented by the specified dimension.
|
|
|
|
- name: py_deposit_fees_in_gbp
|
|
data_type: decimal
|
|
description: |
|
|
Sum of deposit fees paid by guests, excluding taxes, in GBP
|
|
on the same date in the previous year, segmented by the specified dimension.
|
|
|
|
- name: py_waiver_payments_in_gbp
|
|
data_type: decimal
|
|
description: |
|
|
Sum of waiver payments paid by guests, excluding taxes, in GBP
|
|
on the same date in the previous year, segmented by the specified dimension.
|
|
|
|
- name: py_checkin_cover_fees_in_gbp
|
|
data_type: decimal
|
|
description: |
|
|
Sum of check-in cover fees paid by guests, excluding taxes, in GBP
|
|
on the same date in the previous year, segmented by the specified dimension.
|
|
|
|
- name: py_total_guest_payments_in_gbp
|
|
data_type: decimal
|
|
description: |
|
|
Sum of total payments paid by guests, excluding taxes, in GBP
|
|
on the same date in the previous year, segmented by the specified dimension.
|
|
|
|
- name: kpis__product_new_dash_agg_metrics
|
|
description: |
|
|
Reporting model for New Dash specific KPIs. It's an aggregated version
|
|
of time granularity, dimension, dimension value and list of metrics
|
|
with their value.
|
|
|
|
tests:
|
|
- dbt_utils.unique_combination_of_columns:
|
|
combination_of_columns:
|
|
- date
|
|
- time_granularity
|
|
- dimension
|
|
- dimension_value
|
|
|
|
columns:
|
|
- name: date
|
|
data_type: date
|
|
description: |
|
|
The end date of the time range specified in the time_granularity
|
|
for the dimension, dimension_value and metrics in this record.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: time_granularity
|
|
data_type: string
|
|
description: The time dimension.
|
|
tests:
|
|
- accepted_values:
|
|
values:
|
|
- daily
|
|
- monthly
|
|
|
|
- name: dimension
|
|
data_type: string
|
|
description: The dimension or granularity of the metrics.
|
|
tests:
|
|
- accepted_values:
|
|
values:
|
|
- global
|
|
- by_number_of_listings
|
|
- by_billing_country
|
|
- by_deal
|
|
- by_new_dash_version
|
|
- by_has_upgraded_service
|
|
- by_service
|
|
- by_host
|
|
|
|
- name: dimension_value
|
|
data_type: string
|
|
description: The value or segment available for the selected dimension.
|
|
tests:
|
|
- not_null
|
|
|
|
- name: created_services
|
|
data_type: bigint
|
|
description: The daily created services for a given date, dimension and value.
|
|
|
|
- name: booking_with_created_services_count
|
|
data_type: bigint
|
|
description: |
|
|
The daily bookings with created services for a given date, dimension and value.
|
|
This is an approximation to booking count since different services can
|
|
apply to the same booking and these do not need to be created in the same
|
|
time period. Therefore, it's not an additive metric.
|