7 Replies Latest reply: Feb 14, 2014 1:43 PM by Baljeet Kiroriwal RSS

    Pick top 2 values in list box?

    swarup malli

      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