Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to write a macro which can select a single value from a listbox and then selects mutiple values from the same listbox.
Hi Swati,
You can use the "Toggle Select" action. Here's the description from the F1-help:
Toggle Select | Toggles between the current selection and the specified Field and Search String. In the Search String you can specify a search mask, e.g. (A|B) will select both A and B. |
Hi Johannes,
I tried this but it didn't work. Request you to elaborate on it a bit more.
I have a listbox with some values, and I have a button. On click of this button, I want to select single and mutiple values in the listbox.
What should I mention in the field in case of multiple selections?
Regards,
Swati
Hey Swati,
I'm not quite sure what you mean by selecting single and multiple values. Either you select one, single, or many, multiple.
In the "Field" section you type the name of the field in which you want to make the selections, for example "Year". And then in the Search string box you can type the values that you want to select, for example "(2006|2008|2009)". That should do it.
Please refer to the attached Macro.qvw file. I have a listbox named Scorecard_Data and I have a button named Multiple Selections.
On click of this button, I want multiple values from the listbox to be selected, say, for example, Scope, Category,Comment.
Please show the same in the attcahed qvw file, and send it back to me again.
Thanks & Regards,
Swati
Hi Swati,
First off.. you can't set the listbox to "Always one selected value" and then select more than one value. But here you go, check the attached file.
Hi Johannes,
Thanks for your reply. Its working perfectly fine.
But I didn't get one thing. In the Field, you have mentioned $Field, what does that signify?
I mean had there been mutiple list boxes, and I had to select values from one of those listboxes, how would have we been able to identify that particular listbox? Please explain.
Thanks & Regards,
Swati
Heya Swati,
If you look at the properties for the listbox, there's a little box that says Field and contains the name of the field that you show in the listbox. That's the field that you want to make the selection in.
$Field is a system field in the QlikView document containing the names of all available fields in the document (which is why it's preceded by a dollar-sign)