Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
 jduenyas
		
			jduenyas
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hello gurus
I have created a new document with a Binary load from an existing one.
However, variables are not being copied/transferred with the Binary load.
Is there a way to copy all variables (i have many of them) from the existing document to the new?
Thanks
 petter
		
			petter
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		This is how you can retrieve the variable info:
VARIABLE:
LOAD 
    Name,
    IsConfig,
    IsReserved,
    RawValue
FROM 
  [C:\Program Files\QlikView\Examples\Documents\Getting Started.qvw] 
  (XmlSimple, Table is [DocumentSummary/VariableDescription]); 
					
				
		
 rwunderlich
		
			rwunderlich
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		This blog post contains the code to both load and recreate the variables: https://qlikviewcookbook.com/2018/06/loading-variables-from-another-qvw/
 petter
		
			petter
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Yes the variables are not part of the data model of QlikView or Qlik Sense.
And yes there is a way of getting hold of the variables by reading them from the QVW-file. The QVW-file has an XML-section where the variables are accessible.
You will have to read the QVW-file from a load script with a LOAD statement using XML as the file format. Then you will get all the variables into a table. The table can be parsed with a simple FOR loop afterwards to recreate each and every variable.
 petter
		
			petter
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Another approach is to make a QlikView macro with either VBScript or JScript (JavaScript). There is an API that let you manipulate and read anything in a QlikView document - variables are also fully accessible this way.
Furthermore there are applications being made as "open-source" to do the job:
 
					
				
		
 jduenyas
		
			jduenyas
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thanks.
A little more help... Using QlikView not QlikSense
Where can the XML section be found?
 petter
		
			petter
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		This is how you can retrieve the variable info:
VARIABLE:
LOAD 
    Name,
    IsConfig,
    IsReserved,
    RawValue
FROM 
  [C:\Program Files\QlikView\Examples\Documents\Getting Started.qvw] 
  (XmlSimple, Table is [DocumentSummary/VariableDescription]); 
					
				
		
 jduenyas
		
			jduenyas
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		You are the BEST!!!
Thanks for your help
 
					
				
		
 rwunderlich
		
			rwunderlich
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		This blog post contains the code to both load and recreate the variables: https://qlikviewcookbook.com/2018/06/loading-variables-from-another-qvw/
 
					
				
		
 jduenyas
		
			jduenyas
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thank you Rob.
You always come through!
What would we do without you? 😊
 sayalip
		
			sayalip
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		That script helps to get variables in application but my question is how we can create variable in application . Any suggestions?
 sayalip
		
			sayalip
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I am using that script i have imported 100 variables now i want a script using that i can create all variable in my application instead of manual work. is it possible.
