Summary Functions in Salesforce

HELLO Salesforce Thinkers, In our previous blog we learned about Text Formula Operators and Functions in Salesforce In this blog we are going to learn about “Summary Functions in Salesforce”.

Summary functions let us use grouping values in custom summary formulas for summary, matrix, and joined reports.

There are two summary functions:

PARENTGROUPVAL and PREVGROUPVAL

1. PARENTGROUPVAL :

This function returns the value of a specified parent grouping. A “parent” grouping is any level above the one containing the formula. 

Summary and Joined: PARENTGROUPVAL(summary_field, grouping_level)

Matrix: PARENTGROUPVAL(summary_field, parent_row_grouping, parent_column_grouping)

  • summary_field is the summarized field value.
  • grouping_level is GRAND_SUMMARY or the API name of the parent level group for summary report.
  • parent_row_level and parent_column_level are the parent levels for matrix reports.

In reports with multiple grouping levels, we can set the grouping_level to be any group level higher than the formula display level.

We can use this function only in custom summary formulas and at grouping levels for reports, but not at summary levels.

2. PREVGROUPVAL:

This function returns the value of a specified previous grouping. A “previous” grouping is one that comes before the current grouping in the report.

Choose the grouping level and increment. The increment is the number of columns or rows before the current summary.

The default is 1, the maximum is 12.

PREVGROUPVAL(summary_field, grouping_level [, increment])

  • summary_field is the name of the grouped row or column.
  • grouping_level is the API name of the peer level group whose summary value for the previous grouping is used.
  • And increment is the number of groupings previous.

In reports with multiple grouping levels, you can specify the grouping_level to be the same group level as the formula display level or a group level higher than the formula display level.

We can use this function only in custom summary formulas and at grouping levels for reports, but not at summary levels.

Thanks for reading…

Leave a comment