wip
This commit is contained in:
parent
cea7cdb34d
commit
cf024f7b71
3 changed files with 20 additions and 19 deletions
|
|
@ -14,9 +14,11 @@ select
|
|||
coalesce(
|
||||
icd.main_billing_country_iso_3_per_deal, 'UNSET'
|
||||
) as main_billing_country_iso_3_per_deal,
|
||||
coalesce(
|
||||
icmas.active_accommodations_per_deal_segmentation, 'UNSET'
|
||||
) as active_accommodations_per_deal_segmentation,
|
||||
case
|
||||
when ldl.deal_lifecycle_state = '01-New'
|
||||
then coalesce(dd.hubspot_listing_segmentation, 'UNSET')
|
||||
else coalesce(icmas.active_accommodations_per_deal_segmentation, 'UNSET')
|
||||
end as active_accommodations_per_deal_segmentation,
|
||||
-- Metrics --
|
||||
count(
|
||||
distinct case
|
||||
|
|
@ -66,6 +68,7 @@ select
|
|||
) as deals_booked_in_12_months
|
||||
from {{ ref("int_kpis__lifecycle_daily_deal") }} as ldl
|
||||
left join {{ ref("int_core__deal") }} as icd on ldl.id_deal = icd.id_deal
|
||||
left join {{ ref("int_kpis__dimension_deals") }} as dd on ldl.id_deal = dd.id_deal
|
||||
left join
|
||||
{{ ref("int_kpis__dimension_daily_accommodation") }} as icmas
|
||||
on ldl.id_deal = icmas.id_deal
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue