Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Only load scipt if field update = today

Hi

How can i write the script so that it only continue to load if the field UpDate in the database is the same as Date(Toay())?

I have tested this but don´t get it to work.

Tmp:

Load

Dat,

Info;

SQL Select *

From DB...

Tmp2:

Load

Max(Date(Dat)) as MaxDat

Resident Tmp where Info = 'OK';

Drop table Tmp;

If(Date(MaxDat) = Date(Today()) then.

Load....

Else

Exit script;

EndIf

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Tmp:

SQL Select max(Dat) as MaxDat

From DB...

Where Info = 'OK';

Let vMax = num(peek('MaxDat'));

IF $(vMax) = num(today()) THEN

     // do stuff

ELSE

     exit script;

ENDIF;


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Tmp:

SQL Select max(Dat) as MaxDat

From DB...

Where Info = 'OK';

Let vMax = num(peek('MaxDat'));

IF $(vMax) = num(today()) THEN

     // do stuff

ELSE

     exit script;

ENDIF;


talk is cheap, supply exceeds demand
its_anandrjs
Champion III
Champion III

Hi,

Add a variable to capture the latest update date and load this ways

Load

Dat,

Info;

SQL Select *

From DB...

Tmp2:

Load

Max(Date(Dat)) as MaxDat

Resident Tmp where Info = 'OK';

Drop table Tmp;

LET vMax = peek('MaxDat',0,'Tmp2');

If vMax = Date(Today())  then

LOAD....

Else

Exit script;

EndIf

Regards

Anand