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
CraigHCraigH 

Total of grouped field in report

Does anybody know how I can total a count of the summarized groups in a report.

 

i.e. Say I have an object model like

 

Parent object

Child object (look up relationship to parent)

 

and Data like

 

Parent 1

Child A

Child B

Parent 2

Child C

Child D

Parent 3

 

I then do a report based on the Child object and group by the lookup field to parent

 

Using recordCount, I can get the total # of records on the report (i.e. 4)

 

What I would like is to see the total of all Parent objects (with children) - in the example above 2

 

 

Best Answer chosen by Admin (Salesforce Developers) 
laura.mckevitt@bakertilly.comlaura.mckevitt@bakertilly.com

Okay, in that case you can just use your custom field on the parent object and sum it in the report. FK_Contact.MyIncrementer__c:SUM

All Answers

laura.mckevitt@bakertilly.comlaura.mckevitt@bakertilly.com

If I understand correctly, you would be looking for field containing "7" based on your example.

 

This is just one solution I am sure, but you can create a custom formula field on your parent object that simply holds a value of 1. Then in your report, you can create a formula field on the Grand Summary level which adds the RowCount and the custom field:

 

RowCount + FK_Contact.MyIncrementer__c:SUM

 

CraigHCraigH

Hi

 

Actually I just want 2 (the # of parent objects with at least 1 child)

laura.mckevitt@bakertilly.comlaura.mckevitt@bakertilly.com

Okay, in that case you can just use your custom field on the parent object and sum it in the report. FK_Contact.MyIncrementer__c:SUM

This was selected as the best answer