modified py_week_current_date calculation
This commit is contained in:
parent
2b89af2bd9
commit
c77defab28
1 changed files with 2 additions and 4 deletions
|
|
@ -31,10 +31,8 @@ with
|
|||
date_trunc('month', {{ yesterday }}) as current_month_start,
|
||||
date_trunc('week', {{ yesterday }}) as current_week_start, -- Start of the current week
|
||||
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')
|
||||
+ interval '1 day'
|
||||
* extract(
|
||||
dow from {{ yesterday }} - interval '1 day'
|
||||
date_trunc('week', {{ yesterday }} - interval '1 year') + (
|
||||
{{ yesterday }} - date_trunc('week', {{ yesterday }})
|
||||
) as py_week_current_date,
|
||||
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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue