Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
I have a need to load from one of two source based upon a condition being true or not (specifically, when a back end process fails I need to load from a set of QVD...when it succeeds I need it to load from the database).
IOW: IF(backend fails, LOAD FROM QVD, LOAD FROM DATABASE)
Is this possible in Qlikview?
Also, any suggestions as to how to construct the condition? I was thinking a variable...
 
					
				
		
 adamdavi3s
		
			adamdavi3s
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		where does your backend process failure get recorded?
This is an example and assume errorflag is 1 if it hasn't run, obviously can be tweaked to suit
errorcheck:
LOAD *;
SQL SELECT errorflag
FROM tblfailures where process='xyz' ;
let v_errorcheck=peek('errorflag',0,'errorcheck');
IF $(v_errorcheck) = 1 THEN
Data:
LOAD 'QVD' as source
AutoGenerate(1);
ELSE
Data:
LOAD 'SQL' as source
AutoGenerate(1);
END IF
 
					
				
		
 adamdavi3s
		
			adamdavi3s
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		where does your backend process failure get recorded?
This is an example and assume errorflag is 1 if it hasn't run, obviously can be tweaked to suit
errorcheck:
LOAD *;
SQL SELECT errorflag
FROM tblfailures where process='xyz' ;
let v_errorcheck=peek('errorflag',0,'errorcheck');
IF $(v_errorcheck) = 1 THEN
Data:
LOAD 'QVD' as source
AutoGenerate(1);
ELSE
Data:
LOAD 'SQL' as source
AutoGenerate(1);
END IF
 
					
				
		
Thanks Adam. I think this will work. And in actuality, I don't think you
can have the FROM statement just point to one source or another since you
need a preceding load for the DB load v the QVD load. Thanks!
On Fri, Mar 10, 2017 at 9:40 AM, Adam Davies <qcwebmaster@qlikview.com>
 
					
				
		
 adamdavi3s
		
			adamdavi3s
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		cool, I did just tweak my answer to correct the syntax but glad it will work for you  or at least give you the idea to work from
 or at least give you the idea to work from
