Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 mohan2391
		
			mohan2391
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
I have a requirement where the reload of QVW should stop when the size of QVD which I am loading in the QVW is zero.
How to achieve this ?
Thanks in advance
 vvvvvvizard
		
			vvvvvvizard
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		if QvdNoOfRecords('Qvd name')<=0
EXIT SCRIPT
ELSEIF store qvd into path.qvd(qvd);
ENDIF
 shiveshsingh
		
			shiveshsingh
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Before loading statement, you need to put below condition to check..
IF (qvdNoOfRecords('$(Path)') <= 0) THEN
 Peter_Cammaert
		
			Peter_Cammaert
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		If you want a task furter up in the QMC chain to not run when a QVD is found to be empty, let your script crash if you detect no loaded rows. I often use a self-invented statement called CRASH; to do this  , because QlikView doesn't supply something similar. Your script then becomes
, because QlikView doesn't supply something similar. Your script then becomes
TableSomething:
LOAD * FROM SomeFile (SomeOptions);
IF NoOfRows('TableSomething') = 0 THEN
  CRASH;
END IFOf course, the task will fail and you will get an appropriate email scream from the QDS. But the second task will not run.
 vvvvvvizard
		
			vvvvvvizard
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		if QvdNoOfRecords('Qvd name')<=0
EXIT SCRIPT
ELSEIF store qvd into path.qvd(qvd);
ENDIF
 shiveshsingh
		
			shiveshsingh
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Before loading statement, you need to put below condition to check..
IF (qvdNoOfRecords('$(Path)') <= 0) THEN
 Peter_Cammaert
		
			Peter_Cammaert
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		As a second method, you can leave the LOAD logcic unchanged and add a test after the LOAD statement has been executed. Although the overhead of loading the XML header twice is not that large, you skip at least one of them. E.g.
TableSomething:
LOAD * FROM SomeFile (SomeOptions);
IF NoOfRows('TableSomething') = 0 THEN
  EXIT SCRIPT;
END IF
 mohan2391
		
			mohan2391
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
Thanks for your quick reply.
I forgot to mention 1 point, so please let me know if this code satisfies that or no.
Missed Point: I have 2nd QVW which runs after successful run of 1st QVW(here in 1st qvw, we are writing that above code) one.
So my requirement is that the 2nd QVW also should not run if the QVD size is zero along with the failure of 1st QVW.
So the code which you suggested can work for my other requirement as well ?
 mohan2391
		
			mohan2391
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thanks for your reply, same question to you as well.
I forgot to mention 1 point, so please let me know if this code satisfies that or no.
Missed Point: I have 2nd QVW which runs after successful run of 1st QVW(here in 1st qvw, we are writing that above code) one.
So my requirement is that the 2nd QVW also should not run if the QVD size is zero along with the failure of 1st QVW.
So the code which you suggested can work for my other requirement as well ?
 shiveshsingh
		
			shiveshsingh
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		If your code will exit after checking first qvd then it'll not go to script further.
 mohan2391
		
			mohan2391
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		it will not go to the further script in the SAME qvw (that means in 1st QVW)
But my question is, I have 2 QVWs. In QMC, there are 2 tasks created on these and there is task dependency created between them so that 2nd QVW will start run once 1st qvw runs successfully.
In the 1st QVW, I want to check QVD size is zero or not. If it is zero it should stop immediately AS WELL AS it SHOULD NOT allow 2nd QVW to run. So the 2nd QVW will run or no if I use your code and the QVD size is zero ?
 Joost_d
		
			Joost_d
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		
DataFromQvd1:
Load 
  * 
from Qvw1;
//If you have publisher, use variable below in QMC
Let vNoOfRecords =NoOfRecords() ;
Store DataFromQvd1 into DataFromQvd1.qvd (qvd);
//running second Qvw conditionally
Let NoOfQvd1Records= QvdNoOfRecords(DataFromQvd1);
If $(NoOfQvd1Records) >0 then
     //Run Second Qvw
     DataFromQvd2: 
     Load * from Qvw2;
     Store DataFromQvd2 into DataFromQvd2.qvd (qvd);
Else
    //Exit Script               
Endif
					
				
			
			
				
			
			
			
			
			
			
			
		 mohan2391
		
			mohan2391
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I am using binary load of 1st qvw in 2nd qvw
