Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Show list box value by Select Condition

Hi,

I have a question, i have two list box object.

the first one has two value (Select A, Select B), the second one has three value (A with flag Y, B with flag N, C with Flag Y)

When i choose Select A on the first list box, i want to show only A and C (value with Y flag) on the second list box. And when i choose Select B i want to show all values on the second list box.

I have try using this expression on the second list box -->

=if(GetFieldSelections(Selections)='Select A',

  Only({<Flag={'Y'}>}Value), Value

)

But it is not working and not showing any value.

Anybody has idea ?

i also attach my sample file here.

Thanks in advance.

12 Replies
tamilarasu
Champion
Champion

Lejours,

Try below expression,

=if(GetFieldSelections(Selections)='Select A',

  Aggr(Only({<Flag={'Y'}>}Value),Value), Value

)

Anonymous
Not applicable
Author

Hi Tamil,

Thanks for your idea.

But i found some problem:

  • The first one is, when I choose Select A , then i choose A on the second list box, the C value is missing from the second list box.
  • The second one is, when I choose Select B, then i choose A on the second list box, the Select A in first list box is also choosed.

2.PNG

Do you know how to solve it ?

Thanks in advance.

ajsjoshua
Specialist
Specialist

Hi,

Its working

PFA

ajsjoshua
Specialist
Specialist

Hi,

use this exp

=if(GetFieldSelections(Selections)='Select A',

  Aggr(Only({<Flag={'Y'}>}Value),Value),  Aggr(Only({<Flag={'N'}>}Value),Value)

)

tamilarasu
Champion
Champion

I will check.

Kushal_Chawda

Can you try something like this

Associate your Select A and Select B values to your data like below

Selection:

LOAD * inline [

Selections, Flag

Select A, Y

Select B, Y

Select B, N ];

Now link this table on Flag. So when you will do 'Select A' Values associated with Flag Y will be displayed and when you do 'Select B' Values associated with both Y & N will be displayed

sunny_talwar

This:

=if(GetFieldSelections(Selections)='Select A',

  Aggr(Only({1<Flag={'Y'}>}Value),Value), Value)


Capture.PNG

Anonymous
Not applicable
Author

Hi Sunny,

Thanks for the idea, but i found another problem.

When i choose Select B from the first list box and then i choose A from the second listbox, "Select A" on the first list box also choosed automatically.

Here is the illustration:

2.PNG

second problem is when i choose Select A and then choose A from the second list box, and i click A again in order to clear the selection in the second list box, the selection in the first list box also cleared.

Do you know how to fix it ?

Really appreciate your help.

Thanks in advance.

Anonymous
Not applicable
Author

Hi Kushal,

Thanks for the idea.

I've try this method, but i found some problem that doesn't meet my requirement.

The problem is, when i choose Select B, only the value with FLAG N can be choosed. But another value with flag Y also shown. Is it possible to hide the Value from the list box ?

Thanks in advance.