diff --git a/models/intermediate/cross/int_mtd_aggregated_metrics.sql b/models/intermediate/cross/int_mtd_aggregated_metrics.sql index ef2c9f4..cc43eea 100644 --- a/models/intermediate/cross/int_mtd_aggregated_metrics.sql +++ b/models/intermediate/cross/int_mtd_aggregated_metrics.sql @@ -278,6 +278,15 @@ "number_format": "currency_gbp", "increment_sign_format": "positive", }, + { + "order_by": 203, + "metric": "Expected MRR", + "value": "expected_mrr", + "previous_year_value": "previous_year_expected_mrr", + "relative_increment": "relative_increment_expected_mrr", + "number_format": "currency_gbp", + "increment_sign_format": "positive", + }, { "order_by": 211, "metric": "Total Revenue per Booking Created", 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 6456a1f..c8e434f 100644 --- a/models/intermediate/cross/int_mtd_vs_previous_year_metrics.sql +++ b/models/intermediate/cross/int_mtd_vs_previous_year_metrics.sql @@ -171,6 +171,33 @@ with dimension in ('global', 'by_number_of_listings', 'by_billing_country') and dimension_value <> 'UNSET' ), + int_monthly_onboarding_mrr_metrics as ( + select + date, + 'by_number_of_listings' as dimension, + hubspot_listing_segmentation as dimension_value, + expected_mrr + from {{ ref("int_monthly_onboarding_mrr_metrics") }} + where + main_billing_country_iso_3 = 'global' + and hubspot_listing_segmentation <> 'global' + union all + select + date, + 'by_billing_country' as dimension, + main_billing_country_iso_3 as dimension_value, + expected_mrr + from {{ ref("int_monthly_onboarding_mrr_metrics") }} + where + hubspot_listing_segmentation = 'global' + and main_billing_country_iso_3 <> 'global' + union all + select date, 'global' as dimension, 'global' as dimension_value, expected_mrr + from {{ ref("int_monthly_onboarding_mrr_metrics") }} + where + hubspot_listing_segmentation = 'global' + and main_billing_country_iso_3 = 'global' + ), plain_kpi_combination as ( @@ -330,7 +357,10 @@ with + coalesce(invoiced_revenue.xero_waiver_paid_back_to_host_in_gbp, 0) + coalesce(host_resolutions.xero_host_resolution_amount_paid_in_gbp, 0), 0 - ) as revenue_retained_post_resolutions_in_gbp + ) as revenue_retained_post_resolutions_in_gbp, + + -- ONBOARDING MRR METRIC -- + onboarding_mrr.expected_mrr as expected_mrr from int_kpis__agg_dates_main_kpis d left join @@ -403,6 +433,11 @@ with on d.date = churn.date and d.dimension = churn.dimension and d.dimension_value = churn.dimension_value + left join + int_monthly_onboarding_mrr_metrics onboarding_mrr + on d.date = onboarding_mrr.date + and d.dimension = onboarding_mrr.dimension + and d.dimension_value = onboarding_mrr.dimension_value ) select current.year, @@ -518,7 +553,10 @@ select {{ calculate_safe_relative_increment("revenue_retained_in_gbp") }}, -- INCOME RETAINED POST RESOLUTIONS-- - {{ calculate_safe_relative_increment("revenue_retained_post_resolutions_in_gbp") }} + {{ calculate_safe_relative_increment("revenue_retained_post_resolutions_in_gbp") }}, + + -- ONBOARDING MRR METRIC -- + {{ calculate_safe_relative_increment("expected_mrr") }} from plain_kpi_combination current left join diff --git a/models/reporting/general/mtd_aggregated_metrics.sql b/models/reporting/general/mtd_aggregated_metrics.sql index 16dbb6f..bdfad23 100644 --- a/models/reporting/general/mtd_aggregated_metrics.sql +++ b/models/reporting/general/mtd_aggregated_metrics.sql @@ -68,6 +68,7 @@ where or lower(metric) like '%resolutions%' or lower(metric) like '%invoiced%' or lower(metric) like '%retained%' + or lower(metric) like '%expected mrr%' or lower(metric) like '%damage host%' ) and {{ is_date_before_previous_month("date") }} @@ -79,6 +80,7 @@ where or lower(metric) like '%resolutions%' or lower(metric) like '%invoiced%' or lower(metric) like '%retained%' + or lower(metric) like '%expected mrr%' or lower(metric) like '%damage host%' ) )