Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dec 16, 2020 6:39:34 AM
Mar 23, 2017 2:53:15 PM
An example scenario:
One has approximately 20 Qlik sense applications which load data from the same source QVD. The QVD file is required to be updated at least once an hour. Should Qlik fail to secure write access on the file, a routine could be used to wait 10 seconds and retry.
SUB StoreQVTable (Table, Path)
SET ErrorMode=0;
Set ScriptErrorCount = 0;
Set RC = 0;
DO WHILE TRUE()
STORE [$(Table)] INTO [$(Path)] (qvd);
IF $(ScriptErrorCount) = 0 THEN
EXIT DO
ELSE
Set ScriptErrorCount = 0;
LET RC=RC+1;
END IF
IF ($(RC) = 10) THEN // If not yet successful, exit script
// CALL consoleLog('ERROR: Failed to save [$(Table)] INTO [$(Path)] after 10 tries.');
TRACE 'ERROR: Failed to save [$(Table)] INTO [$(Path)] after 10 tries.';
SET ErrorMode=2;
Load * from ERROR.qvd;
END IF
// CALL consoleLog('ERROR: Failed to save [$(Table)] INTO [$(Path)]. Try $(rc) of 10.');
TRACE 'ERROR: Failed to save [$(Table)] INTO [$(Path)]. Try $(RC) of 10.';
SLEEP 10000; // wait for 10secs.
LOOP
SET ErrorMode=2;
END SUB
Will this also work for Qlik Sense or does a modification need to be made?
@crichter14 This should work for Qlik Sense as well! 🙂
Is STORE general exceptions errors capture in ErrorCodes. In the previous QlikView versions, it always failed even though we disabled error failure mode ErrorMode=0;