Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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