# Salesforce Report Summary Functions Cheatsheet

## DOWNLOAD

First things first !

To download this implementation guide, click the download button below.

If you need more information about the implementation guide, you can read the Table of Contents below.

### REPORT FORMULA SUMMARY FUNCTIONS

Summary

Group values in report

formulas by using the

### PARENTGROUPVAL and

### PREVGROUPVAL summary

functions

Did you know that you can calculate relative values for groupings in reports With summary functions in

custom summary formulas you can

### PARENTGROUPVAL and PREVGROUPVAL

### Use PARENTGROUPVAL to calculate values relative to a parent grouping Use PREVGROUPVAL to

calculate values relative to a peer grouping

### 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 use this

function only in custom summary formulas and at grouping levels for reports

but not at summary levels

Use

Summary and Joined PARENTGROUPVALsummaryfield

groupinglevel

Matrix PARENTGROUPVALsummaryfield

parentrowgrouping parentcolumngrouping

Where summaryfield is the summarized field value

### groupinglevel is GRANDSUMMARY or the API name of the parent

level group for summary reports and parentrowlevel and

parentcolumnlevel are the parent levels for matrix reports

In reports with multiple grouping levels you can set the

groupinglevel to be any group level higher than the formula display

level

Example

### TOTALPRICESUMPARENTGROUPVALTOTALPRICESUM

### GRANDSUMMARY

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 theres no previous grouping the

function returns a null value

Last updated March

Report Formula Summary Functions

Using Summary Functions

Description

Use

### 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 the maximum is

You can use this function only in custom summary formulas and at grouping

levels for reports but not at summary levels

PREVGROUPVALsummaryfield groupinglevel

increment

Where summaryfield is the name of the grouped row or column

### groupinglevel 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

groupinglevel to be the same group level as the formula display

level or a group level higher than the formula display level

Example

### AMOUNTSUM PREVGROUPVALAMOUNTSUM CLOSEDATE

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

Example Three Week Moving Average

To calculate a threeweek moving average of opportunity amounts

### OppProductTrendscAmountcSUM

### PREVGROUPVALOppProductTrendscAmountcSUM

OppProductTrendscasofdatec

### PREVGROUPVALOppProductTrendscAmountcSUM

OppProductTrendscasofdatec

Using Summary Functions

Doubleclick Add Formula in the Fields pane

In the Custom Summary Formula dialog under Functions select Summary

### Select PARENTGROUPVAL or PREVGROUPVAL

Select the grouping level and click Insert

Define the formula including where to display the formula

### Click OK

For more information see Evaluate Groups and Totals with Summary Formulas and Add a Summary

Formula Column to a Report in the Salesforce online help