Changed filters
This commit is contained in:
parent
db2d626ae0
commit
8c52049f86
1 changed files with 5 additions and 3 deletions
|
|
@ -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') as py_week_start, -- Start of the same week last year
|
||||||
date_trunc('week', {{ yesterday }} - interval '1 year') + (
|
date_trunc('week', {{ yesterday }} - interval '1 year') + (
|
||||||
{{ yesterday }} - date_trunc('week', {{ yesterday }})
|
{{ 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('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('month', {{ yesterday }} - interval '1 year') as py_month_start,
|
||||||
date_trunc('year', {{ yesterday }}) as current_year_start,
|
date_trunc('year', {{ yesterday }}) as current_year_start,
|
||||||
|
|
@ -72,7 +72,7 @@ with
|
||||||
end
|
end
|
||||||
) as pp_value
|
) as pp_value
|
||||||
from int_kpis__product_guest_daily_metrics dm, date_ranges dr
|
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
|
group by
|
||||||
metric, has_payment, has_id_check, main_billing_country_iso_3_per_deal
|
metric, has_payment, has_id_check, main_billing_country_iso_3_per_deal
|
||||||
union all
|
union all
|
||||||
|
|
@ -101,7 +101,9 @@ with
|
||||||
end
|
end
|
||||||
) as pp_value
|
) as pp_value
|
||||||
from int_kpis__product_guest_daily_metrics dm, date_ranges dr
|
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
|
group by
|
||||||
metric, has_payment, has_id_check, main_billing_country_iso_3_per_deal
|
metric, has_payment, has_id_check, main_billing_country_iso_3_per_deal
|
||||||
union all
|
union all
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue