addressed comments

This commit is contained in:
Joaquin Ossa 2025-03-07 11:32:09 +01:00
parent 2d4cded48c
commit f8362c4a71
4 changed files with 36 additions and 10 deletions

View file

@ -593,13 +593,20 @@ select
end as days_between_last_contacted_and_churn,
d.amount_times_contacted,
d.cancellation_category,
case
when mabd.deal_lifecycle_state = '{{churned_state}}' then true else false
end as is_churning,
case
when
mabd.deal_lifecycle_state = '{{churned_state}}'
and d.cancellation_date_utc is null
then true
else false
end as is_churning_from_inactivity,
then 'INACTIVITY'
when
mabd.deal_lifecycle_state = '{{churned_state}}'
and d.cancellation_date_utc is not null
then 'ACCOUNT CANCELLATION'
else null
end as churn_reason,
-- Windowed metrics
coalesce(mabd.sum_created_bookings, 0) as created_bookings,

View file

@ -1668,11 +1668,20 @@ models:
Number of times the deal was contacted according
to Hubspot.
- name: is_churning_from_inactivity
- name: is_churning
data_type: boolean
description: |
Flag to identify if the deal is churning due to
inactivity because of lack of bookings in the past 12 months.
Flag to identify if the deal is churning or not.
- name: churn_reason
data_type: string
description: |
Reason why the deal is churning.
data_tests:
- accepted_values:
values:
- "INACTIVITY"
- "ACCOUNT CANCELLATION"
- name: created_bookings
data_type: integer