Skip to main content
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

1 Solution

Accepted Solutions
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

View solution in original post

13 Replies
Anil_Babu_Samineni

Please attach Excel file?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
pavandbs
Contributor III
Contributor III
Author

Attached for your reference.

Anil_Babu_Samineni

PFA

Capture.PNG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
pavandbs
Contributor III
Contributor III
Author

Hi Anil,

Thanks for your reply this works fine if I select only one product. Attaching actual QVW which having multiple products.

Anil_Babu_Samineni

V1 Attached

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
pavandbs
Contributor III
Contributor III
Author

Hi Anil,

Still no luck when I replicate your expressions in my original document. Can you try the same on my very first comment.

Thanks,

Pavan Ch

Anil_Babu_Samineni

Just to understand, Can we discuss use case? If we select one product which you known the associate answer then what you are going to have to see?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
pavandbs
Contributor III
Contributor III
Author

Hi Anil,

I did not quite get you, basically if you open my Probolem 3.qvw the solution you provided still not working. It works if I restrict selection to only one product. If I do clear its not working. In problem 3 .qvw first sheet image is the expected out.

sunny_talwar

May be check the attached