Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
NewQlikUser
Contributor II
Contributor II

Previous week last year

Hi, Within the master calendar we have created the following expressions: LET vCurWeek = div(WeekEnd(vToday)-YearStart(vToday,0,10),7); LET vPrevWeek = vCurWeek - 1; LET vCurWeekPrevFinYr = div(WeekEnd(AddYears(vToday,-1))-YearStart(AddYears(vToday,-1),0,10),7); vCurWeek & vPrevWeek works fine but the vCurWeekPrevFinYr is giving me the data from last year -1 week(current week start 11/2/19). Instead of giving me the week starting 12/2/18 is giving me data from week 5/2/18 Any ideas of how to fix this issue?
3 Replies
Shubham_Deshmukh
Specialist
Specialist

Please edit your question, it becomes so confusing and time consuming for all to read it and come up with solution. Put it properly,
LET vCurWeek=
LET vPrevWeek=
---
---

pradosh_thakur
Master II
Master II

Week starts on monday.

 

Check the callender 12/2/2018  and 5/2/2018 are mondays. So it's giving correct answer as per your logic.

Learning never stops.
Shubham_Deshmukh
Specialist
Specialist

Try this,
=date(WeekStart(Week(AddYears(today(),-1)-YearStart(today(),-1,4))),'DD-MM')&'-'&(year(today())-1)