Changed filters

This commit is contained in:
Joaquin Ossa 2024-11-27 09:47:30 +01:00
parent db2d626ae0
commit 8c52049f86

View file

@ -33,7 +33,7 @@ with
date_trunc('week', {{ yesterday }} - interval '1 year') as py_week_start, -- Start of the same week last year
date_trunc('week', {{ yesterday }} - interval '1 year') + (
{{ yesterday }} - date_trunc('week', {{ yesterday }})
) as py_week_current_date,
) as py_week_current_date, -- Start of the same week in the previous year
date_trunc('week', {{ yesterday }} - interval '1 week') as pp_week_start, -- Start of the same week in the previous period
date_trunc('month', {{ yesterday }} - interval '1 year') as py_month_start,
date_trunc('year', {{ yesterday }}) as current_year_start,
@ -72,7 +72,7 @@ with
end
) as pp_value
from int_kpis__product_guest_daily_metrics dm, date_ranges dr
where extract(day from date_day) <= dr.current_day_of_month
where dm.date_day >= dr.py_year_start
group by
metric, has_payment, has_id_check, main_billing_country_iso_3_per_deal
union all
@ -101,7 +101,9 @@ with
end
) as pp_value
from int_kpis__product_guest_daily_metrics dm, date_ranges dr
where extract(day from date_day) <= dr.current_day_of_month
where
dm.date_day >= dr.py_year_start
and extract(day from date_day) <= dr.current_day_of_month
group by
metric, has_payment, has_id_check, main_billing_country_iso_3_per_deal
union all