By using this website, you agree to our Terms of Use (click here)
I'm new to Acumatica and I'm trying to create a Customer Price List GI that shows all of the items that a customer has purchased before. The GI results grid needs to show the stock items they have purchased before, the date of their last purchase of that item, the last price of the sale and the quantity they last bought. It also needs to show how many of that item are on hand currently in the warehouse. I have created a GI using the InventoryItem, INSite and INSiteStatus inventory tables along with the ARTran table so that I can find all the items sold to a customer. I filter the list by the customer ID in the parameter and then sort the results by InventoryID Ascending + TranDate Descending to get the most recent purchase for each item. My problem is I am only interested in the LAST time they bought it but to get the most recent invoice without all the other results I'm having to group on the customer and inventory ID. When I do this I get the last invoice date but the On Hand Qty, Last Sold Qty and Last Price fields are automatically totaled (SUM) because of the use of the Inventory ID and Customer ID in the Grouping Tab.
Is there any way to return only those rows from the ARTran table for the most recent purchase of each item without Grouping so that I can get the actual QTY sold, the current Warehouse on hand qty and the Last price from the specific invoice I'm finding in the ARTran table?
Currently I either get all results sorted by item and date if I don't using the Grouping option or I get one record per item as intended but all of the numeric fields automatically have the SUM function applied as part of the aggregate process of Grouping.
Any suggestions would be greatly appreciated.
You can use the Total Aggregate Function column on the RESULTS GRID tab of the Generic Inquiry (SM208000) screen to change the behavior from SUM to something else: AVG, COUNT, MAX or MIN:
But I don't think AVG, COUNT, MAX or MIN will help you here. MAX or MIN will get you the largest or smallest quantity, but not the LAST quantity.
There's a function in Report Designer called Last that might get you what you need, but you'd need to build the report in Report Designer:


