Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Previous YearWeek of the current date in script

Hi all,

I am trying to filter data to fetch only records from the previous year week of the current date. Till now I managed to do it hard coded at following:

WeekYear(Timekey) & right('00' & week(weekstart(Timekey)),2) = '201544'

Is it possible to swap '201544' to a function that return the previous yearweek of the current date without hardcoding the value. I cannot find anything regarding how this can be done.

Regards,

Matt

1 Reply
vlad_komarov
Partner - Specialist III
Partner - Specialist III

If I understand your issue correctly, the weekstart(Timekey, -1) should do the trick.

VK