Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Same week last year

Hi guys,

I've got two variables in a load script

Let vWeekStart = WeekStart(today())

Let vWeekEnd = WeekEnd(today())



What I would like to do is create the same variables for the same week last year

Can this be done?

Thanks
Mel

1 Solution

Accepted Solutions
jmvilaplanap
Specialist
Specialist

Hi,

Could you try:

LET vWeekStartPrevYear = weekstart(addyears(today(), -1)

LET vWeekEndPrevYear = weekend(addyears(today(), -1)


Regards

View solution in original post

2 Replies
tomasz_tru
Specialist
Specialist

Week numer can be tricky, first you have to decide what kind of week number you want - to make sure you have everything under control: Redefining the Week Numbers

Tomasz

jmvilaplanap
Specialist
Specialist

Hi,

Could you try:

LET vWeekStartPrevYear = weekstart(addyears(today(), -1)

LET vWeekEndPrevYear = weekend(addyears(today(), -1)


Regards