I have an aggregate query that groups my custom object records by 4-5 fields and then returns a sum of currency fields in each grouping. I have multicurrency enabled so this sum of the currency field is being returned in USD. :( Trying to convert the results back into CAD is causing issues with precision and rounding.
So I felt its best if I can do my own aggregation. So I have changed my query to return a list of the records and so far the best solution I found is to iterate repeatedly through my list and create groups and sum up their amounts but this is proving to be inefficient.
Can someone please suggest perhaps a better and efficient solution where we can acheive grouping NON Agrregate SOQL results. I know that almost everyone would prefer to use Aggregate queries to perform grouping but I am hoping someone had the need to do a similar thing. Thanks.