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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Disable a value in different list box on selecting the same value in another listbox

Hi all,

My requirement is that I have 2 list boxes showing same fields. e.g. List Box 1: A,B,C,D,E. & List Box 2: A,B,C,D,E. So when I select A in List Box 1, the 'A' in listbox2 should get hidden or greyed out. Basically I have to do comparison  of A vs B or A vs C or B vs C.

If the value that has been selected in ListBox1 is not disabled than user can select the same A from ListBox2 which does not make sense.

15 Replies
MarcoWedel

Hi,

is this the same requirement as in your thread need to show all the values in listbox 2 minus the value that is selected in List box 1

?

QlikCommunity_Thread_235178_Pic1.JPG

QlikCommunity_Thread_235178_Pic2.JPG

regards

Marco

Anonymous
Not applicable
Author

Thanks a lot Sunny. Just one question. I don't understand why  to we use aggr here. If you can please explain it to me it will be very helpful.

=Aggr(If(GetSelectedCount(Scenario) = 0, Only(Compare_Scenario), Only({<Compare_Scenario = e(Scenario)>} Compare_Scenario)), Compare_Scenario).

Anonymous
Not applicable
Author

Yes it is the same one.

Thanks for your reply. That works too but in my context that will be a bit difficult to implement.

rajpreeths
Creator
Creator

Hi,

Sunny  stalwar1has done it in awesome way!!!

Aggr function has been used here just to aggregate appropriate values in the second list box as per your requirement.

If no value is selected in Scenario (GetSelectedCount(Scenario) = 0) , the only values (Values corresponding to Compare_Scenario [all values ]->> ie. Only(Compare_Scenario) ) of Compare_Scenario will be populated in Compare_Scenario list box else the values excluded in Scenario list box will get populated in Compare_Scenario list box

sunny_talwar

The reason I had to use Aggr() here was because I wanted to use set analysis

=Aggr(If(GetSelectedCount(Scenario) = 0, Only(Compare_Scenario), Only({<Compare_Scenario = e(Scenario)>}Compare_Scenario)), Compare_Scenario)

The problem is that I cannot use set analysis without some kind of aggregation functions (Sum, Only, Min, Max, Median, Avg.....) and if I use any of them in my dimension, I need to use Aggr() function. So anytime you have to use set analysis in your dimension for any reason, remember to use Aggr() function.

Does that helps?

Best,

Sunny

MarcoWedel

you're welcome.

Glad it helped.

maybe you can close your other thread as well then:

Qlik Community Tip: Marking Replies as Correct or Helpful

thanks

regards

Marco