Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

cwitman1
New Contributor III

If Data connection exist for DB then...Logic

Is there a way to write a load script that checks if a DB connection is there, and if it is then load that data. If not move on?

Thanks,

1 Solution

Accepted Solutions
Khan_Mohammed
Honored Contributor II

Re: If Data connection exist for DB then...Logic

Must Include statement?

LET vInclude_Filename = '.\Includes\DBConnection.txt';

LET vInclude_Directory = '.\Includes\Variables.txt';

TRACE <LOG> Attempting to INCLUDE file [$(vInclude_Filename)];

IF IsNull (FileTime( vInclude_Filename )) THEN;

TRACE File doesnt exist [ $(vInclude_Filename) ];

EXIT SCRIPT ;

END IF;


$(must_include=$(vInclude_Filename));

TRACE ('[$(vInclude_Filename) ] file was found and incorporated into script');

$(must_include=$(vInclude_Directory));

This would throw error if it doesn't find a DB file.

Or are you looking for a real time B string access?

2 Replies
Khan_Mohammed
Honored Contributor II

Re: If Data connection exist for DB then...Logic

Must Include statement?

LET vInclude_Filename = '.\Includes\DBConnection.txt';

LET vInclude_Directory = '.\Includes\Variables.txt';

TRACE <LOG> Attempting to INCLUDE file [$(vInclude_Filename)];

IF IsNull (FileTime( vInclude_Filename )) THEN;

TRACE File doesnt exist [ $(vInclude_Filename) ];

EXIT SCRIPT ;

END IF;


$(must_include=$(vInclude_Filename));

TRACE ('[$(vInclude_Filename) ] file was found and incorporated into script');

$(must_include=$(vInclude_Directory));

This would throw error if it doesn't find a DB file.

Or are you looking for a real time B string access?

Khan_Mohammed
Honored Contributor II

Re: If Data connection exist for DB then...Logic

It is better to have a Load status view in your DB.

Where Load Status = C would start the qlik load

Where Load Status = F would do nothing.

And this qvw can be 1st task than ny other qvw's

Community Browser