Sub topic 2
Summarizing Fields Within Groups
Assume you know Salesforce Lightning navigation, objects, fields, relationships, and how to create reports. This chapter uses the Opportunity object and the standard report builder.
Summarizing fields within groups
A summary field calculates a value for records in each group. Common calculations include:
- Sum: adds numeric values, such as opportunity Amount.
- Average: calculates the mean value.
- Minimum and maximum: find the smallest or largest value.
- Record count: counts records in the group.
For example, grouping opportunities by Stage and summarizing Amount by Sum shows the pipeline value for each stage. An average Amount shows the typical opportunity size.
Building a summary report
- Open Reports, select New Report, and choose Opportunities.
- Add filters, such as Close Date equals Current Fiscal Year.
- Add Stage as a row grouping.
- In the Amount column menu, select Summarize and choose Sum and Average.
- Add a record count if the report needs the number of opportunities per stage.
- Run and save the report.
A summary report displays one result row per grouping value. The report-level totals summarize all records that pass the filters.
AMOUNT:SUM / RowCountThis custom summary formula returns the average Amount per group. Use the report builder's formula editor to create it and select the appropriate output format, such as Currency.
Bucket fields for ad hoc categories
A bucket field creates report-only categories from existing values. It does not create a field on the object or change stored records.
For example, create an Amount Range bucket on Amount:
- Small: less than $10,000
- Medium: $10,000–$49,999
- Large: $50,000 or more
Group the summary report by Amount Range to compare opportunity counts and totals. Bucket fields are useful for quick analysis, but reuse is limited because the definition belongs to that report.
Building a matrix report
A matrix report groups records by both rows and columns. Use it when the question compares two dimensions.
For example:
- Group rows by Stage.
- Group columns by Close Date, using calendar year.
- Summarize Amount by Sum.
- Add Record Count if volume matters.
The resulting cells show each stage's value for each year.
Exercise
Which format should you use to compare summed opportunity Amount by Stage and Close Year?
Show answer
Use a matrix report with Stage as the row grouping and Close Year as the column grouping.