AugForums.com

An Acumatica User Group

  • Free
    • Start Here
    • Rolodex
    • Podcast
    • Blog
    • Forums
  • Paid
    • AugSQL
    • GI Course
    • GI Library
    • Consulting
  • Register
Acumatica Forums

By using this website, you agree to our Terms of Use (click here)

Forums
AUG Forums
Acumatica Generic I...
Return Fields from ...
 
Notifications
Clear all

Questions Return Fields from Most Recent Record

 
Acumatica Generic Inquiries & Pivot Tables
Last Post by Dianne A 3 years ago
9 Posts
3 Users
3 Reactions
2,124 Views
RSS
agupta
Posts: 15
 agupta
Topic starter
July 7, 2022 4:39 pm
(@agupta)
Eminent Member
Joined: 5 years ago

Hi All - I'm really struggling with a seemingly simple GI. I have the POLine table and I want to get the most recent cost for each inventory item. When I group by InventoryID and apply aggregate Max on the order date field, 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. How can I just get the unit cost associated with max date? Is there any way to do this within a GI? Any help would be greatly appreciate!

 

Best,

Amit


8 Replies
agupta
Posts: 15
 agupta
Topic starter
July 11, 2022 5:28 pm
(@agupta)
Eminent Member
Joined: 5 years ago

Here's a little bit more color:

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.

image

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.

image

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!


Reply
Royce Lithgo
Posts: 557
 Royce Lithgo
July 11, 2022 7:20 pm
(@roycelithgo)
Honorable Member
Joined: 6 years ago

Pretty sure what you want to do above can't be done in GI for the reasons you encountered.

Why don't you just take the price from the Item directly?

image

This assumes you set AP Preferences Supplier Price Update to On PO Entry.

image

And the price is tracked per supplier, which may not be what you want. 


Reply
agupta
Posts: 15
 agupta
Topic starter
July 11, 2022 9:46 pm
(@agupta)
Eminent Member
Joined: 5 years ago

Hi Royce,

Thanks for the reply. We have the system setup like that already. However, getting price from the item is a manual process and you have to look at each item individually. I'm trying to create a view that contains the latest costs in one screen.

Additionally, I was planning on using this GI as a data provider on an import scenario to update the standard costs for non-stock items. As such, having it be as automated as possible would be preferred.


Reply
Royce Lithgo
 Royce Lithgo
(@roycelithgo)
Joined: 6 years ago

Honorable Member
Posts: 557
July 12, 2022 3:12 am
Reply toaguptaagupta

@agupta I'm suggesting to write your GI based on selecting the data from the Item (POVendorInventory DAC). You won't be able to get the required outcome from POLine as you are attempting.


Reply
Andrew Garcia reacted
agupta
Posts: 15
 agupta
Topic starter
July 12, 2022 6:57 am
(@agupta)
Eminent Member
Joined: 5 years ago

Hi Royce, 

thanks again for the suggestions! The same issue remains even with that table. When items have multiple vendors, this table will return multiple rows for each item. This means you have to select the row with the most recent last modified date and then get the cost related to that row. It’s the same issue as using POLines.


Reply
Dianne A
Posts: 23
 Dianne A
July 12, 2022 8:25 am
(@dianne-a)
Eminent Member
Joined: 5 years ago

Hi Amit,

I've used the solution of joining a table to itself to get the latest record as shown in this Acumatica community post - https://community.acumatica.com/reports-and-generic-inquires-115/how-to-get-the-last-sales-price-and-qty-using-gi-4856

I didn't fully digest the details you posted so it might be a different scenario, but hopefully that solution can provide some help.

Dianne


Reply
agupta reacted
agupta
Posts: 15
 agupta
Topic starter
July 12, 2022 11:05 am
(@agupta)
Eminent Member
Joined: 5 years ago

Dianne - Thank you so much!!! I had been testing out various ways to do self-join but using the null condition never occurred to me. GOLD STAR TO YOU!


Reply
Dianne A
 Dianne A
(@dianne-a)
Joined: 5 years ago

Eminent Member
Posts: 23
July 12, 2022 11:17 am
Reply toaguptaagupta

@agupta You're welcome! Though I can only take credit for pointing you to someone else's solution 😀


Reply
Tim Rodman reacted
Forum Jump:
  Previous Topic
Next Topic  
Forum Information
Recent Posts
Unread Posts
Tags
  • 12 Forums
  • 2,526 Topics
  • 10.9 K Posts
  • 40 Online
  • 2,338 Members
Our newest member: Shoaib Shafquat
Latest Post: Pick List report suddenly not splitting on Shipment
Forum Icons: Forum contains no unread posts Forum contains unread posts
Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Online Members

  • Tim Rodman Julian Schrenzel
Acumatica Forums

Terms of Use & Disclaimers :: Privacy Policy

Copyright © 2025 · AUG Forums, LLC. All rights reserved. This website is not owned, affiliated with, or endorsed by Acumatica, Inc.

‹›×

    ‹›×