Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
Hi
I have a requirement where I should create variables dynamically.
The variable names along with its value will be entered in a Excel sheet. Have attached the sample Excel file for reference.
There will be two columns in the Excel file. First column will have the variable name and second column will have the value to be assigned to the variable.
In qlikview i should create the variables and assign them the values entered in the Excel.
Note: The number of variables may change. Number of variables may increase each day.
Is there a way to do so? Please help me on this.
Thanks in advance 
 
					
				
		
 svenkita
		
			svenkita
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		you will have to do it via macros
Check this link out
Importing and exporting variables - The Qlik Fix! The Qlik Fix!
 tresesco
		
			tresesco
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		
VarTable:
Load * Inline [
VariableName,Value
vVariable1,1
vVariable2,25
vVariable4,74
vVariable7,4
vVariable8,55
];For i=1 to NoOfRows('VarTable')
let vName=Peek('VariableName',-$(i));
Let '$(vName)'=Peek('Value', -$(i));
Next i

 
					
				
		
 gautik92
		
			gautik92
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Set vVariable1=1
Set vVariable2=25
and so on
 
					
				
		
 svenkita
		
			svenkita
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		this I found in qlikfix and is 100% match with what you are looking for
The import and export of variables are done via macors
attached is the sample copy both the file to the same folder and try it out
 
					
				
		
Thanks everyone for the help 
 
					
				
		
 ankitbisht01
		
			ankitbisht01
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Nice solution , also worked like this
For i=0 to NoOfRows('VarTable')
let vName=Peek('VariableName',$(i));
Let '$(vName)'=Peek('Value', $(i));
Next i
Thank You.
 barryharmsen
		
			barryharmsen
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Very nice that people are looking at my blog for solutions  In this case though, I'd like to suggest another post from my blog which does exactly what you ask:
 In this case though, I'd like to suggest another post from my blog which does exactly what you ask:
Storing variables outside of QlikView - The Qlik Fix! The Qlik Fix!
Kind regards,
Barry
