We powdercoat most of our sales orders and have an attribute called COLOUR on the UDF that allows me to build a GI for our days work.
I'd like to be able to have subtotals in the middle of my GI so that, for example, on a day when we coat more than one colour we can see how many of each colour we have to do, as well as a grand total for the day. I have it working for the grand total using the aggregate function but not sure how to approach this question about the sub totals.
Warning... A good ol fashioned hand sketch below