Skip to main content
Answer

Return Fields from Most Recent Record

  • July 7, 2022
  • 1 reply
  • 502 views

Forum|alt.badge.img+1

Hi All - I'm really struggling with a seemingly simple GI. I have the POLine table and I want to get the most recent unit cost for each inventory item. For example, in the filtered result below, I would like only show the circled results.

 

 

 

When I group by InventoryID and apply either a aggregate Max on the order date field or a sort by date, I get the most recent date but I don't get the correct unit cost associated with that PO date. Instead, the cost is a sum of all aggregated records.

 

I can’t use any of the aggregate tools on the unit cost (max, min, avg, etc.) because cost can go up and down - I want the most recent cost. How can I just get the unit cost associated with the most recent record date? Is there any way to do this within a GI? Any help would be greatly appreciate!

 

Best,

Amit

Best answer by amit61

In case anyone else needs to solve this issue, I found a solution that works here:

The solution by Gabriel works like a dream!

1 reply

Forum|alt.badge.img+1
  • Author
  • Jr Varsity II
  • Answer
  • July 14, 2022

In case anyone else needs to solve this issue, I found a solution that works here:

The solution by Gabriel works like a dream!