Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I created two qlikview variables 'vName' and 'vAvlName'.
through macro I am getting the value from qlikview variable 'vName'.
Now in 'GetUserName' variable i got the value.
Now I want to assign this value to qlikview variable 'vAvlName'.
How can I assign this value from macro to qlikview variable.
Please help.........
Sub DispName
set Name1 = ActiveDocument.Variables("vName")
set Name2 = ActiveDocument.Variables("vAvlName")
GetUserName = Name1.GetContent.String
GetOldUserName = Trim(Name2.GetContent.String)
if ( GetOldUserName <> "" ) then
tmpString = GetOldUserName & "," & GetUserName
else
tmpString = GetUserName
end if
Name2.SetContent tmpString , true
End Sub
Hi Amit,
It is as simple as following :
Sub DispName
set Name1 = ActiveDocument.Variables("vName")
set Name2 = ActiveDocument.Variables("vAvlName")
GetUserName = Name1.GetContent.String
Name2.SetContent GetUserName , true
End Sub
Best regards - Peyman
please notice that vName is not correct and you need to use Name1 instead.
GetUserName = vName.GetContent.String
Thanx for your reply.
but this was not a correct answer which i am looking.
Actually I have 'vName' qlikview variable and one more 'vAvlName' qlikview variable.
I am getting vName value through Macro and want to assign this value into qlikview variable 'vAvlName'.
Try:
GetUserName = ActiveDocument.Variables("vName").GetContent.String
ActiveDocument.Variables("vAvName").SetContent GetUserName, True
David
That is exactly what this macro do. Please use my code in your madule and test it yourself. I'll post an example QVW asap.
Best regards - Peyman
hier is the example.
Yes, it is basically the same as what you wrote Peyman. I think it should work. I have used similar code on many occasions and never had a problem.
Thank you very much Peyman and David.
Please refer VARs.qvw
one last thing I want to know then I mark this disscussion as Answered.
Suppose first I enter name 'Qlik' and clik on button then 'Qlik' will display in text object.
Now I enter 'View' and when I click on button then I want Qlik, View as displayed in Text box.
How I concatenate previous word into new word??
Try:
GetUserName = ActiveDocument.Variables("vName").GetContent.String
CurrUserName = ActiveDocument.Variables("vAvName").GetContent.String
NewUserName = GetUserName & "," & CurrUserName
ActiveDocument.Variables("vAvName").SetContent NewUserName, True