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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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,

Labels (1)
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