New expected MRR metric
This commit is contained in:
parent
6dcfe03b30
commit
39de8617b7
2 changed files with 40 additions and 3 deletions
|
|
@ -418,7 +418,11 @@ with
|
|||
}} as revenue_retained_post_resolutions_ratio,
|
||||
|
||||
-- ONBOARDING MRR METRIC --
|
||||
onboarding_mrr.expected_mrr as expected_mrr
|
||||
onboarding_mrr.expected_mrr as expected_mrr_per_account,
|
||||
case
|
||||
when d.dimension = 'by_number_of_listings' then
|
||||
onboarding_mrr.expected_mrr * deals.new_deals else null
|
||||
end as number_of_listings_expected_mrr
|
||||
|
||||
from int_kpis__agg_dates_main_kpis d
|
||||
left join
|
||||
|
|
@ -496,7 +500,30 @@ with
|
|||
on d.date = onboarding_mrr.date
|
||||
and d.dimension = onboarding_mrr.dimension
|
||||
and d.dimension_value = onboarding_mrr.dimension_value
|
||||
),
|
||||
global_expected_mrr as (
|
||||
select
|
||||
pkc.year,
|
||||
pkc.month,
|
||||
pkc.day,
|
||||
'global' as dimension,
|
||||
sum(pkc.new_deals*pkc.expected_mrr_per_account) as global_expected_mrr
|
||||
from plain_kpi_combination pkc
|
||||
where
|
||||
pkc.dimension = 'by_number_of_listings'
|
||||
group by 1, 2, 3, 4
|
||||
),
|
||||
plain_kpi_combination_with_mrr as (
|
||||
select
|
||||
pkc.*,
|
||||
coalesce(gem.global_expected_mrr, pkc.number_of_listings_expected_mrr) as expected_mrr
|
||||
from plain_kpi_combination pkc
|
||||
left join global_expected_mrr gem on pkc.year = gem.year
|
||||
and pkc.month = gem.month
|
||||
and pkc.day = gem.day
|
||||
and pkc.dimension = gem.dimension
|
||||
)
|
||||
|
||||
select
|
||||
current.year,
|
||||
current.month,
|
||||
|
|
@ -636,11 +663,12 @@ select
|
|||
{{ calculate_safe_relative_increment("revenue_retained_post_resolutions_ratio") }},
|
||||
|
||||
-- ONBOARDING MRR METRIC --
|
||||
{{ calculate_safe_relative_increment("expected_mrr_per_account") }},
|
||||
{{ calculate_safe_relative_increment("expected_mrr") }}
|
||||
|
||||
from plain_kpi_combination current
|
||||
from plain_kpi_combination_with_mrr current
|
||||
left join
|
||||
plain_kpi_combination previous_year
|
||||
plain_kpi_combination_with_mrr previous_year
|
||||
on current.dimension = previous_year.dimension
|
||||
and current.dimension_value = previous_year.dimension_value
|
||||
and current.month = previous_year.month
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue