Discussion Board for collaboration related to QlikView App Development.
Hello,
I have been trying with no success to populate a listbox dynamically based on the selection of another listbox. I have tried to use an expression, but I seem to missing something. Below is a description of what I am trying to accomplish:
Listbox1 = View
Listbox2 = Colors
When I click on Full from the View listbox I want to see all values in the Colors listbox, but when I click on Partial from the View listbox I only want "Blue" and "Green" to appear in the Colors listbox. Can this be achieved?
Thanks!
Create a table in the script that relates the values of the two fields with each other:
LOAD * INLINE [
View, Colors
Full, Blue
Full, Green
Full, Red
Full, Yellow
Partial, Blue
Partial, Green
];
Then when you click on Full the Colors listbox will show all colors and if you click Partial the listbox will show only blue and green
This is very close to what I am looking for, but one side effect. When I click on partial it shows all values, but red and yellow have a greyed out background. What I want is to only show blue and green. I clicked the hide checkbox, but it only shows the one that is selected.
different approach, perhaps a bit complicated for your scenario, but with this expression you're able to use even functions or complex wildcards instead of just {"*"} or {"blue","green"} ...
Table1:
LOAD * INLINE [
Selection
Full
Partial
];
Table2:
LOAD * INLINE [
Color
blue
green
red
yellow
];
=if(GetFieldSelections(Selection)='Full','("'& Concat({<"Color"={"*"}>} DISTINCT "Color", '"|"') &'")',
if(GetFieldSelections(Selection)='Partial','("'& Concat({<"Color"={"blue","green"}>} DISTINCT "Color", '"|"') &'")') )
Its the default nature of Qlikview ...which ever you select will be highlighted in Green and relevant data in White and un-related data in grey....hide exclude will hide only the non relative data in our case you have selected the either green or blue value in the list box i guess...don't select any value in the list box and then check
I recommend against it, but you can use an expression instead of a field in the multibox to hide the unselected values: =aggr(Colors, Colors)
The =aggr(Colors, Colors) expression is the closest to what I am trying to achieve. Why do you recommend against using the aggr?
If you have some linkage between these 2 list boxes then directly use hide excluded option