MRR change

This commit is contained in:
Joaquin Ossa 2025-01-30 15:15:34 +01:00
parent a208541e04
commit 142b5a526f
3 changed files with 13 additions and 6 deletions

View file

@ -20,7 +20,7 @@ with
)
-- Calculate expected MRR per deal by each dimension
select
m.date,
(date_trunc('month', m.date) + interval '2 month' - interval '1 day')::date as date,
'by_number_of_listings' as dimension,
d.hubspot_listing_segmentation as dimension_value,
sum(coalesce(m.total_revenue_in_gbp, 0)) / count(*) as expected_mrr_per_deal
@ -36,7 +36,7 @@ where d.hubspot_listing_segmentation <> 'UNSET'
group by 1, 2, 3
union all
select
m.date,
(date_trunc('month', m.date) + interval '2 month' - interval '1 day')::date as date,
'by_billing_country' as dimension,
d.main_billing_country_iso_3_per_deal as dimension_value,
sum(coalesce(m.total_revenue_in_gbp, 0)) / count(*) as expected_mrr_per_deal
@ -52,7 +52,7 @@ where d.hubspot_listing_segmentation <> 'UNSET'
group by 1, 2, 3
union all
select
m.date,
(date_trunc('month', m.date) + interval '2 month' - interval '1 day')::date as date,
'global' as dimension,
'global' as dimension_value,
sum(coalesce(m.total_revenue_in_gbp, 0)) / count(*) as expected_mrr_per_deal