Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
 jsingh71
		
			jsingh71
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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.........
 
					
				
		
 azimabadi
		
			azimabadi
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
 
					
				
		
 azimabadi
		
			azimabadi
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
 
					
				
		
 azimabadi
		
			azimabadi
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		please notice that vName is not correct and you need to use Name1 instead.
GetUserName = vName.GetContent.String
 
					
				
		
 jsingh71
		
			jsingh71
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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'.
 
					
				
		
 devans_1
		
			devans_1
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Try:
GetUserName = ActiveDocument.Variables("vName").GetContent.String
ActiveDocument.Variables("vAvName").SetContent GetUserName, True
David
 
					
				
		
 azimabadi
		
			azimabadi
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
 
					
				
		
 azimabadi
		
			azimabadi
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		hier is the example.
 
					
				
		
 devans_1
		
			devans_1
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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.
 
					
				
		
 jsingh71
		
			jsingh71
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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??
 
					
				
		
 devans_1
		
			devans_1
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Try:
GetUserName = ActiveDocument.Variables("vName").GetContent.String
CurrUserName = ActiveDocument.Variables("vAvName").GetContent.String
NewUserName = GetUserName & "," & CurrUserName
ActiveDocument.Variables("vAvName").SetContent NewUserName, True
