Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
paulyeo11
Valued Contributor II

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

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

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

15 Replies
paulyeo11
Valued Contributor II

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

my QVF

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

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

paulyeo11
Valued Contributor II

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

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

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

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
Valued Contributor II

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

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

Sent from my iPhone

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

Change the if Statement? Not sure I understand Paul

paulyeo11
Valued Contributor II

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

Hi sunny

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

Paul

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

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

paulyeo11
Valued Contributor II

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

can show me how you do it ?