Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE

How to handle connection Errors in Qlik

cancel
Showing results for 
Search instead for 
Did you mean: 
OmarBenSalem

How to handle connection Errors in Qlik

Last Update:

Jun 14, 2022 8:52:54 AM

Updated By:

Sonja_Bauernfeind

Created date:

Jan 22, 2018 8:55:07 AM

 

Hi folks, as obvious with its title, we'll discuss in this article a simple method to handle some errors in Qlik.

photodune-6426830-error-xs.jpg

To explain today's aim in better words , we sometimes, due to some performance issues, have throwns errors while trying to connect to our source (especially when it comes to Web Services... that was the case for me unfortunately !)
But, when I try to connect again, the connection is made..

So basically, sometimes, if we wait a little bit, and try to perform the connection again, it works... (strange, but true !)
With that in mind, and as Qlikers know, in case of an error, Qlik will automatically stop the data reloading process.. and thus, the application won't be reloaded due to a performance issue...

Now just imagine, that this was a nearly every day thing, and so, each day, you'll be surprised by the failure of the reloading task of your application (due to performance issues) and having to face angry emails from users not happy with the application not up to date... Yeah, not the best way to start a day !

But, every problem has its solution; and the best way to counter this one, is to handle this error the right way.
So basically, instead of having an error, It would be better to automatically try to connect again and again untill the connection is made. With that, we'll be sure the application is reloaded and that users are happy.

How to?

img-preventablecauses-ITdowntime.png

No, not like that but instead?
=> A combination of ErrorMode and scripterror

LET ErrorMode=0; //With this, Qlik won't kill the reloading process if there is an error

Load * from yourSource; // try to connect to ur source and import data

if ScriptError >0 //if there an error

then

for vLoop=1 to 10
sleep 5000; // wait 5 seconds and try to reconnect untill the connection is made
Load * from yourSource;

if scripterror=0 then //if there is no error, we don't try to reconnect
exit for
EndIf
Next
EndIf
LET ErrorMode=1; //roll back to the normal Qlik's behaviour when It comes to handling errors

How to handle connection Errors in Qlik by Omar BEN SALEM. | LinkedIn

 

Ce document a été généré à partir de la discussion suivante :How to handle connection Errors in Qlik

Labels (1)
Comments
juan_troielli
Partner - Contributor II
Partner - Contributor II

This is super useful! I am having issues with a database that fails randomly and this solve the way I handle the issue. Thanks very much!

OmarBenSalem

My pleasure

Version history
Last update:
‎2022-06-14 08:52 AM
Updated by: