There are multiple powerful report formulas available in Salesforce. The ParentGroupVal function is one of the rarely used features of Salesforce reporting. Here you learn how to create a summary report by using the PARENTGROUPVAL() function. For reports that are grouped by rows (summary) and for joined reports: PARENTGROUPVAL(summary_field, grouping_level).
Where summary_field is the summarized field value, grouping_level is GRAND_SUMMARY or the API name of the parent level group for summary reports.
Business Use Case
David is working as a System Administrator at Appiuss Software. He received the following requirement from his manager – Add a Percentage Total to an opportunity Summary Report.
% of Total Opportunity Amount
We will use PARENTGROUPVAL() function to solve the above requirement and see how a report grouping shares the Grand Total. Add a custom summary formula at the summary level from the “Fields” pane in Reports.
Perform the following steps to solve the above business requirement
Step – 1: Log-in into your developer org.
Step – 2: Navigate to Reports tab, Click on it and Click New Report Button.
Step – 3: Choose Report Type and Click on Continue Button.
Step – 4 : Add column to the report. Select Amount from Columns and then select Sum by clicking on Column Edit. Click on Apply button
Step – 5 : Under Group Rows, Select Stage.
Step – 6 : Disable Detail Rows.
Step – 7 : Now under Summary Formula, click on + Create Formula.
Step – 8 : Fill the details,
Column Name: % of Opportunity Amount[This will be the column header as you want it to appear on your report]
Formula Output Type Picklist : Percent
Decimal Points: 2[OR select the number of decimal places to be displayed]
Display Tab: Select Specific Groups
Row Group: Stage[to calculate percentage according to rows]
General : Build your Formula – AMOUNT:SUM/PARENTGROUPVAL(AMOUNT:SUM, GRAND_SUMMARY)
Click on the Validate button to check your formula is correct.
Step -9 : Click Apply.
Step -10 : Click on Save and Run.
You are done!
I would love to hear from you! What did you learn from this post? Share your tips in the comments!