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

1 Solution

Accepted Solutions
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

View solution in original post

15 Replies
paulyeo11
Master
Master
Author

my QVF

sunny_talwar

You still need the same output still? because just replacing getselectedcount with this new set analysis will change the numbers

paulyeo11
Master
Master
Author

Hi sunny

yes , it should be get the same result . because for this set of table i have 2016 data. in my previous table i dont have year = 2016

Paul

sunny_talwar

I can't think of way to get the same result without using some sort of the if statement. I will keeping looking though

paulyeo11
Master
Master
Author

It is possible to help me change then I check why ?

Sent from my iPhone

sunny_talwar

Change the if Statement? Not sure I understand Paul

paulyeo11
Master
Master
Author

Hi sunny

if IF statement i still can change the year ? by click on other year ?

Paul

sunny_talwar

Yes, if statement allows you to select year and use that year (the year you have selected)

paulyeo11
Master
Master
Author

can show me how you do it ?