Get the rec id of the max qty, with a calculation.

Discussion created by gdaquino on Aug 3, 2016
Latest reply on Aug 9, 2016 by gdaquino

Hello experts,


So here is the situation. I have 2 tables, customers and order item. Each order item is an element of an order. In each order item record there is a field named quantity that show me the number of that article bought during on each order. I added a summary field on the order item table to get the summary of quantity.


I need to find the top sales article for each customer. Basically the article related to the customer with the biggest sum of quantity. I created a field inside the customer table for it but I'm thinking how to find the article_id of the max for the summary for quantity.


What do you suggest me?