Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
aditya_pratap
Contributor III
Contributor III

Previous Week and Current Week

@Michael_Tarallo @mbj @petter @richbyard @Mp3Leaks @rohitk1609 @Marcus_Spitzmiller @ergustafsson @Masaki_Hamano @Sue_Macaluso 

Hi Everyone,

aditya_pratap_0-1662446320298.png

Here I am calculating abc and abcdef

abc=sum({<week_no= {"$(=max(week_no))"}>}sale) for current week

abc=sum({<week_no= {"$(=max(week_no)-1)"}>}sale) for previous week

but for abcdef i am only able to calculate for current week if i select only one week in week filter

abcdef=Sum(TOTAL <week_no,category_1 > sale) here i want total at category_1 level as you can see in image.

pls help me to find current week and previous week for abcdef if I select multi weeks in week filter.

Thanks 

Aditya

1 Solution

Accepted Solutions
SerhanKaraer
Creator III
Creator III

Hello,

If I get it right what you described as your problem,

abcdef_currentWeek=Sum({1<week_no= {"$(=max(week_no))"}>} TOTAL <week_no,category_1 > sale)

abcdef_previousWeek=Sum({1<week_no= {"$(=max(week_no)-1)"}>} TOTAL <week_no,category_1 > sale)

You should add "1" as set identifier for week_no because you don't want it to be affected by selection.

 

View solution in original post

2 Replies
SerhanKaraer
Creator III
Creator III

Hello,

If I get it right what you described as your problem,

abcdef_currentWeek=Sum({1<week_no= {"$(=max(week_no))"}>} TOTAL <week_no,category_1 > sale)

abcdef_previousWeek=Sum({1<week_no= {"$(=max(week_no)-1)"}>} TOTAL <week_no,category_1 > sale)

You should add "1" as set identifier for week_no because you don't want it to be affected by selection.

 

aditya_pratap
Contributor III
Contributor III
Author

Thanks @SerhanKaraer for your reponse it is really very helpfull.

Thanks A lot

Aditya