Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Compare dates and exit script

Good day,

I need to add a piece in my script that will compare a date
in my txt file (see below) and if today's date is bigger than that date
Qlikview must "exit script"

LOAD Transaction
FROM

Desktop\Sales\Info

(
txt, codepage is 1252, embedded labels, delimiter is '\t', msq);

the result from this load will be 2013\08\10, so if today's date is bigger, the script must exit

Please help

Thanks a lot

1 Solution

Accepted Solutions
tresesco
MVP
MVP

try like this:

Load  Max(Transaction) as MaxDate

From ......;

Let vDate= Peek('MaxDate');

If( Date(today())>Date($(vDate)) ) Then

Exit Script;

Else

....;

View solution in original post

5 Replies
er_mohit
Master II
Master II

LOAD Transaction
FROM

Desktop\Sales\Info

(
txt, codepage is 1252, embedded labels, delimiter is '\t', msq)where Transaction<=Today();

MayilVahanan

Hi

Try like this

Load

Transaction
FROM
Desktop\Sales\Info
(
txt, codepage is 1252, embedded labels, delimiter is '\t', msq) where Transaction <= Date(Today(),'YYYY\MM\DD');

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Chick this out:

// Make a table just for calcultating the variable:

Check:

NoConcatenate LOAD

Transaction

Resident YourTable

Order By transaction desc;

//Calculate the variable:

LET varCheck = Peek('Transaction',0);

//We don't need the tble anymore:

DROP Table Check;

IF ($(varCheck)>&(Today())) then

    TRACE Exiting...;

    Exit Script;

ENDIF

tresesco
MVP
MVP

try like this:

Load  Max(Transaction) as MaxDate

From ......;

Let vDate= Peek('MaxDate');

If( Date(today())>Date($(vDate)) ) Then

Exit Script;

Else

....;

Not applicable
Author

Thanks a lot, it worked.

Why did this not work though?

Date:

LOAD date(Transaction) as Transaction
FROM
Info (
txt, codepage is 1252, embedded labels, delimiter is '\t', msq);

CheckDate:
LOAD Transaction
Resident Date;

LET CheckDate = Peek('Transaction',0);
LET CheckToday = Today();

DROP Table CheckDate;

IF ($(CheckDate)<=$(CheckToday)) then
Exit Script;

ENDIF