Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Talk to Experts Tuesday, Live Q&A, September 22: Moving from QlikView to Qlik Sense. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Restrict contents of a list box

Hi,

Is there a simple way to restict the contents of a list box?

For example records with a field "Action" which has the values "Open", "Waiting", "Connect" and "Closed".

I just want to show a list box with the values "Waiting" and "Connect"? So restrict it to just these values only?

Thanks

Joe

1 Solution

Accepted Solutions
Highlighted
Not applicable

There are two ways (At least)

1. Use Calculated dimension or Expression in the listBox:

Create a new listbox, and choose 'Expression' from list of fields. Now put If(Field=Field1 or Field=Field2, Field) as your Expression to show only Field1 and Field2 values in the lsitbox.

2. Use a new table in the model, linking to the desired field, but with only the values that you want to display. Use this dimension in the Listbox.

View solution in original post

12 Replies
Highlighted
Not applicable

There are two ways (At least)

1. Use Calculated dimension or Expression in the listBox:

Create a new listbox, and choose 'Expression' from list of fields. Now put If(Field=Field1 or Field=Field2, Field) as your Expression to show only Field1 and Field2 values in the lsitbox.

2. Use a new table in the model, linking to the desired field, but with only the values that you want to display. Use this dimension in the Listbox.

View solution in original post

Highlighted
Not applicable

Works Perfect!

Thansk 🙂

Highlighted
Not applicable

Hi all,

Using if statement to restrict rows in a listbox is fine when w2e have only 2 to 3 rows. what is the method to restrict rows in a listbox when there are 100 + rows???

Highlighted
Not applicable

There are plenty of ways to do it.

One:

  • create a map on load script; TESTMAP: LOAD MAPPING INLINE ....
  • put all the words you want on it.

WORD     FLAG_SHOW

Waiting"     1

"Connect   1

*                  0

  • create a new column on the table and apply the map. it will work as a flag field. Applymap(TESTMAP, DIMENSION)
  • use the if (FLAG_DIM  =1, ...)

Two:

     create a table with the values and join with the dimension tables

and it goes...

Highlighted
Not applicable

Adrian,

the first way you suggested is good for the case when we have 10 or 20 rows in that listbox(table). In my case, there are arond 1000 rows in that listbox, but for a particular chart where I am using this listbox I want to have only 10 of these rows.

Can you please elaborate the second case?

Highlighted
Not applicable

Actually it is not 10, I just gave a number.

there is one more thng to this. In the actual table there is one more column called line_no. I want all the categories for which line_no = 1 .

Ex:

LineCategory2
1a
1b
1c
2d
2e
3f
3g

Like this, there are more than 1000 rows and I want all the categories for which line_no=1. since we are not using an aggregate function, we cannot use set analysis here. So is there a way?

Highlighted
Not applicable

Thanks Mayil!

Load *,line_no,Category2 from tablename where line_no = 1; but this query restricts all the columns to line_no = 1.

can't we place the restriction on one column?

I think the abve query makes more sense though

Highlighted

hi,

     Try this,

      Load *,line_no,if(line_no = 1,Category2) as Category2 from tablename;

     Hope it helps.

Highlighted
Not applicable

thanks !

that works!