There is a proper CohQL group operator for this scenario. If you want to calculate the average price for each order grouped by one or more columns (in the Coherence context, field attributes) use the following CohQL:
SELECT product, customer, AVG(price * qty) AS avgPrice FROM order GROUP BY product, customer;
Thx Ricardo for the valuable information.
But my context was different. I am using Coherence in java. The same implementation is not possible there. It only allows me single field attribute within DoubleAvg function.
Any advice/suggestion would be really helpful.