15 Replies Latest reply: Apr 12, 2016 11:58 PM by Sunny Talwar

# 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

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

• ###### 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

• ###### 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

• ###### 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)

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

can show me how you do it ?

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

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

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

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

• ###### 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

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

Hi Sunny

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

Paul

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

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