Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
ivandrago
Creator II
Creator II

Limit Value on list Box

Hi,

I have a List box based on the field "Year" at the moment it is going back to 2000, I only want it to show the Years that fall with in the last 13 months so I only want it to show 2009, 2010. It is currently showing 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 which I do not want.

Thanks

1 Solution

Accepted Solutions
Not applicable

You can use the below expression in the list box

if(Year>=year(addmonths(today(),-13)),Year)

View solution in original post

7 Replies
Not applicable

Hi IvanDrago,

I think you can try make the expression listbox for this case.

Not applicable

Hi Ivan,

From which field you are picking your date. Does this contains years. If yes, you can split the year from you date and define separately in your script. Then create a listbox from the same. I think it would resolve your issue.

Not applicable

You can use the below expression in the list box

if(Year>=year(addmonths(today(),-13)),Year)

ivandrago
Creator II
Creator II
Author

Where can you put this expression?

Not applicable

Go to list box properties.

You can see the <Expression> In the field drop down.

ivandrago
Creator II
Creator II
Author

Have you a screen dump of this ? Because I cannot see anywhere where I can put this expression

Not applicable

Then a window will pop up where u can copy and paste this:

if(Year>=year(addmonths(today(),-13)),Year)