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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
pavandbs
Contributor III
Contributor III

First and second highest by product in one row

Hello Experts,

Please help to write a set expression for the below output

For each product show in one row

1.Latest Date

2. Latest Purchase Unit

3. Latest Invoice vendor

4. 2nd Latest Date

5. Purchase Unit for the 2nd latest date

6. Invoice Vendor for the 2nd latest date


In one the two lines highlighted in green should show as one row in output by product.


Please note some products may contain null date, invoice vendor also

Problem1.JPG

13 Replies
pavandbs
Contributor III
Contributor III
Author

Hi Sunny,

Glad that you messaged. I have tried hard to get the expected output literally spent 2 days. Got struck with 2nd highest values to pick. Greatly appreciate if you could help on this solution. I guess some null values causing the issue.

Thanks,

Pavan

sunny_talwar

You mentioned that you wanted to get the same output as the image... what is the issue here? Nulls seems to be because of non-existance of 2nd latest date... do you know a case where you know there is a 2nd latest date, but you don't see it on the chart?

Capture.PNG

pavandbs
Contributor III
Contributor III
Author

Sorry I didnt see the attached. Let me check and get back to you

Thanks,

Pavan Ch

pavandbs
Contributor III
Contributor III
Author

awesome. Thanks a lot.