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
Mack DsozaMack Dsoza 

Explain

10:40:46.956 (956916000)|SOQL_EXECUTE_BEGIN|[807]|Aggregations:0|
SELECT name,Goal_Profile_Type__c,Debt_Allocation__c,Account__c,                                     Equity_Allocation__c,Gold_allocation__c,Return_expected__c
FROM
    Goal_Profile__c
WHERE
    account__c=:EntityId
                                             
10:40:46.960 (960252000)|SOQL_EXECUTE_END|[807]|Rows:0

 

Please explain me red marked statement...wht it means ?

Best Answer chosen by Admin (Salesforce Developers) 
kiranmutturukiranmutturu

may be u have 3 funtions but there is no result in that query ..number of rows that a query returned is 0 thats y it is showing aggregations 0 there.

All Answers

kiranmutturukiranmutturu

as u r not using any aggregate functions in the query ...so the result would be 0 there showing with that keyword Aggregations

Mack DsozaMack Dsoza
11:30:58.219 (219171000)|SOQL_EXECUTE_BEGIN|[1883]|Aggregations:0|
                                                                SELECT 
                                                                        investment_Asset__r.recordType.Name recordTypeName,
                                                                        Investment_Asset__r.Entity__r.Name entityName,
                                                                        Investment_Asset__r.Action__c action,
                                                                        Goal__c,
                                                                        MAX(allocated__c) allocatedPercent,
                                                                        MAX(GoalYearValue__c) GoalYearValue__c,
                                                                        SUM(Investment_Asset__r.TotalAsset__c) TotalAsset                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                                                                FROM 
                                                                        GoalInvestmentAssetAssociation__c 
                                                                WHERE 
                                                                (   
                                                                    Investment_Asset__r.entity__r.Parent_Entity__c = : entityId
                                                                    OR    
                                                                    Investment_Asset__r.Entity__c  = :entityId
                                                                )
                                                                AND
                                                                        Goal__c IN :goalIdList
                                                                GROUP by    
                                                                            Goal__c,
                                                                            investment_Asset__r.recordType.Name,
                                                                            Investment_Asset__r.Entity__r.Name,
                                                                            investment_Asset__r.Action__c
                                                                                                                                                    
                                                            
11:30:58.231 (231829000)|SOQL_EXECUTE_END|[1883]|Rows:0

But here i have used 3 aggregate function but it still shows me Aggregation as 0..

kiranmutturukiranmutturu

may be u have 3 funtions but there is no result in that query ..number of rows that a query returned is 0 thats y it is showing aggregations 0 there.

This was selected as the best answer
Mack DsozaMack Dsoza

Thank you so much Kiran...

SteveBowerSteveBower

Odd... From execute anonymous in Eclipse the debug log show Aggregations: 0 even if there are rows in the query and the aggregation returns a real result.  

 

try:  system.debug([select sum(amount) from Opportunity]);

 

 

Doesn't matter if you have a more elaborate thing like

 

AggregateResult[] abc = [select name, avg(amount) from opportunity group by name];

 

Seems wrong to me.  Best, Steve.