diff --git a/models/intermediate/cross/int_mtd_aggregated_metrics.sql b/models/intermediate/cross/int_mtd_aggregated_metrics.sql index d8809f0..3fbc1d4 100644 --- a/models/intermediate/cross/int_mtd_aggregated_metrics.sql +++ b/models/intermediate/cross/int_mtd_aggregated_metrics.sql @@ -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 ( diff --git a/models/intermediate/cross/int_mtd_vs_previous_year_metrics.sql b/models/intermediate/cross/int_mtd_vs_previous_year_metrics.sql index 84cc2da..bc45c22 100644 --- a/models/intermediate/cross/int_mtd_vs_previous_year_metrics.sql +++ b/models/intermediate/cross/int_mtd_vs_previous_year_metrics.sql @@ -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") }}