Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Query on formula for max date,2

I am trying to write an expression that combines the ability to find the 2nd maximum actiondate and then give the sum of measurement value from this record.

Max([Measurement actionDate],2)

SUM(Measurement measurementValue)

I can obtain the 2nd max date without any issues using the first part of the expression but cannot sum on that record.
Any ideas please?

Thanks,

2 Replies
Not applicable
Author

Managed to work it out in the end through Set Analysis if anyone is interested.

({<[Measurement actionDate]={'$(=max([Measurement actionDate],2))'}>} [Measurement measurementValue])

aveeeeeee7en
Specialist III
Specialist III

Try this Code:

AAA:

LOAD ID,

    Date(Max(Date,2),'DD/MM/YYYY') AS [Max Measurement actionDate]

    From

Sample1111.qvd

(qvd) Group By ID;

Left Join

LOAD

    Date(Date,'DD/MM/YYYY') AS [Max Measurement actionDate],

    [Measurement measurementValue]

FROM

Sample1111.qvd

(qvd);

See the Attachment

Regards

Aviral Nag