From e0d18acf8e64c2a9d0d1b07a2d5aec3ade82c5e8 Mon Sep 17 00:00:00 2001 From: Joaquin Date: Fri, 14 Mar 2025 10:12:54 +0100 Subject: [PATCH] Churn update --- ..._aggregated_metrics_history_by_deal_by_time_window.sql | 1 + models/intermediate/cross/schema.yml | 8 ++++++++ ..._aggregated_metrics_history_by_deal_by_time_window.sql | 1 + models/reporting/general/schema.yml | 8 ++++++++ 4 files changed, 18 insertions(+) diff --git a/models/intermediate/cross/int_monthly_aggregated_metrics_history_by_deal_by_time_window.sql b/models/intermediate/cross/int_monthly_aggregated_metrics_history_by_deal_by_time_window.sql index 0b5762e..ad0847c 100644 --- a/models/intermediate/cross/int_monthly_aggregated_metrics_history_by_deal_by_time_window.sql +++ b/models/intermediate/cross/int_monthly_aggregated_metrics_history_by_deal_by_time_window.sql @@ -593,6 +593,7 @@ select end as days_between_last_contacted_and_churn, d.amount_times_contacted, d.cancellation_category, + d.cancellation_details, case when mabd.deal_lifecycle_state = '{{churned_state}}' then true else false end as is_churning, diff --git a/models/intermediate/cross/schema.yml b/models/intermediate/cross/schema.yml index 34185c0..56e5400 100644 --- a/models/intermediate/cross/schema.yml +++ b/models/intermediate/cross/schema.yml @@ -1668,6 +1668,14 @@ models: Number of times the deal was contacted according to Hubspot. + - name: cancellation_category + data_type: text + description: Categorization as to why they cancelled the account + + - name: cancellation_details + data_type: text + description: Free text with additional comments on why they cancelled the account + - name: is_churning data_type: boolean description: | diff --git a/models/reporting/general/monthly_aggregated_metrics_history_by_deal_by_time_window.sql b/models/reporting/general/monthly_aggregated_metrics_history_by_deal_by_time_window.sql index d624010..baed7a8 100644 --- a/models/reporting/general/monthly_aggregated_metrics_history_by_deal_by_time_window.sql +++ b/models/reporting/general/monthly_aggregated_metrics_history_by_deal_by_time_window.sql @@ -28,6 +28,7 @@ select days_between_last_contacted_and_churn as days_between_last_contacted_and_churn, amount_times_contacted as amount_times_contacted, cancellation_category as cancellation_category, + cancellation_details as cancellation_details, is_churning as is_churning, churn_reason as churn_reason, created_bookings as created_bookings, diff --git a/models/reporting/general/schema.yml b/models/reporting/general/schema.yml index 2870cad..150fdef 100644 --- a/models/reporting/general/schema.yml +++ b/models/reporting/general/schema.yml @@ -1644,6 +1644,14 @@ models: Number of times the deal was contacted according to Hubspot. + - name: cancellation_category + data_type: text + description: Categorization as to why they cancelled the account + + - name: cancellation_details + data_type: text + description: Free text with additional comments on why they cancelled the account + - name: is_churning data_type: boolean description: |