Merged PR 4309: Cancelled Bookings KPIs rework

# Description

Exposes new metrics:
* Created Bookings (Excl. Cancelled)
* Cancelled Created Bookings
* Check Out Bookings (Excl. Cancelled)
* Cancelled Check Out Bookings

Re-naming of existing metrics:
* Created Bookings -> Total Created Bookings
* Checkout Bookings -> Total Check Out Bookings

Removes exposure of previous Cancelled Bookings. In the monthly by deal model, it's hardcoded still - need to change PBI to remove safely. This will be done later on once we remove the Cancelled Bookings models.

Adapts the existing tests on KPIs to accommodate for the changes by including new metrics. Also, I've set the detector to 5 (from 8) since it's been a while this has not triggered thus might be worth the effort to have more detection capabilities.

# 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: #24637
This commit is contained in:
Oriol Roqué Paniagua 2025-02-06 15:12:35 +00:00
parent cc86565b02
commit fe3a5c9fe9
6 changed files with 155 additions and 87 deletions

View file

@ -1,7 +1,25 @@
{% set metrics = [
{
"order_by": 1,
"metric": "Created Bookings",
"metric": "Created Bookings (Excl. Cancelled)",
"value": "not_cancelled_created_bookings",
"previous_year_value": "previous_year_not_cancelled_created_bookings",
"relative_increment": "relative_increment_not_cancelled_created_bookings",
"number_format": "integer",
"increment_sign_format": "positive",
},
{
"order_by": 2,
"metric": "Cancelled Created Bookings",
"value": "cancelled_created_bookings",
"previous_year_value": "previous_year_cancelled_created_bookings",
"relative_increment": "relative_increment_cancelled_created_bookings",
"number_format": "integer",
"increment_sign_format": "negative",
},
{
"order_by": 3,
"metric": "Total Created Bookings",
"value": "created_bookings",
"previous_year_value": "previous_year_created_bookings",
"relative_increment": "relative_increment_created_bookings",
@ -9,17 +27,26 @@
"increment_sign_format": "positive",
},
{
"order_by": 2,
"metric": "Cancelled Bookings",
"value": "cancelled_bookings",
"previous_year_value": "previous_year_cancelled_bookings",
"relative_increment": "relative_increment_cancelled_bookings",
"order_by": 4,
"metric": "Check Out Bookings (Excl. Cancelled)",
"value": "not_cancelled_check_out_bookings",
"previous_year_value": "previous_year_not_cancelled_check_out_bookings",
"relative_increment": "relative_increment_not_cancelled_check_out_bookings",
"number_format": "integer",
"increment_sign_format": "positive",
},
{
"order_by": 5,
"metric": "Cancelled Check Out Bookings",
"value": "cancelled_check_out_bookings",
"previous_year_value": "previous_year_cancelled_check_out_bookings",
"relative_increment": "relative_increment_cancelled_check_out_bookings",
"number_format": "integer",
"increment_sign_format": "negative",
},
{
"order_by": 3,
"metric": "Checkout Bookings",
"order_by": 6,
"metric": "Total Check Out Bookings",
"value": "check_out_bookings",
"previous_year_value": "previous_year_check_out_bookings",
"relative_increment": "relative_increment_check_out_bookings",
@ -27,7 +54,7 @@
"increment_sign_format": "positive",
},
{
"order_by": 4,
"order_by": 9,
"metric": "Est. Billable Bookings",
"value": "billable_bookings",
"previous_year_value": "previous_year_billable_bookings",
@ -208,6 +235,24 @@
},
{
"order_by": 110,
"metric": "Created Booking Cancellation Rate",
"value": "cancelled_created_bookings_rate",
"previous_year_value": "previous_year_cancelled_created_bookings_rate",
"relative_increment": "relative_increment_cancelled_created_bookings_rate",
"number_format": "percentage",
"increment_sign_format": "negative",
},
{
"order_by": 111,
"metric": "Check Out Booking Cancellation Rate",
"value": "cancelled_check_out_bookings_rate",
"previous_year_value": "previous_year_cancelled_check_out_bookings_rate",
"relative_increment": "relative_increment_cancelled_check_out_bookings_rate",
"number_format": "percentage",
"increment_sign_format": "negative",
},
{
"order_by": 120,
"metric": "Guest Journey Start Rate",
"value": "start_rate_guest_journey",
"previous_year_value": "previous_year_start_rate_guest_journey",
@ -216,7 +261,7 @@
"increment_sign_format": "positive",
},
{
"order_by": 111,
"order_by": 121,
"metric": "Guest Journey Completion Rate",
"value": "completion_rate_guest_journey",
"previous_year_value": "previous_year_completion_rate_guest_journey",
@ -225,7 +270,7 @@
"increment_sign_format": "positive",
},
{
"order_by": 112,
"order_by": 122,
"metric": "Guest Journey Incompletion Rate",
"value": "incompletion_rate_guest_journey",
"previous_year_value": "previous_year_incompletion_rate_guest_journey",
@ -234,7 +279,7 @@
"increment_sign_format": "negative",
},
{
"order_by": 113,
"order_by": 123,
"metric": "Guest Journey Payment Rate",
"value": "payment_rate_guest_journey",
"previous_year_value": "previous_year_payment_rate_guest_journey",
@ -243,7 +288,7 @@
"increment_sign_format": "positive",
},
{
"order_by": 120,
"order_by": 130,
"metric": "Revenue Churn Rate",
"value": "total_revenue_churn_average_contribution",
"previous_year_value": "previous_year_total_revenue_churn_average_contribution",
@ -252,7 +297,7 @@
"increment_sign_format": "negative",
},
{
"order_by": 121,
"order_by": 131,
"metric": "Bookings Churn Rate",
"value": "created_bookings_churn_average_contribution",
"previous_year_value": "previous_year_created_bookings_churn_average_contribution",
@ -261,7 +306,7 @@
"increment_sign_format": "negative",
},
{
"order_by": 122,
"order_by": 132,
"metric": "Listings Churn Rate",
"value": "listings_booked_in_month_churn_average_contribution",
"previous_year_value": "previous_year_listings_booked_in_month_churn_average_contribution",