Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

How to replace getselectcount(year) with year = {$(=Max(year)-1)} ?

Hi All

My below expression work fine :-

Sum({<year = {$(=Max(if(getselectedcount(year)=0,2015,year))-0)} , month = {"<=$(=Max({<year={$(=Max(if(getselectedcount(year)=0,2015,year)))}, sales = {'*'}>} month))"}, cOST={"cOST"} >} Amount*-1)/Rate/1000

To reduce maintenance , i like to change to using :-

year = {$(=Max(year)-1)}

Paul

15 Replies
sunny_talwar

I guess I am not sure what you are looking for? Can you elaborate the goal?

paulyeo11
Master
Master
Author

Hi Sunny

I am sorry , i think i give you the wrong simple data ,

the last simple file with out year= 2016 ,

This is the correct simple file , it have 2016 data.

Paul

sunny_talwar

Is this what you are looking for?

Sum({<year = {$(=Max(year) - 1)} , month = {"<=$(=Max({<year={$(=Max(year) - 1)}, sales = {'*'}>} month))"}, cOST={"cOST"} >} Amount*-1)/Rate/1000

paulyeo11
Master
Master
Author

Hi Sunny

Thank you very much for your help. it work fine. and it is more flexible now.

Paul

sunny_talwar

Great, I am glad you got what you were looking for

sunny_talwar

Please close the thread if you got what you were looking for by marking correct and helpful answers.

Thanks,

Sunny