Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Automatically select default value in listbox when selecting value in other listbox.

My question is kind of a complicated one to explain.

I have two listboxes; ShopId and PosId. a ShopId is unique, but a PosId isn't. Example population:

ShopId  |  PosId

1           |    1

1           |    2

2           |    1

3           |    1

There always has to be one and only one value selected in both listboxes ( PosId and ShopId).

My problem now is that when i select ShopId=1 and PosId=2, i can't click on ShopId=3 because ShopId3 doesn't have a PosId2.

I basically want to change my PosId to the lowest possible value when i select another shop (So that there will always be a selected value in both lisboxes).

If something is still unclear, please ask.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

If you don't want a user to be able to make a selection then don't load data with any other values than those you want selected. In other words, hard-code your selection in the script with a where clause.


talk is cheap, supply exceeds demand

View solution in original post

9 Replies
Gysbert_Wassenaar

I don't understand why you can't click on ShopId 3. That should be possible. It should simply clear the PosId field, but there's no reason that I know of that wouldn't allow you to select ShopId 3. Can you post a small qlikview document that demonstrates this problem?


talk is cheap, supply exceeds demand
vikasmahajan

Check with this I think you can go with alternate states https://community.qlik.com/message/787428#787428

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
Not applicable
Author

I can indeed click on the other ShopId3 when i have the option ' always have one selected value' off. But i need that option to be 'on' in both listboxes.

To be clear: i ALWAYS want a value selected in both listboxes. I think the most simple way to do that is by setting PosID to 1 whenever another ShopId is selected, but i have no idea how i can do that.

Not applicable
Author

I am not sure how i would use that. Can you give me more information?

Gysbert_Wassenaar

Add a Select in Field action to the field trigger to make a selection in the other field.


talk is cheap, supply exceeds demand
Not applicable
Author

I tried doing exactly that, but can you tell me how exactly? I tried a trigger on ShopId select in field (field PosId) with search string 'min(PosId)'

I got it working as said above. but the problem is that i can still uncheck PosId and ShopId because i do not have the option 'always have one selected value' on. I don't want that to happen.

Gysbert_Wassenaar

but the problem is that i can still uncheck PosId and ShopId

I'm afraid you've lost me. You will always be able to undo a selection. I don't understand the requirement to not be able to do that and I don't know of any way to achieve that.


talk is cheap, supply exceeds demand
Not applicable
Author

you said "You will always be able to undo a selection.". That is exactly what i don't want. I need to have 1 Shop and 1 Pos selected at ANY time.

Gysbert_Wassenaar

If you don't want a user to be able to make a selection then don't load data with any other values than those you want selected. In other words, hard-code your selection in the script with a where clause.


talk is cheap, supply exceeds demand