Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
CNH_1978
Contributor II
Contributor II

Loop in script to confirm QVD has been updated

Hi everyone. 

I am looking for some help to write a simple loop in my script which confirms a QVD has the latest date stamp (QVDCreateTime) before the script exits. 

I have the following which checks the date stamp 

let vQVDPath = 'C:\Users\USER1\Desktop\';
let vToday = date(today(),'DD/MM/YYYY');

if left(date(QvdCreateTime('$(vQVDPath)TestQVD.QVD'),'DD/MM/YYYY'),10) = '$(vToday)' then

SET vResult = 'Yes';

ELSE

SET vResult = 'No';

ENDIF;

What i want to do now is wrap a loop around it so it keeps looping until the condition is met. 

Can anyone help please?

11 Replies
CNH_1978
Contributor II
Contributor II
Author

Hi Kush,

Is there an easy way to add another condition into this script. What i am thinking is, if the reload takes more than 1 hour then exit script. I am concerned that if something happens and the file copy hangs then the script will carry on looping until someone stops it. But we will not know straight away if that happens as the task will still be running. 

Kushal_Chawda

Yes. You can put condition to limit it to loop for one hour from when it got started. But if still condition is not met then do you need to fail the app? Because if you just do exit script it will show successful in task.