Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Error handling with backup

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! 🙂 

 

 

Labels (1)
0 Replies