Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
If yes, then how? Need something like this:
ActiveDocument.Variables.Create("myNewVariable")
ActiveDocument.CreateVariable("MyVariable")
For what it's worth, here's the standard bit of code I use in my QV Modules for setting, getting and creating Variables.
Rem *** Returns a Variables content as String
Function GetVariableString(varname)
GetVariableString = GetVariable(varname).GetContent.String
End Function
Rem ** Gets a variable and creates it if it doesn't exist
Function GetVariable(varname)
If typename(ActiveDocument.GetVariable(varname)) <> "Variable" Then
ActiveDocument.CreateVariable(varname)
ActiveDocument.GetVariable(varname).SetContent "", True
End If
Set GetVariable = ActiveDocument.GetVariable(varname)
End Function ' GetVariable
Rem ** Sets a Variable's value
Sub SetVariable(varname, value)
GetVariable(varname).SetContent value, False
End Sub
-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com