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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
manoranjan_d
Specialist
Specialist

firstsortedvalue

Hi all,

Instead of firstsortedvlue there is any other way to get the max date of the key?

6 Replies
qlikview979
Specialist
Specialist

Hi

try this

Product

Max(Fieldname) as maxdate

from Source

---------- Group by  Product;

Note: after group by write all fields.

Regards

Mahesh

qlikview979
Specialist
Specialist

Hi Try this

T1:

LOAD

     PRODUCT,

     SALES,

  DATE

FROM

New Microsoft Excel Worksheet.xlsx]

(ooxml, embedded labels, table is Sheet1) ;

let Vpeek=peek('DATE',0,'T1');



Regards,

Mahesh

Anonymous
Not applicable

Hello Manoranjan

May be this helps you:

Table1:

Load ID, date from source;

Table2: Load   max (date) as maxdate;

               Resident Table1;

Let MAXDATE= peek('maxdate',0,Table2 );

Thanks & Regards

Chintan Gala

maxgro
MVP
MVP

Another option could be

S:

load * inline [

key, date

1, 01/01/2016

1, 01/01/2015

1, 01/01/2014

2, 01/02/2010

2, 01/02/2016

3, 01/03/2016

];

// join order by key and date desc,

// keep only the first key (max date)

left join (S)

load key, date as maxdate

Resident S

where key <> Peek('key')

order by key, date desc;

Not applicable

Hi,

pls try this, parameter vMD will be filled with the highest date presuming that date is a daynumber (like 40365)


//Determine highest Date
MD: NoConcatenate
LOAD Max(Date) as MD;
LOAD FieldValue('Date', recno()) as Date
AUTOGENERATE FieldValueCount('Date');

let vMD = peek('MD',0,'MD');

good luck!

HtH

P

Not applicable

Hi Chintan,

the fieldvalue way is much more performant especially with large tables.

Try is out and you will see.

Cheers

F.