diff --git a/models/intermediate/kpis/int_kpis__agg_daily_new_dash_accommodation_offered_services.sql b/models/intermediate/kpis/int_kpis__agg_daily_new_dash_accommodation_offered_services.sql index 5a09e66..080395d 100644 --- a/models/intermediate/kpis/int_kpis__agg_daily_new_dash_accommodation_offered_services.sql +++ b/models/intermediate/kpis/int_kpis__agg_daily_new_dash_accommodation_offered_services.sql @@ -14,10 +14,11 @@ -- Metrics -- count(distinct aos.id_accommodation) as accommodation_with_offered_service_count from {{ ref("int_kpis__dimension_dates") }} d - inner join + left join {{ ref("int_kpis__metric_daily_new_dash_accommodation_offered_services") }} as aos on d.date = aos.date + where aos.id_accommodation is not null group by 1, 2, 3 {% if not loop.last %} union all diff --git a/models/intermediate/kpis/int_kpis__agg_daily_new_dash_deals_offered_services.sql b/models/intermediate/kpis/int_kpis__agg_daily_new_dash_deals_offered_services.sql index abdd066..4e351ca 100644 --- a/models/intermediate/kpis/int_kpis__agg_daily_new_dash_deals_offered_services.sql +++ b/models/intermediate/kpis/int_kpis__agg_daily_new_dash_deals_offered_services.sql @@ -12,9 +12,10 @@ -- Metrics -- count(distinct dos.id_deal) as deal_with_offered_service_count from {{ ref("int_kpis__dimension_dates") }} d - inner join + left join {{ ref("int_kpis__metric_daily_new_dash_deals_offered_services") }} as dos on d.date = dos.date + where dos.id_deal is not null group by 1, 2, 3 {% if not loop.last %} union all diff --git a/models/intermediate/kpis/int_kpis__agg_monthly_new_dash_accommodation_offered_services.sql b/models/intermediate/kpis/int_kpis__agg_monthly_new_dash_accommodation_offered_services.sql index 8addb32..7d82a9c 100644 --- a/models/intermediate/kpis/int_kpis__agg_monthly_new_dash_accommodation_offered_services.sql +++ b/models/intermediate/kpis/int_kpis__agg_monthly_new_dash_accommodation_offered_services.sql @@ -14,11 +14,11 @@ -- Metrics -- count(distinct aos.id_accommodation) as accommodation_with_offered_service_count from {{ ref("int_kpis__dimension_dates") }} d - inner join + left join {{ ref("int_kpis__metric_daily_new_dash_accommodation_offered_services") }} as aos on aos.date = d.date - where d.is_end_of_month = true + where d.is_end_of_month = true and aos.id_accommodation is not null group by 1, 2, 3 {% if not loop.last %} union all diff --git a/models/intermediate/kpis/int_kpis__agg_monthly_new_dash_deals_offered_services.sql b/models/intermediate/kpis/int_kpis__agg_monthly_new_dash_deals_offered_services.sql index d62690e..31700ef 100644 --- a/models/intermediate/kpis/int_kpis__agg_monthly_new_dash_deals_offered_services.sql +++ b/models/intermediate/kpis/int_kpis__agg_monthly_new_dash_deals_offered_services.sql @@ -12,10 +12,10 @@ -- Metrics -- count(distinct dos.id_deal) as deal_with_offered_service_count from {{ ref("int_kpis__dimension_dates") }} d - inner join + left join {{ ref("int_kpis__metric_daily_new_dash_deals_offered_services") }} as dos on dos.date = d.date - where d.is_end_of_month = true + where d.is_end_of_month = true and dos.id_deal is not null group by 1, 2, 3 {% if not loop.last %} union all diff --git a/models/intermediate/kpis/int_kpis__agg_weekly_new_dash_accommodation_offered_services.sql b/models/intermediate/kpis/int_kpis__agg_weekly_new_dash_accommodation_offered_services.sql index f032e82..a353a74 100644 --- a/models/intermediate/kpis/int_kpis__agg_weekly_new_dash_accommodation_offered_services.sql +++ b/models/intermediate/kpis/int_kpis__agg_weekly_new_dash_accommodation_offered_services.sql @@ -14,11 +14,11 @@ -- Metrics -- count(distinct aos.id_accommodation) as accommodation_with_offered_service_count from {{ ref("int_kpis__dimension_dates") }} d - inner join + left join {{ ref("int_kpis__metric_daily_new_dash_accommodation_offered_services") }} as aos on aos.date = d.date - where d.is_end_of_week = true + where d.is_end_of_week = true and aos.id_accommodation is not null group by 1, 2, 3 {% if not loop.last %} union all diff --git a/models/intermediate/kpis/int_kpis__agg_weekly_new_dash_deals_offered_services.sql b/models/intermediate/kpis/int_kpis__agg_weekly_new_dash_deals_offered_services.sql index b97c9ab..a7b4175 100644 --- a/models/intermediate/kpis/int_kpis__agg_weekly_new_dash_deals_offered_services.sql +++ b/models/intermediate/kpis/int_kpis__agg_weekly_new_dash_deals_offered_services.sql @@ -12,10 +12,10 @@ -- Metrics -- count(distinct dos.id_deal) as deal_with_offered_service_count from {{ ref("int_kpis__dimension_dates") }} d - inner join + left join {{ ref("int_kpis__metric_daily_new_dash_deals_offered_services") }} as dos on dos.date = d.date - where d.is_end_of_week = true + where d.is_end_of_week = true and dos.id_deal is not null group by 1, 2, 3 {% if not loop.last %} union all