Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
try like this:
Load Max(Transaction) as MaxDate
From ......;
Let vDate= Peek('MaxDate');
If( Date(today())>Date($(vDate)) ) Then
Exit Script;
Else
....;
LOAD Transaction
FROM
Desktop\Sales\Info
(txt, codepage is 1252, embedded labels, delimiter is '\t', msq)where Transaction<=Today();
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');
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
try like this:
Load Max(Transaction) as MaxDate
From ......;
Let vDate= Peek('MaxDate');
If( Date(today())>Date($(vDate)) ) Then
Exit Script;
Else
....;
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