I am trying to do something like this:
List<object__c> testObject= [ SELECT SUM(convertCurrency(Amount__c)) FROM object__c ];
but it doesn't work. As far as I read in the Force.com SOQL and SOSL Reference it says that this is not possible to be achieved. From Querying Currency Fields in Multi-currency Orgs:
You can’t convert the result of an aggregate function into the user’s currency by calling the convertCurrency() function. If a query includes a GROUP BY or HAVING clause, currency data returned by using an aggregate function, such as SUM() or MAX(), is in the org’s default currency.
However I am trying to avoid having to iterate over a giant list of objects just to sum up their converted currencies. Is there an easy way to achieve what I am trying to do within the SOQL?