Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
 alexis
		
			alexis
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I  have a number of Qlik Sense application that I develop and test in 3 different environments
- Desktop
- On-Premise Enterprise 
- SaaS
The FROM statement (see example below) varies from environment to environment. Every time I move environments I go through the laborious task of commenting and uncommenting the right FROM statement - this is very time consuming. Can anyone suggest a better approach:
ProductDescriptions:
LOAD SP_Product,
     SP_ProductDescription
FROM
//[lib://MiscData_Folder (cypapp3_alexis)/Products.xlsx]   //On-Premise Server version
//[lib://MiscData_Folder/Products.xlsx]  // Desktop version
[lib://DataFiles/Products.xlsx] // SaaS environment - everything has to go into the "DataFiles" folder
 
					
				
		
 Mark_Little
		
			Mark_Little
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		HI @alexis
As you suggest in the title, use variables.
I used a similar approach to change my libraries.
//Setup Connection for dashboard state i.e. Development 1=Development, 2=UAT, 3=Production
//SET vState = 1; //Development
//SET vState = 2; //UAT
SET vState = 3; //Production
IF $(vState) = 1 THEN
SET vPath = 'Development';
ENDIF;
IF $(vState) = 2 THEN
SET vPath = 'UAT';
ENDIF;
IF $(vState) = 3 THEN
SET vPath = 'Production';
ENDIF;
then instead of the library name i add the variable $(vPath).
You can put anything in the variable, library or part/full paths. Then you just change the State variable and it loads from the new location.
 
					
				
		
 Mark_Little
		
			Mark_Little
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		HI @alexis
As you suggest in the title, use variables.
I used a similar approach to change my libraries.
//Setup Connection for dashboard state i.e. Development 1=Development, 2=UAT, 3=Production
//SET vState = 1; //Development
//SET vState = 2; //UAT
SET vState = 3; //Production
IF $(vState) = 1 THEN
SET vPath = 'Development';
ENDIF;
IF $(vState) = 2 THEN
SET vPath = 'UAT';
ENDIF;
IF $(vState) = 3 THEN
SET vPath = 'Production';
ENDIF;
then instead of the library name i add the variable $(vPath).
You can put anything in the variable, library or part/full paths. Then you just change the State variable and it loads from the new location.
 
					
				
		
 alexis
		
			alexis
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thanks @Mark_Little for the suggestion - I adapted it to my requirements and works perfectly.
