Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

Get Max Date For Each id

Hi

Consider the joined File containing four fields , I'm trying to get, for each ID_FACTURE , the maximum date DATE_ENCAISSEMENT .

To be sure Im being clear : lets say each ID_FACTURE has 10 occurences, i want to keep one line only with the max DATE_ENCAISSEMENT.

Any help would be much appreciated

Thanks in advance

1 Solution

Accepted Solutions
Highlighted

Re: Get Max Date For Each id

You could do it in the load script like this:

Data:

LOAD ID_FACTURE,

ID_ENCAISSEMENT,

DATE_ENCAISSEMENT,

MONTANT_ENCAISSEMENT

FROM Data.txt (txt, codepage is 1252, embedded labels, delimiter is '|', msq);

INNER JOIN (Data)

LOAD ID_FACTURE,

MAX(DATE_ENCAISSEMENT) AS DATE_ENCAISSEMENT

RESIDENT Data

GROUP BY ID_FACTURE;

I've also attached an example file.

View solution in original post

3 Replies
Highlighted
Anonymous
Not applicable

Re: Get Max Date For Each id

try firstsortedvalue(distinct ID_FACTURE, -DATE_ENCAISSEMENT)

--> of course you'll have to use this in combination with group by in script or dimension(s) in frontend

Highlighted

Re: Get Max Date For Each id

You could do it in the load script like this:

Data:

LOAD ID_FACTURE,

ID_ENCAISSEMENT,

DATE_ENCAISSEMENT,

MONTANT_ENCAISSEMENT

FROM Data.txt (txt, codepage is 1252, embedded labels, delimiter is '|', msq);

INNER JOIN (Data)

LOAD ID_FACTURE,

MAX(DATE_ENCAISSEMENT) AS DATE_ENCAISSEMENT

RESIDENT Data

GROUP BY ID_FACTURE;

I've also attached an example file.

View solution in original post

Highlighted
Contributor
Contributor

Re: Get Max Date For Each id

Worked like a charm . Thank you