Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
CUSTOMERS ONLY: Now accepting customer applications for the 2023 Luminary Program: SUBMIT NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
chedly_belkadhi
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
Nicole-Smith

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
Anonymous
Not applicable

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

Nicole-Smith

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.

chedly_belkadhi
Contributor
Contributor
Author

Worked like a charm . Thank you