Hello qlikers 🙂 ,
I want to create Backup from my data model every monday. See below for the script. Qlik Sense runs the script every hour. The script with the backup would also run, but in my case the code would run 24 times, so 24 backups - the code should run only one time and only when the script before run without errors.
How can I interrogate the script before if it was correct and when the script was correct he should run the script below and then only agian on the next monday. When the script was with an error then try it agian unitl it was correct.
IF WeekDay(today())= 0 THEN
LET vTimeStamp = TimeStamp(Now());
Trace BACKUP STARTED $(vTimeStamp);
LET vDate = Date(today(),'YYYYMMDD');
FOR vCount = 0 to NoOfTables()-1
LET vTableName = TableName($(vCount));
STORE $(vTableName) INTO [$(vSavePathBackup)$(vTableName)_$(vDate).qvd](qvd);
Trace Saved $(vTableName);
NEXT vCount
vTimeStamp = TimeStamp(Now());
Trace BACKUP FINISHED $(vTimeStamp);
END IF
Thank you in advance! Looking forward to reading some answers! 🙂