Salesforce Report Summary Functions Cheatsheet
Salesforce Report Summary Functions Cheatsheet
Salesforce Report Summary Functions Cheatsheet
Abstract Did you know that you can calculate relative values for groupings in reports? With summary
The PARENT- functions in custom summary formulas, you can!
GROUPVAL and
PREVGROUPVAL
Summary functions let you use grouping values in custom summary formulas for reports. Formulas
summary functions
are available with summary, matrix, and joined reports.
offer a powerful way
to use grouping val-
ues in report formu- There are two summary functions: PARENTGROUPVAL and PREVGROUPVAL.
las.
PARENTGROUPVAL
Use this function to calculate values relative to a parent grouping.
Description: This function returns the value of a specified parent grouping. A “parent”
grouping is any level above the one containing the formula. You can only
use this function in custom summary formulas for reports.
Use: Summary and Joined: PARENTGROUPVAL(summary_field,
grouping_level)
Matrix: PARENTGROUPVAL(summary_field,
parent_row_grouping, parent_column_grouping)
Where summary_field is the summarized field value,
grouping_level is the parent level for summary reports, and
parent_row_level and parent_column_level are the parent
levels for matrix reports.
Example:
TOTAL_PRICE:SUM/PARENTGROUPVAL(TOTAL_PRICE:SUM,
GRAND_SUMMARY)
This formula calculates, for each product, its relative size compared to
the grand total. In this example, the report is a summary of opportunities
and their products, grouped by Product Name.
PREVGROUPVAL
Use this function to calculate values relative to a peer grouping. If there is no previous grouping,
the function returns a null value.
1; the maximum is 12. You can only use this function in custom summary
formulas for reports.
Use:
PREVGROUPVAL(summary_field, grouping_level [,
increment])
Example:
AMOUNT:SUM - PREVGROUPVAL(AMOUNT:SUM, CLOSE_DATE)
This formula calculates, for each month, the difference in amount from
the previous month shown in the report. In this example, the report is
an opportunity matrix with columns grouped by Close Date and rows
by Stage.
For more information, see “Working with Formulas in Report Builder” and “Building Custom
Summary Formulas” in the Salesforce online help.