I am trying to write a GI to get the customer’s sold since information like the below screen.
You can find my share in the below post:
My solution almost works fine, but I find it difficult to get the “last sale qty” and “last sale price” by item using GI.
The last sales date can be got because the default aggregation is MAX, the max date is exactly the last date.
However, the max(orderqty) is not the last order qty, and also the max(unit price) is not the last unit price.
so currently, I am using the AVG unit price and Sum Order qty as a workaround, and it can be accepted by user.
But still, I am eager to learn how can I get the data using a single GI?
Best answer by Gabriel MichaudView original