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: 
Marcushenriquesk

Load max Date value that is less then or equal to Now();

basically I am attempting to create a incremental load script for a app I am working on and im trying to make a load function to incrementally update without a modified date(not available in our database). I am instead using other date fields that are within our database that are considered event dates for a row. Since these events are user inputted there can sometimes be dates that are not correct. To bypass this user error i am trying to load a max date where the max date is less then the date now. However with this script i am returning null values.

 

LET vTodayTY = Timestamp(Now(), 'MM/DD/YYYY hh:mm:ss');

MAX_DATE_TABLE:
Load Max(PRINTED_DATE) as MaxValue
from [lib://QVDs (adny1qlik01_qlikservice)/REQUISITIONS.qvd](qvd)
WHERE PRINTED_DATE < '$(vTodayTY)';

LET vMaxValue = TEXT(Timestamp((peek('MaxValue',0, 'MAX_DATE_TABLE')), 'yyyy-MM-dd hh:mm:ss'));

1 Solution

Accepted Solutions
sunny_talwar

Try this

LET vTodayTY = Num(Now());

MAX_DATE_TABLE:
Load Max(PRINTED_DATE) as MaxValue
from [lib://QVDs (adny1qlik01_qlikservice)/REQUISITIONS.qvd](qvd)
WHERE PRINTED_DATE < $(vTodayTY);

LET vMaxValue = TEXT(Timestamp(Peek('MaxValue', 0, 'MAX_DATE_TABLE'), 'yyyy-MM-dd hh:mm:ss'));

View solution in original post

2 Replies
sunny_talwar

Try this

LET vTodayTY = Num(Now());

MAX_DATE_TABLE:
Load Max(PRINTED_DATE) as MaxValue
from [lib://QVDs (adny1qlik01_qlikservice)/REQUISITIONS.qvd](qvd)
WHERE PRINTED_DATE < $(vTodayTY);

LET vMaxValue = TEXT(Timestamp(Peek('MaxValue', 0, 'MAX_DATE_TABLE'), 'yyyy-MM-dd hh:mm:ss'));
Marcushenriquesk
Author

Thank you this solution worked and was implemented~!