Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
musketeers
Creator
Creator

Conditional show hide values in list box

Hi,

I have two list box.

In first list box I have IDs values 1, 2 and 3.

In second list box I am displaying the Product names.

If I select ID = 1 in first list box, I wand to display all product name except the product PRODUCT-1.

For the rest of the IDs in first list box, I need to display all product names in second list box.

to do this I have used if condition in second listbox, but it is not hiding, it is disabling the PRODUCT-1.

I have used Hide Exclude option also but it is not correct option in my case.

I just do not want to display PRODUCT-1 wher ID = 1 is selected in first list box.

Thanks

10 Replies
alexandros17
Partner - Champion III
Partner - Champion III

In setting your condition write the expression in this way:

If(Cond, Display Item I want, Null())

so "else" option is set to null

Let me know

musketeers
Creator
Creator
Author

Yes you are right for ID = 1. I have written like this:

IF(ID = 1 and not(match(Product, 'PRODUCT-1')), Product)

So when I am selecting ID = 1 in first list box, the second list box is working fine and it is not displaying PRODUCT-1.

But when I am selecting ID =2 or 3 from first list box, my second list box is empty.

Thanks

alexandros17
Partner - Champion III
Partner - Champion III

Could you share your document?

musketeers
Creator
Creator
Author

Hi,

I am sorry, I do not have document. But I am providing a sample. Hope it will help.

I think I can not attach file so I am providing a image.

Also please consider both table as island table. There is no link between them in data model.

Thanks

alexandros17
Partner - Champion III
Partner - Champion III

Use this expression in the second listbox

=IF(GetFieldSelections(ID)=1, If(wildmatch(StName,'st1')>0, StName, null()), StName)

let me know

musketeers
Creator
Creator
Author

Hi,

Its working but it is disabling the unwanted values. Do we have any way not to display unwanted values.

Thanks

Anonymous
Not applicable

Can you try "Hide Excluded" in the Listbox properties.

Is this what you want to achieve?

reshmakala
Creator III
Creator III

Check the "Hide excluded" button in list box properties.

musketeers
Creator
Creator
Author

Hi,

No Hide Exclude is not correct option for me as it will hide the unwanted values in first look. But when user will select a values from the list then Hide Exclude option will hide remaining unselected values.

So it is not correct one.

Thanks