restricted to 1 year in the future

This commit is contained in:
Joaquin Ossa 2024-11-17 17:40:00 +01:00
parent e01f189d7a
commit b1b527f47d

View file

@ -29,7 +29,6 @@ with
from {{ ref("int_kpis__metric_daily_check_in_attributed_guest_journeys") }} gj from {{ ref("int_kpis__metric_daily_check_in_attributed_guest_journeys") }} gj
group by gj.date, gj.has_payment, gj.has_id_check group by gj.date, gj.has_payment, gj.has_id_check
), ),
max_guest_date as (select max(date) as max_date from guest_journey_metrics),
guest_payment_metrics as ( guest_payment_metrics as (
select select
gp.date, gp.date,
@ -70,8 +69,8 @@ with
on gp.date = dd.date_day on gp.date = dd.date_day
and gp.has_id_check = dd.has_id_check and gp.has_id_check = dd.has_id_check
and dd.has_payment = {{ has_payment_true }} and dd.has_payment = {{ has_payment_true }}
cross join max_guest_date m -- Restricts the records to only those in the past to 1 year in the future
where dd.date_day <= m.max_date where dd.date_day <= current_date + interval '1 year'
) )
select select