Discussion board where members can get started with Qlik Sense.
I have a document where I want to display the sales figures of previous week.
Example: If today is week 46, then I want to display only the sales of week 45. I don't want the weeks before week 45 displayed.
Can anyone assist on how to write this in the script because after two days I don't seem to find the right way...
The idea is creating a new dimension PreviousWeek which will only display the data for week(Today())-1.
I added an example file.
Many thanks for your assistance
Go to Solution.
solved with adding some new code with preceding load which is fantastic!
week(Datum)-1 as PreviousWeekNew
where CheckFlagPreviousWeek = 1;
if(week(Datum) = week(today())-1,1,0) as CheckFlagPreviousWeek;
Depending of your example and the table you provide
If you want a dimension
add this in your sript :
weekname(Datum)-1 as Previous_Week
In your table :
add this mesure
Thanks for the information!
It's not exactly the expected result.
1) It's displaying all the weeks instead of one week. I just want one line displayed: Week 45: sum(sales)
2) It's displaying the (last week of the year -1) instead of (current week (46) -1)
3) the totals aren't equal