diff --git a/models/intermediate/cross/int_monthly_churned_deals.sql b/models/intermediate/cross/int_monthly_churned_deals.sql index f4dc73f..42379f4 100644 --- a/models/intermediate/cross/int_monthly_churned_deals.sql +++ b/models/intermediate/cross/int_monthly_churned_deals.sql @@ -11,6 +11,8 @@ with int_core__accommodation as (select * from {{ ref("int_core__accommodation") }}) select d.id_deal, + extract(year from d.cancellation_date_utc) as cancellation_year, + extract(month from d.cancellation_date_utc) as cancellation_month, d.cancellation_date_utc, d.live_date_utc, case @@ -105,4 +107,4 @@ inner join int_core__user_host uh on d.id_deal = uh.id_deal and uh.is_test_account = false left join int_core__accommodation a on uh.id_user_host = a.id_user_host where d.cancellation_date_utc is not null -group by 1, 2, 3, 4, 5, 6, 7, 8, 9 +group by 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 diff --git a/models/intermediate/cross/schema.yml b/models/intermediate/cross/schema.yml index b34163b..b79fd55 100644 --- a/models/intermediate/cross/schema.yml +++ b/models/intermediate/cross/schema.yml @@ -2762,6 +2762,20 @@ models: data_tests: - not_null + - name: cancellation_year + data_type: integer + description: "Year when the deal was offboarded according to + Hubspot." + data_tests: + - not_null + + - name: cancellation_month + data_type: integer + description: "Month when the deal was offboarded according to + Hubspot." + data_tests: + - not_null + - name: cancellation_date_utc data_type: date description: "Date when the deal was offboarded according to