Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
srinivas1921
Contributor III
Contributor III

How to pass a variable to macro in qlikview?

Hi,

I have created a variable for company and I also created a button to pass this variable to micro in my application. I couldn't pass this variable to macro  when I click on button.


Please provide macro to pass a variable and suggest solution on this.

Many thanks in advance.

4 Replies
tresesco
MVP
MVP

Try like:

set v = ActiveDocument.GetVariable("vMyVariable")

srinivas1921
Contributor III
Contributor III
Author

Hi Amit,

I already tried this but it was not working...

santiago_respane
Specialist
Specialist

Hi,

i use a function as follows:

'Function declaration

FUNCTION getVariableValue(varName)

     set v = ActiveDocument.Variables(varName)

     getVariableValue = v.GetContent.String

END FUNCTION

'Function use example

sub x

     myVarValue = getVariableValue("v.MyVarName")

     msgbox myVarValue

end sub

Please let me know if this helps.

Kind regards,

spring101
Contributor III
Contributor III

This function helped me. Thanks!