Hello everyone,
I’m trying to find the best and most performant way to get the average purchase price for an inventory item from a specific vendor, based on a user-defined time frame (last 3 months, last 12 months, or all time).
For the last purchase price, it’s easy — the value is already stored on POVendorInventory.But I need the average price from actual purchases, not just the last one.
Supporting a custom date range is my main requirement. An all-time average is not strictly necessary, but would be nice to have — and I want to make sure the query still performs well even if that option is included.
Thanks a lot for your help!