Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
JAN. 24, Q&A with Qlik: Making the Move to Qlik Cloud Reporting: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
reddwarfcrew
Contributor II
Contributor II

Qliksense retain old data on load fail

Hi I have a script which loads data from 3 sources, then transforms the combined data into an output table (while maintaining the existing tables as per initial load).

I've built some error handling so the load continues (as below), but as a reload effectively drops each table, the load ultimately 'fails'.  What I want to do is use the existing data if one of the loads fails with 'last load times' and displayed 'error messages so that the user knows what has happened.

How can I retain the last load on error?

Set ErrorMode = 0;
[Source1]:
Load *
From [lib://source1]
(ooxml,embedded lables, table is Sheet1)

If ScriptError=0 then
   Let Source1Error = 'No Errors on Source 1';
   Let Source1LoadTime = now();
Else
 Let Source1Error = 'Error loading Source 1';
End if;
Set ErrorMode = 1

 

1 Reply
dplr-rn
Partner - Master III
Partner - Master III

Since you are setting the error mode to 0.

Old data (pre reload) not be retained.

I would suggest saving the data qvds  at end of the successful execution of load  script. Then if an error is detected you load the qvds instead so that you get old data