Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

Select a listbox value based on a variable's value

Hi,

First things first, I am a huge fan of the the Qlik community and have learnt to solve a lot more problems and understood concepts more than I have from any other source on Qlikview .Kudos to you guys who help out and I hope to get enough acquainted to pitch in my 2 cents sometime soon.


I have a question on how to choose a value in a list box based on a variable's value.

I.e I have a list box with values a,b,c and I have a variable var=a. I would like to set the list box to select to 'a'

Page 1 has a command button which will set var to a and page 2 has the list box.

I have tried a couple of combinations to achieve this without success. Any or help would be much appreciated.

Thank you

1 Solution

Accepted Solutions
Highlighted
MVP
MVP

Re: Select a listbox value based on a variable's value

OnInput variable trigger with a Select in field action worked for me.

Alternatively, try a button trigger.

See attached.

View solution in original post

9 Replies
Highlighted
MVP
MVP

Re: Select a listbox value based on a variable's value

Maybe use a trigger (e.g. a button trigger or a OnInput/OnChange variable trigger) with a Selection - Select in field action.

Use the list box field to select in an as search string:

=var

Highlighted
Contributor
Contributor

Re: Select a listbox value based on a variable's value

Dear Mr, Wuhl,


Thank you for your input.

I tried both OnInput and Onchange variable trigger. No luck. Could I try a different option.

Thanks

Highlighted
MVP
MVP

Re: Select a listbox value based on a variable's value

OnInput variable trigger with a Select in field action worked for me.

Alternatively, try a button trigger.

See attached.

View solution in original post

Highlighted
Master II
Master II

Re: Select a listbox value based on a variable's value

Please see the attached and hope this is what you are looking for:

SelectInField_Using_Button.jpg

Highlighted
Contributor
Contributor

Re: Select a listbox value based on a variable's value

Perfect ! This works Mr.Wuhl. Thank you.

Just that I have a hierarchy within my list box and thus when I have a 'Activate Sheet' trigger in my hierarchy to navigate to another sheet it doesn't seem to work.

I had 'Always one selected' on the list box properties before in which case 'Select in field' Action doesn't seem to work. Is it possible to have a work around on this one ?

Please find the sample attached for the same.

Thanks

Best,

Harini

Highlighted
Specialist
Specialist

Re: Select a listbox value based on a variable's value

Perhaps this one?

Input your value for the variable, var, and click the button.

HTH,

John

Highlighted
Contributor
Contributor

Re: Select a listbox value based on a variable's value

Thank you for your response Mr. Dandamudi. This solution seems to work as well. But I am hoping to set the variable from within the command which I was able to succeed in doing.

As an extension, I am trying to work to resolve the same selection from within a list box.

Please find the attachment where I have a hierarchy within a list box and I'm trying to select each value from within the hierarchy which should direct me to a page of its own. Right now this doesn't seem to work. Please share your thoughts on the same.

Thanks.

Highlighted
Master II
Master II

Re: Select a listbox value based on a variable's value

Please see the attached file and hope this is what you are looking for ....

For example, If you select 'A' in the hierarchy it will go to the Sheet1. If you select 'B' in the hierarchy it will go to the Sheet2 and so on ... I used the Field Event Triggers to accomplish this. Hope this helps...

Highlighted
Partner
Partner

Re: Select a listbox value based on a variable's value

Hi,

Can you check attached qvw file.

I hope it will be helpful for you.

Thanks,

Muni