From 07038e8c18b9d7646e539f9daee6c8247b51e322 Mon Sep 17 00:00:00 2001 From: Joaquin Ossa Date: Thu, 28 Nov 2024 16:12:02 +0100 Subject: [PATCH] added service_business_type to new_dash_created_services models --- ...metric_daily_new_dash_created_services.sql | 7 ++- ...tric_monthly_new_dash_created_services.sql | 3 +- ...etric_weekly_new_dash_created_services.sql | 3 +- models/intermediate/kpis/schema.yml | 56 ++++++++++++++++++- 4 files changed, 64 insertions(+), 5 deletions(-) diff --git a/models/intermediate/kpis/int_kpis__metric_daily_new_dash_created_services.sql b/models/intermediate/kpis/int_kpis__metric_daily_new_dash_created_services.sql index 5bd16b5..7f3bf66 100644 --- a/models/intermediate/kpis/int_kpis__metric_daily_new_dash_created_services.sql +++ b/models/intermediate/kpis/int_kpis__metric_daily_new_dash_created_services.sql @@ -7,6 +7,11 @@ select -- Dimensions -- coalesce(icbs.id_deal, 'UNSET') as id_deal, case when icbsd.is_upgraded_service then 'YES' else 'NO' end as is_upgraded_service, + case + when icbsd.service_business_type = 'UNKNOWN' + then 'UNSET' + else coalesce(icbsd.service_business_type, 'UNSET') + end as service_business_type, coalesce(icbs.new_dash_version, 'UNSET') as new_dash_version, coalesce( icd.main_billing_country_iso_3_per_deal, 'UNSET' @@ -30,4 +35,4 @@ where and icbs.is_missing_id_deal = false and icbsd.service_detail_created_at_utc >= icbs.user_in_new_dash_since_timestamp_at_utc -group by 1, 2, 3, 4, 5, 6, 7, 8 +group by 1, 2, 3, 4, 5, 6, 7, 8, 9 diff --git a/models/intermediate/kpis/int_kpis__metric_monthly_new_dash_created_services.sql b/models/intermediate/kpis/int_kpis__metric_monthly_new_dash_created_services.sql index f896f6d..1b362c9 100644 --- a/models/intermediate/kpis/int_kpis__metric_monthly_new_dash_created_services.sql +++ b/models/intermediate/kpis/int_kpis__metric_monthly_new_dash_created_services.sql @@ -18,6 +18,7 @@ select cs.active_accommodations_per_deal_segmentation, cs.id_deal, -- Dimensions -- + cs.service_business_type, cs.new_dash_version, cs.is_upgraded_service, cs.main_billing_country_iso_3_per_deal, @@ -29,4 +30,4 @@ left join {{ ref("int_kpis__metric_daily_new_dash_created_services") }} cs on date_trunc('month', cs.date)::date = d.first_day_month where d.is_end_of_month = true and cs.id_deal is not null -group by 1, 2, 3, 4, 5, 6, 7, 8 +group by 1, 2, 3, 4, 5, 6, 7, 8, 9 diff --git a/models/intermediate/kpis/int_kpis__metric_weekly_new_dash_created_services.sql b/models/intermediate/kpis/int_kpis__metric_weekly_new_dash_created_services.sql index 5e660c8..3908a3d 100644 --- a/models/intermediate/kpis/int_kpis__metric_weekly_new_dash_created_services.sql +++ b/models/intermediate/kpis/int_kpis__metric_weekly_new_dash_created_services.sql @@ -18,6 +18,7 @@ select cs.active_accommodations_per_deal_segmentation, cs.id_deal, -- Dimensions -- + cs.service_business_type, cs.new_dash_version, cs.is_upgraded_service, cs.main_billing_country_iso_3_per_deal, @@ -29,4 +30,4 @@ left join {{ ref("int_kpis__metric_daily_new_dash_created_services") }} cs on date_trunc('week', cs.date)::date = d.first_day_week where d.is_end_of_week = true and cs.id_deal is not null -group by 1, 2, 3, 4, 5, 6, 7, 8 +group by 1, 2, 3, 4, 5, 6, 7, 8, 9 diff --git a/models/intermediate/kpis/schema.yml b/models/intermediate/kpis/schema.yml index 6a48911..8f8fd89 100644 --- a/models/intermediate/kpis/schema.yml +++ b/models/intermediate/kpis/schema.yml @@ -5438,6 +5438,21 @@ models: - "YES" - "NO" + - name: service_business_type + data_type: string + description: | + Identifies the service type (Screening, Deposit Management, Protection) + according to New Pricing documentation. + Cannot be null. + tests: + - not_null + - accepted_values: + values: + - "SCREENING" + - "PROTECTION" + - "DEPOSIT_MANAGEMENT" + - "UNSET" + - name: new_dash_version data_type: string description: | @@ -5488,7 +5503,8 @@ models: - end_date, - service_name, - id_deal, - - active_accommodations_per_deal_segmentation. + - active_accommodations_per_deal_segmentation, + - service_business_type. tests: - dbt_utils.unique_combination_of_columns: @@ -5497,6 +5513,7 @@ models: - service_name - id_deal - active_accommodations_per_deal_segmentation + - service_business_type columns: - name: start_date @@ -5525,6 +5542,21 @@ models: tests: - not_null + - name: service_business_type + data_type: string + description: | + Identifies the service type (Screening, Deposit Management, Protection) + according to New Pricing documentation. + Cannot be null. + tests: + - not_null + - accepted_values: + values: + - "SCREENING" + - "PROTECTION" + - "DEPOSIT_MANAGEMENT" + - "UNSET" + - name: is_upgraded_service data_type: string description: | @@ -5595,7 +5627,8 @@ models: - end_date, - service_name, - id_deal, - - active_accommodations_per_deal_segmentation. + - active_accommodations_per_deal_segmentation, + - service_business_type. tests: - dbt_utils.unique_combination_of_columns: @@ -5604,6 +5637,7 @@ models: - service_name - id_deal - active_accommodations_per_deal_segmentation + - service_business_type columns: - name: start_date @@ -5632,6 +5666,21 @@ models: tests: - not_null + - name: service_business_type + data_type: string + description: | + Identifies the service type (Screening, Deposit Management, Protection) + according to New Pricing documentation. + Cannot be null. + tests: + - not_null + - accepted_values: + values: + - "SCREENING" + - "PROTECTION" + - "DEPOSIT_MANAGEMENT" + - "UNSET" + - name: is_upgraded_service data_type: string description: | @@ -5733,6 +5782,7 @@ models: - by_new_dash_version - by_has_upgraded_service - by_service + - by_service_business_type - name: dimension_value data_type: string @@ -5797,6 +5847,7 @@ models: - by_new_dash_version - by_has_upgraded_service - by_service + - by_service_business_type - name: dimension_value data_type: string @@ -5854,6 +5905,7 @@ models: - by_new_dash_version - by_has_upgraded_service - by_service + - by_service_business_type - name: dimension_value data_type: string