Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ,
I have a list box which has values from 2008 to 2013.
I want the listbox to display current year and previous year ( ie 2012 and 2013)
I know this can be achieved using the expression inside the list box.
My requirement is I don't want to hardcode year in order to pick top 2 values.
I tried using the following expression inside the listbox
if (year=max(year) or year=max(year-1))
But the thing is when I click on 2012 in the list box ,it show 2011.
Is there a way this can be achieved without hardcoding year values ?
Thanks
SM
Try with this
=If(Match(Year, Max({1} Year), Max({1}Year)-1)), Year)
Edit:
=If(Match(Year, $(=Max({1} Year)), $(=Max({1} Year)-1)), Year)
Hope it helps
Celambarasan
Something like this: =aggr(if(rank(Year)<=2,Year),Year)
If you want you could also replace the 2 with a variable so you can change the top x by changing the value of the variable.
Thank you !!! Gysbert
Hey Gysbert,
When i make a selection in list box, say I choose 2013, then all other values disappear, how can I not make them disappear ?
I don't want to hard code any year
Try with this
=If(Match(Year, Max({1} Year), Max({1}Year)-1)), Year)
Edit:
=If(Match(Year, $(=Max({1} Year)), $(=Max({1} Year)-1)), Year)
Hope it helps
Celambarasan
In the expresssion
=If(Match(Year, $(=Max({1} Year)), $(=Max({1} Year)-1)), Year)
wt does {1} stand for ?
Balraj
I guess {1} represents the full set of all the records in the application
Excellentooo..!! it solved dropdown filter issue. Thanks boss.