reduced dates
This commit is contained in:
parent
c209e670ca
commit
e01f189d7a
2 changed files with 21 additions and 0 deletions
|
|
@ -29,6 +29,7 @@ with
|
|||
from {{ ref("int_kpis__metric_daily_check_in_attributed_guest_journeys") }} gj
|
||||
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 (
|
||||
select
|
||||
gp.date,
|
||||
|
|
@ -38,6 +39,7 @@ with
|
|||
sum(gp.checkin_cover_fees_in_gbp) as checkin_cover_fees_in_gbp,
|
||||
sum(gp.total_guest_payments_in_gbp) as total_guest_payments_in_gbp
|
||||
from {{ ref("int_kpis__metric_daily_guest_payments") }} gp
|
||||
where gp.date < current_date
|
||||
group by gp.date, gp.has_id_check
|
||||
),
|
||||
guest_kpis as (
|
||||
|
|
@ -68,6 +70,8 @@ with
|
|||
on gp.date = dd.date_day
|
||||
and gp.has_id_check = dd.has_id_check
|
||||
and dd.has_payment = {{ has_payment_true }}
|
||||
cross join max_guest_date m
|
||||
where dd.date_day <= m.max_date
|
||||
)
|
||||
|
||||
select
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue