Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone!
My goal is to show the sum of data for the last eight weeks separately for each week, even though the day changes.
The working week starts on Mon and ends on Sun.
I want to have a clickable option:
- Last week
- 2 weeks ago
- 3 weeks ago
- 4 weeks ago ...
Hi @okin_pfa,
You can create 8 columns containing a measure pointing out to the week you want to show based on the selected date in your app.
Try this:
Column 1 (CW-1): Sum({<Date = {"<=$(=WeekEnd(Max(Date), -1)) >=$(=WeekStart(Max(Date), -1))"}>} Field)
Column 2 (CW-2): Sum({<Date = {"<=$(=WeekEnd(Max(Date), -2)) >=$(=WeekStart(Max(Date), -2))"}>} Field)
.... and so on ...
In your script it needs to be stated that the week starts on Monday, then it will know it ends on Sunday.
SET FirstWeekDay =0;
More info about this variable can be found here: https://help.qlik.com/en-US/qlikview/May2022/Subsystems/Client/Content/QV_QlikView/Scripting/NumberI...
-Ruben