Merged PR 4166: New KPI rates for Main KPIs
# Description New KPI rates for Main KPIs # 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. New KPI rates for Main KPIs Related work items: #26792
This commit is contained in:
commit
0df6d07c20
2 changed files with 82 additions and 3 deletions
|
|
@ -190,6 +190,33 @@
|
|||
},
|
||||
{
|
||||
"order_by": 100,
|
||||
"metric": "Revenue Retained Rate",
|
||||
"value": "revenue_retained_ratio",
|
||||
"previous_year_value": "previous_year_revenue_retained_ratio",
|
||||
"relative_increment": "relative_increment_revenue_retained_ratio",
|
||||
"number_format": "percentage",
|
||||
"increment_sign_format": "positive",
|
||||
},
|
||||
{
|
||||
"order_by": 101,
|
||||
"metric": "Revenue Retained Post-Resolutions Rate",
|
||||
"value": "revenue_retained_post_resolutions_ratio",
|
||||
"previous_year_value": "previous_year_revenue_retained_post_resolutions_ratio",
|
||||
"relative_increment": "relative_increment_revenue_retained_post_resolutions_ratio",
|
||||
"number_format": "percentage",
|
||||
"increment_sign_format": "positive",
|
||||
},
|
||||
{
|
||||
"order_by": 102,
|
||||
"metric": "Host Resolutions Payment Rate",
|
||||
"value": "host_resolution_payment_per_created_booking_ratio",
|
||||
"previous_year_value": "previous_year_host_resolution_payment_per_created_booking_ratio",
|
||||
"relative_increment": "relative_increment_host_resolution_payment_per_created_booking_ratio",
|
||||
"number_format": "percentage",
|
||||
"increment_sign_format": "negative",
|
||||
},
|
||||
{
|
||||
"order_by": 110,
|
||||
"metric": "Guest Journey Start Rate",
|
||||
"value": "start_rate_guest_journey",
|
||||
"previous_year_value": "previous_year_start_rate_guest_journey",
|
||||
|
|
@ -198,7 +225,7 @@
|
|||
"increment_sign_format": "positive",
|
||||
},
|
||||
{
|
||||
"order_by": 101,
|
||||
"order_by": 111,
|
||||
"metric": "Guest Journey Completion Rate",
|
||||
"value": "completion_rate_guest_journey",
|
||||
"previous_year_value": "previous_year_completion_rate_guest_journey",
|
||||
|
|
@ -207,7 +234,7 @@
|
|||
"increment_sign_format": "positive",
|
||||
},
|
||||
{
|
||||
"order_by": 102,
|
||||
"order_by": 112,
|
||||
"metric": "Guest Journey Incompletion Rate",
|
||||
"value": "incompletion_rate_guest_journey",
|
||||
"previous_year_value": "previous_year_incompletion_rate_guest_journey",
|
||||
|
|
@ -216,7 +243,7 @@
|
|||
"increment_sign_format": "negative",
|
||||
},
|
||||
{
|
||||
"order_by": 103,
|
||||
"order_by": 113,
|
||||
"metric": "Guest Journey Payment Rate",
|
||||
"value": "payment_rate_guest_journey",
|
||||
"previous_year_value": "previous_year_payment_rate_guest_journey",
|
||||
|
|
@ -530,6 +557,15 @@
|
|||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "negative",
|
||||
},
|
||||
{
|
||||
"order_by": 271,
|
||||
"metric": "Host Resolutions Amount Paid per Booking Created",
|
||||
"value": "host_resolution_amount_paid_per_created_booking",
|
||||
"previous_year_value": "previous_year_host_resolution_amount_paid_per_created_booking",
|
||||
"relative_increment": "relative_increment_host_resolution_amount_paid_per_created_booking",
|
||||
"number_format": "currency_gbp",
|
||||
"increment_sign_format": "negative",
|
||||
},
|
||||
] %}
|
||||
with
|
||||
int_mtd_vs_previous_year_metrics as (
|
||||
|
|
|
|||
|
|
@ -286,6 +286,12 @@ with
|
|||
-- HOST RESOLUTIONS --
|
||||
host_resolutions.xero_host_resolution_amount_paid_in_gbp,
|
||||
host_resolutions.xero_host_resolution_payment_count,
|
||||
cast(host_resolutions.xero_host_resolution_amount_paid_in_gbp as decimal)
|
||||
/ created_bookings.created_bookings
|
||||
as host_resolution_amount_paid_per_created_booking,
|
||||
cast(host_resolutions.xero_host_resolution_payment_count as decimal)
|
||||
/ created_bookings.created_bookings
|
||||
as host_resolution_payment_per_created_booking_ratio,
|
||||
|
||||
-- GUEST REVENUE AND PAYMENTS --
|
||||
guest_payments.deposit_fees_in_gbp,
|
||||
|
|
@ -358,6 +364,31 @@ with
|
|||
+ coalesce(invoiced_revenue.xero_waiver_paid_back_to_host_in_gbp, 0),
|
||||
0
|
||||
) as revenue_retained_in_gbp,
|
||||
nullif(
|
||||
coalesce(guest_payments.total_guest_payments_in_gbp, 0)
|
||||
+ coalesce(invoiced_revenue.xero_operator_net_fees_in_gbp, 0)
|
||||
+ coalesce(invoiced_revenue.xero_apis_net_fees_in_gbp, 0)
|
||||
+ coalesce(invoiced_revenue.xero_waiver_paid_back_to_host_in_gbp, 0),
|
||||
0
|
||||
) / nullif(
|
||||
coalesce(guest_payments.total_guest_payments_in_gbp, 0)
|
||||
+ coalesce(invoiced_revenue.xero_operator_net_fees_in_gbp, 0)
|
||||
+ coalesce(invoiced_revenue.xero_apis_net_fees_in_gbp, 0),
|
||||
0
|
||||
) as revenue_retained_ratio,
|
||||
nullif(
|
||||
coalesce(guest_payments.total_guest_payments_in_gbp, 0)
|
||||
+ coalesce(invoiced_revenue.xero_operator_net_fees_in_gbp, 0)
|
||||
+ coalesce(invoiced_revenue.xero_apis_net_fees_in_gbp, 0)
|
||||
+ coalesce(invoiced_revenue.xero_waiver_paid_back_to_host_in_gbp, 0)
|
||||
+ coalesce(host_resolutions.xero_host_resolution_amount_paid_in_gbp, 0),
|
||||
0
|
||||
) / nullif(
|
||||
coalesce(guest_payments.total_guest_payments_in_gbp, 0)
|
||||
+ coalesce(invoiced_revenue.xero_operator_net_fees_in_gbp, 0)
|
||||
+ coalesce(invoiced_revenue.xero_apis_net_fees_in_gbp, 0),
|
||||
0
|
||||
) as revenue_retained_post_resolutions_ratio,
|
||||
|
||||
-- INCOME RETAINED POST RESOLUTIONS--
|
||||
nullif(
|
||||
|
|
@ -526,6 +557,16 @@ select
|
|||
-- HOST RESOLUTIONS --
|
||||
{{ calculate_safe_relative_increment("xero_host_resolution_amount_paid_in_gbp") }},
|
||||
{{ calculate_safe_relative_increment("xero_host_resolution_payment_count") }},
|
||||
{{
|
||||
calculate_safe_relative_increment(
|
||||
"host_resolution_amount_paid_per_created_booking"
|
||||
)
|
||||
}},
|
||||
{{
|
||||
calculate_safe_relative_increment(
|
||||
"host_resolution_payment_per_created_booking_ratio"
|
||||
)
|
||||
}},
|
||||
|
||||
-- GUEST REVENUE --
|
||||
{{ calculate_safe_relative_increment("deposit_fees_in_gbp") }},
|
||||
|
|
@ -571,9 +612,11 @@ select
|
|||
|
||||
-- INCOME RETAINED --
|
||||
{{ calculate_safe_relative_increment("revenue_retained_in_gbp") }},
|
||||
{{ calculate_safe_relative_increment("revenue_retained_ratio") }},
|
||||
|
||||
-- INCOME RETAINED POST RESOLUTIONS--
|
||||
{{ calculate_safe_relative_increment("revenue_retained_post_resolutions_in_gbp") }},
|
||||
{{ calculate_safe_relative_increment("revenue_retained_post_resolutions_ratio") }},
|
||||
|
||||
-- ONBOARDING MRR METRIC --
|
||||
{{ calculate_safe_relative_increment("expected_mrr") }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue