Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

danielle_v
Contributor

Expression in List Box/Calendar

Hi All,

I have a list box containing my Year field. The dataset I'm using contains a few years worth of data, however I would like to write an expression in order for the list box to only show years that are equal to or greater than the year of today (ie. the current year).

So for example, today's date is 28/02/2013, so I would like to only show 2013, 2014, 2015 etc. in my list box for the user to be able to select from. 2012, 2011, 2010 etc. should not appear in the list box.

I have tried a few things but can't get it to work - is it possible?

Any help greatly appreciated!

1 Solution

Accepted Solutions

Re: Expression in List Box/Calendar

Hi,

     Try this.

     Create a new list box (by Right clicking on the canvas). Here in field section, select Expression.

     Write below expression.

     if(Year >= year(today()),Year)

     Or you can also create the field in script which gives you the year equal to or greater then current year.

     Expression will be the same.

     hope this helps.

Regards,

Kaushik Solanki

2 Replies

Re: Expression in List Box/Calendar

Hi,

     Try this.

     Create a new list box (by Right clicking on the canvas). Here in field section, select Expression.

     Write below expression.

     if(Year >= year(today()),Year)

     Or you can also create the field in script which gives you the year equal to or greater then current year.

     Expression will be the same.

     hope this helps.

Regards,

Kaushik Solanki

danielle_v
Contributor

Re: Expression in List Box/Calendar

Perfect, thanks - I used your first suggestion

Community Browser