Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
jblomqvist
Specialist
Specialist

How to write Set Analysis to select the previous two weeks (Monday to Sunday) from the current date?

Hi all,

How to write Set Analysis to select the previous two weeks (Monday to Sunday) from the current date?

For example today is 13th December, I need Set Analysis to select the previous two weeks for me automatically

E.g. November 28th (Monday) to 11th (Sunday) December on the above.

If I were to visit my QlikView application tomorrow (14th) it should still select the same date range.

But if I was to access the app next week, it should now select December 5th (Monday) to 18th (Sunday) December.

Anyone know how to get set analysis to automatically select this type of date range please?

You can use Date as a field name example for your example code.

1 Solution

Accepted Solutions
sunny_talwar

It should be something like this:

='>=' & WeekStart(Today(1), -2) & '<=' & WeekEnd(Today(1), -1)

Capture.PNG

Make sure you set your environmental variable for FirstWeekDay equal to 0 and reload your application to take that variable into effect.

SET FirstWeekDay=0;

Capture.PNG

View solution in original post

2 Replies
sunny_talwar

It should be something like this:

='>=' & WeekStart(Today(1), -2) & '<=' & WeekEnd(Today(1), -1)

Capture.PNG

Make sure you set your environmental variable for FirstWeekDay equal to 0 and reload your application to take that variable into effect.

SET FirstWeekDay=0;

Capture.PNG

jblomqvist
Specialist
Specialist
Author

Thank you Sunny have a good Christmas