Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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