Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Limiting Data in a List Box

Is there a way to limit the data in a list box. The table my list box pulls data from goes back to 2009. I would like to hahve the list box only pull data from 2011.

Thanx

9 Replies
Not applicable
Author

Hi,

Use a calculated expression instead of the field itself. For example, if the field in the list box is called "A", create an expression like:

({$<[Year]={2011}>} A)

pat_agen
Specialist
Specialist

hi,

you can enter an expression in your list box. On the general tab of the properties dialogue open the drop down list of fields. Scroll to the top and select <Expression>. the expression dialogue will open. Enter something like this:

=if(Year=2011,fieldToBeDisplayedHere)

hope this helps

Not applicable
Author

Following your lead, this is the formula I used.

=if(CloseDate_MY >='01-2011',CloseDate_MY)

Unfortunately it's doing noting...as if I didnt type any thing in. Do you see an issue with the syntax?

Not applicable
Author

I tried the syntax as such:

=({$<{CloseDate_MY} >={01-2011}>} CloseDate_MY)

Unfortunately Im getting error in expression. Any idea?

pat_agen
Specialist
Specialist

hi,

how is the field ClosedDat-MY defined? Is this a date field?

You probably need to do some processing on this field to have it comparable to a string such as '01-2011'. perhaps something like:

if(Date(ClosedDat_MY,'MM-YYYY')>='01-2011',CloseDate_MY)

Not applicable
Author

Yes, the CloseDate_MY is a date field formatted for MM-YYYY

pat_agen
Specialist
Specialist

did you try the code as posted?

if(Date(ClosedDat_MY,'MM-YYYY')>='01-2011',CloseDate_MY)

Not applicable
Author

Yes, but unfortunately, there seems to be no effect on the list box...all of the month year data shows back to 2009

Thanx

yasus
Contributor III
Contributor III

Hi fuji,

I would just add a dedicated field for your listbox within the load script.

Example:

LOAD *,

if(Yearmonth<201102,Yearmonth) as ModListBox

From //