Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
zied_ahmed1
Specialist
Specialist

variable to retrieve name of a week

Hello I use two variables to calculate sales of this week and the week - 4  my week is like : 

2018_W42

So to calculate the Sales of the actual week I use this : 

text(Year(Today())) & '_W0'& text(Week(Today())) -->result is correct  2019_W01 

and for the week-4 it doesn't work , I use this : 

text(Year(Today())-1) & '_W'& text(Week(Today())-4) -> result is 2019_W-3 and not correct 

 

Thanks for help 

1 Reply
Gysbert_Wassenaar

Try WeekYear(WeekStart(Today(),-4)) & '_W' & Num(Week(WeekStart(Today(),-4)),'00')


talk is cheap, supply exceeds demand