Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
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