changed names

This commit is contained in:
Joaquin 2025-06-10 14:20:28 +02:00
parent e85de15d22
commit a543fa1d83
4 changed files with 18 additions and 18 deletions

View file

@ -16,11 +16,11 @@ with
select
*,
row_number() over (
partition by id_accommodation, starts_date_utc
partition by id_accommodation, start_date_utc
order by
starts_date_utc desc, -- Prefers the latest effective start date
starts_at_utc desc, -- In case of ties, prefers the most recent original start
coalesce(ends_at_utc, {{ var("end_of_time") }}) desc
start_date_utc desc, -- Prefers the latest effective start date
start_at_utc desc, -- In case of ties, prefers the most recent original start
coalesce(end_at_utc, {{ var("end_of_time") }}) desc
) as rn
from {{ ref("int_core__accommodation_to_product_bundle") }}
)
@ -51,8 +51,8 @@ inner join
inner join
latest_daily_bundle as ldb
on bs.id_user_product_bundle = ldb.id_user_product_bundle
and date >= ldb.starts_date_utc
and (date < ldb.ends_date_utc or ldb.has_no_end_date = true)
and date >= ldb.start_date_utc
and (date < ldb.end_date_utc or ldb.has_no_end_date = true)
and ldb.rn = 1
left join
{{ ref("int_kpis__dimension_daily_accommodation") }} as icmas