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: 
Rick_T
Contributor III
Contributor III

Display last week last year in a Flag

Hello all, 

I am busy creating a flag for last week last year but it is displaying a wrong period. 

The expression i use is the following: 

If((TempDatum>=Weekstart(AddMonths(today(),-7),-12) and TempDatum<=WeekEnd(AddMonths(Today(),-7),-12)),1) as [O.LWLY Flag]

It is currently displaying a week in April starting at April 16th  and ending at April 22th. 

Does anyone have any suggestions on how to solve this so it shows last week last year (February 4th till February 10th). 

Many thanks in advance! 

 

Sincerely, 

Rick 

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar

Try this may be

If(
TempDatum >= Weekstart(AddMonths(Today(), -12), -1) and
TempDatum <= WeekEnd(AddMonths(Today(), -12), -1)
, 1) as [O.LWLY Flag]

View solution in original post

2 Replies
sunny_talwar

Try this may be

If(
TempDatum >= Weekstart(AddMonths(Today(), -12), -1) and
TempDatum <= WeekEnd(AddMonths(Today(), -12), -1)
, 1) as [O.LWLY Flag]
Rick_T
Contributor III
Contributor III
Author

This works great, thanks mr. Talwar!