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: 
gg225
Contributor II
Contributor II

How to Conditionally Hide Values in a Listbox

Hi,

I am wondering if it is possible to conditionally hide values in a listbox (hide, not just grey out). 

What I mean by this, is say I have two fields:

Listbox 1: field A (values below)

  • 0
  • 1

Listbox 2: field B (values below)

  • D
  • E
  • F


What I would like to be able to do:

If I select 0 in field A, only values D&E are displayed in Field B. But if I select 1: D,E, and F will be displayed. 

Thank you for any help!

Labels (2)
2 Replies
edwin
Master II
Master II

one way is to create a relationship (or association) between the two fields.  depending on your data model (im assuming these are in two separate tables) you can create a link between the two tables for these fields (using your example):

Field A, Field B
0, D
0, E
1, D
1, E
1,F

this way when 0 is selected, only DE are possible selections and all rows associated with DE are used in any aggregations using currently selected data set

edwin
Master II
Master II

another way is to explicitly add the second field to your primary table (making it non-normalized):  if your primary table uses Field B, left join the relationship between Field A and Field B to your table.  say Table1 has field B in it:

left join (Table1) load * inline [
Field A, Field B
0,D
0,E
1,D
1,E
1,F
];

this will add Field A into your table.  of course you will not use an inline, again, depending on your data model, you probably have the relationship of the two fields somewhere like a database or a file and that is where you get it from.