function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
bryansosa01bryansosa01 

Subquery and aggregate Functions

I want tu SUM the MAX values from an Object

 

I want to do something like this:

SELECT sum(max(Exposici_n__c)) FROM  Cartera_de_Credito__c WHERE Fecha_al__c = 2013-06-30  Group BY Banda_2__c  ORDER BY Max(Banda__c)

 

 

Please help.

Bryan Sosa.

Vinita_SFDCVinita_SFDC

Hello Bryan,

 

I am a bit confused with your requirement, max(Exposici_n__c) will return just one result. Why would you apply SUM on one value?

 

Please elaborate.

bryansosa01bryansosa01

I want to sum the max values, in a field of an object from the data of one object (which are not related), grouped by a field.

 

For example get the max value of prices grouped by category, then sum these max values.

 

Does this makes sense for you?

 

Thanks.

Bryan Sosa.