Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I wrote the macro code for a button to get the current selection in listbox .Like this
SUB GetSelectedValues
SET id= ActiveDocument.Fields("V_Id")
SET selection = id.GetSelectedValues
if selection.Count=1 then
msgbox(selection(i).Text)
end if
END SUB
When I click the button ,I need to store the macro variable ( selection) to a qlikview variable which I'll use later in load/select query in edit script.For example if I assigned the macro variable (selection) to a qlikview variable(say 's'),then the select query would be like this.
select * from table1 where V_Id=$(s);
suggest me a correct prodecure in assigning macro variable to qlikview variable.
Please help me in solving this.Thanks!!
I think no need of writing a macro for this. we can use the function... GetFieldSelections(Field_Name).
I am assuming that, you need to get the current selected value in the variable.
After selection of any value I need to click the 'submit' button.After that only the selected values get assigned to qlikview variable.Then I need to use the variable in where clause like this
select * from table1 where V_Id=$(s);
I don't have any idea of using the GetFieldSelections(Field_Name) in button properties.hence I went for macro
We can set a variable using button actions. Here is the process..
Button Properties--> Actions --> Add --> External --> Set variable --> Ok
Varaible : Variable Name
Value : value need to be assigned to the variable.. we can use GetFieldSelections(field_name) function here.
Thanks,
Pradeep
Hi Pradeep,
I done as you said.getting the error like this

