diff --git a/macros/business_kpis_configuration.sql b/macros/business_kpis_configuration.sql index 54fae35..44c1bcb 100644 --- a/macros/business_kpis_configuration.sql +++ b/macros/business_kpis_configuration.sql @@ -143,6 +143,8 @@ Provides a general assignement for the Dimensions available for each KPI "GUEST_JOURNEYS_WITH_PAYMENT", "GUEST_PAYMENTS", "STARTED_GUEST_JOURNEYS", + "INVOICED_REVENUE", + "HOST_RESOLUTIONS", ] %} {% set additional_dimensions = additional_dimensions + [dim_business_scope()] %} {% endif %} diff --git a/models/intermediate/kpis/int_kpis__metric_monthly_host_resolutions.sql b/models/intermediate/kpis/int_kpis__metric_monthly_host_resolutions.sql index d645a98..3015a40 100644 --- a/models/intermediate/kpis/int_kpis__metric_monthly_host_resolutions.sql +++ b/models/intermediate/kpis/int_kpis__metric_monthly_host_resolutions.sql @@ -4,6 +4,7 @@ unique_key=[ "end_date", "id_deal", + "business_scope", "active_accommodations_per_deal_segmentation", ], ) @@ -14,6 +15,7 @@ select d.first_day_month as start_date, d.date as end_date, hr.id_deal, + hr.business_scope, hr.active_accommodations_per_deal_segmentation, -- Dimensions -- hr.main_billing_country_iso_3_per_deal, @@ -27,4 +29,4 @@ left join {{ ref("int_kpis__metric_daily_host_resolutions") }} hr on date_trunc('month', hr.date)::date = d.first_day_month where d.is_end_of_month = true and hr.id_deal is not null -group by 1, 2, 3, 4, 5 +group by 1, 2, 3, 4, 5, 6 diff --git a/models/intermediate/kpis/int_kpis__metric_monthly_invoiced_revenue.sql b/models/intermediate/kpis/int_kpis__metric_monthly_invoiced_revenue.sql index 5ac0797..868f1aa 100644 --- a/models/intermediate/kpis/int_kpis__metric_monthly_invoiced_revenue.sql +++ b/models/intermediate/kpis/int_kpis__metric_monthly_invoiced_revenue.sql @@ -4,6 +4,7 @@ unique_key=[ "end_date", "id_deal", + "business_scope", "active_accommodations_per_deal_segmentation", ], ) @@ -14,6 +15,7 @@ select d.first_day_month as start_date, d.date as end_date, ir.id_deal, + ir.business_scope, ir.active_accommodations_per_deal_segmentation, -- Dimensions -- ir.main_billing_country_iso_3_per_deal, @@ -56,4 +58,4 @@ left join {{ ref("int_kpis__metric_daily_invoiced_revenue") }} ir on date_trunc('month', ir.date)::date = d.first_day_month where d.is_end_of_month = true and ir.id_deal is not null -group by 1, 2, 3, 4, 5 +group by 1, 2, 3, 4, 5, 6 diff --git a/models/intermediate/kpis/int_kpis__metric_mtd_host_resolutions.sql b/models/intermediate/kpis/int_kpis__metric_mtd_host_resolutions.sql index 8f1a2e3..c818ea0 100644 --- a/models/intermediate/kpis/int_kpis__metric_mtd_host_resolutions.sql +++ b/models/intermediate/kpis/int_kpis__metric_mtd_host_resolutions.sql @@ -4,6 +4,7 @@ unique_key=[ "end_date", "id_deal", + "business_scope", "active_accommodations_per_deal_segmentation", ], ) @@ -14,6 +15,7 @@ select d.first_day_month as start_date, d.date as end_date, hr.id_deal, + hr.business_scope, hr.active_accommodations_per_deal_segmentation, -- Dimensions -- hr.main_billing_country_iso_3_per_deal, @@ -28,4 +30,4 @@ left join on date_trunc('month', hr.date)::date = d.first_day_month and extract(day from hr.date) <= d.day where d.is_month_to_date = true and hr.id_deal is not null -group by 1, 2, 3, 4, 5 +group by 1, 2, 3, 4, 5, 6 diff --git a/models/intermediate/kpis/int_kpis__metric_mtd_invoiced_revenue.sql b/models/intermediate/kpis/int_kpis__metric_mtd_invoiced_revenue.sql index a4666bf..bb8e5db 100644 --- a/models/intermediate/kpis/int_kpis__metric_mtd_invoiced_revenue.sql +++ b/models/intermediate/kpis/int_kpis__metric_mtd_invoiced_revenue.sql @@ -4,6 +4,7 @@ unique_key=[ "end_date", "id_deal", + "business_scope", "active_accommodations_per_deal_segmentation", ], ) @@ -14,6 +15,7 @@ select d.first_day_month as start_date, d.date as end_date, ir.id_deal, + ir.business_scope, ir.active_accommodations_per_deal_segmentation, -- Dimensions -- ir.main_billing_country_iso_3_per_deal, @@ -57,4 +59,4 @@ left join on date_trunc('month', ir.date)::date = d.first_day_month and extract(day from ir.date) <= d.day where d.is_month_to_date = true and ir.id_deal is not null -group by 1, 2, 3, 4, 5 +group by 1, 2, 3, 4, 5, 6 diff --git a/models/intermediate/kpis/schema.yml b/models/intermediate/kpis/schema.yml index 358db28..2fa8007 100644 --- a/models/intermediate/kpis/schema.yml +++ b/models/intermediate/kpis/schema.yml @@ -3814,6 +3814,7 @@ models: The unique key corresponds to: - end_date, - id_deal, + - business_scope, - active_accommodations_per_deal_segmentation. data_tests: @@ -3821,6 +3822,7 @@ models: combination_of_columns: - end_date - id_deal + - business_scope - active_accommodations_per_deal_segmentation columns: @@ -3844,6 +3846,19 @@ models: data_tests: - not_null + - name: business_scope + data_type: string + description: | + Business scope identifying the metric source. + data_tests: + - not_null + - accepted_values: + values: + - "Old Dash" + - "New Dash" + - "API" + - "UNSET" + - name: active_accommodations_per_deal_segmentation data_type: string description: | @@ -3890,6 +3905,7 @@ models: The unique key corresponds to: - end_date, - id_deal, + - business_scope, - active_accommodations_per_deal_segmentation. data_tests: @@ -3897,6 +3913,7 @@ models: combination_of_columns: - end_date - id_deal + - business_scope - active_accommodations_per_deal_segmentation columns: @@ -3920,6 +3937,19 @@ models: data_tests: - not_null + - name: business_scope + data_type: string + description: | + Business scope identifying the metric source. + data_tests: + - not_null + - accepted_values: + values: + - "Old Dash" + - "New Dash" + - "API" + - "UNSET" + - name: active_accommodations_per_deal_segmentation data_type: string description: | @@ -3998,6 +4028,7 @@ models: - global - by_number_of_listings - by_billing_country + - by_business_scope - by_deal - name: dimension_value @@ -4060,6 +4091,7 @@ models: - global - by_number_of_listings - by_billing_country + - by_business_scope - by_deal - name: dimension_value @@ -4290,6 +4322,7 @@ models: The unique key corresponds to: - end_date, - id_deal, + - business_scope, - active_accommodations_per_deal_segmentation. data_tests: @@ -4297,6 +4330,7 @@ models: combination_of_columns: - end_date - id_deal + - business_scope - active_accommodations_per_deal_segmentation columns: @@ -4320,6 +4354,19 @@ models: data_tests: - not_null + - name: business_scope + data_type: string + description: | + Business scope identifying the metric source. + data_tests: + - not_null + - accepted_values: + values: + - "Old Dash" + - "New Dash" + - "API" + - "UNSET" + - name: active_accommodations_per_deal_segmentation data_type: string description: | @@ -4470,6 +4517,7 @@ models: The unique key corresponds to: - end_date, - id_deal, + - business_scope, - active_accommodations_per_deal_segmentation. data_tests: @@ -4477,6 +4525,7 @@ models: combination_of_columns: - end_date - id_deal + - business_scope - active_accommodations_per_deal_segmentation columns: @@ -4500,6 +4549,19 @@ models: data_tests: - not_null + - name: business_scope + data_type: string + description: | + Business scope identifying the metric source. + data_tests: + - not_null + - accepted_values: + values: + - "Old Dash" + - "New Dash" + - "API" + - "UNSET" + - name: active_accommodations_per_deal_segmentation data_type: string description: | @@ -4700,6 +4762,7 @@ models: - global - by_number_of_listings - by_billing_country + - by_business_scope - by_deal - name: dimension_value @@ -4877,6 +4940,7 @@ models: - global - by_number_of_listings - by_billing_country + - by_business_scope - by_deal - name: dimension_value