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

Select in field not working when no data equals the selection

Hi all, I am using select in field but have found that when the value I try to select does not exist in the data set I get all other values that do exist rather than nothing. I have possible values A1,A2,A3,B1,B2,B3,C1,C2,C3 but if other selections "reduce" this list and then I try to use a button which selects one of the values not now valid then I get ALL the other values rather than nothing or an error.

How can I correct this? I've tried locking and unlocking and bookmarks in the actions but they don't correct this issue.

Please help.

Thanks

David

3 Replies
Gysbert_Wassenaar

I'm not sure I understand you correctly. But try putting your list of possible values in a variable:

vList = 'A1','A2','A3','B1','B2','B3','C1','C2','C3'

and use and expression like this as search string:

=if(count({<MyDim={$(vList)}>} distinct MyDim)=substringcount(vList,',')+1,'(' & replace(vList,',','|') & ')' )


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Hi thanks for that impressive formula but it doesn't do what I need . I'll try to explain again what I'm stuck on. All possible values for my field [Buying Position] are  'A1','A2','A3','B1','B2','B3','C1','C2','C3' but some customers once selected only have possible values of for example 'A1','B1','C1' and if I use select in field on buying position for one of these customers and try to select 'C2' then rather than get an error or blank the selection gives me  'A1','B1','C1' instead.

Thanks for trying, any other ideas are greatly appreciated.

kuba_michalik
Partner - Specialist
Partner - Specialist

That's probably because trying to select an excluded value results in no selection in a field, and no selection equals to "all possible values visible".

As to how to deal with this, it depends on the exact situation. I would probably check whether anything got selected (using GetSelectedCount function), and if not, would either not allow the user to proceed, or hide any relevant objects.