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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
dmohanty
Partner - Specialist
Partner - Specialist

Max of a Date - in LOAD Script

Hi All,

I have a data set like this below:

I want to write LOAD script, so that it would fetch the Max(CONFIRM_CREATE_DTE) and I will have one record: 02/14/2012.

I have already tried using MAX() and First Sorted Value, but in vain.

Could someone please help here?

10 Replies
linusblomberg
Creator II
Creator II

Depending on your data amount I would add an extra step for performance otherwise you can skip TempDates.

TempDates:

Load distinct CONFIRM_CREATE_DTE

resident YOURTABLE;

VarTemp:

LOAD

     Max(CONFIRM_CREATE_DTE) as MaxDate

Resident TempDates;

LET vMaxDate = peek('MaxDate');

Drop Tables TempDates,VarTemp;

Now you have on variable with your value. if you want it in your table do a resident load again and add your variable.