Skip to main content
Announcements
Get Ready. A New Qlik Learning Experience is Coming February 17! LEARN MORE
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

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

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

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