Sub topic 11
Joined reports: combining blocks
This chapter assumes you can build a summary report and a matrix report, and that you know what a report type is. A joined report combines up to five blocks in one report. Each block is its own report with its own filters, columns, and groupings.
What a block is
A block is a self-contained slice of data. Every block has a report type. Different blocks can use different report types, as long as the types share a relationship. A typical case is one block for Opportunities and another for Cases, both reached through Account.
Each block also has its own:
- Filters, so one block can show open deals and another can show closed deals.
- Columns, so each block shows only the fields it needs.
- Summary fields, such as a sum of Amount in one block and a record count in another.
The report as a whole has one set of row groupings that apply across blocks. This is where common groupings come in, and the next chapter covers them.
How blocks relate
Blocks do not join rows the way a SQL join does. Salesforce runs each block as a separate query. It then lines up the results on a grouping field that the blocks share. If a group value appears in one block and not in another, the second block shows nothing for that group.
Build a joined report
- Open the report builder and start from a summary or tabular report. Joined reports start from a standard report type.
- In the Outline panel, open the Report Format menu and choose Joined.
- Set the filters and columns for the first block, then group by Account Name.
- Choose Add Block and pick a second report type, for example Cases.
- Set that block's filters and columns.
- Add a cross-block summary field if you want a total that uses data from more than one block.
- Run and save the report.
Use clear block names. Rename them from the block menu, for example "Open Opportunities" and "Open Cases". The default names are not helpful once a report has more than two blocks.
Cross-block summary fields
A cross-block custom summary formula lets you combine values from different blocks. For example, you could compare the sum of Amount from the opportunity block with the record count from the case block. Cross-block formulas can only use summary values from the report, not row-level fields.
Common errors
- Empty block for a group. A group appears in one block only. Check that the filters in each block do not exclude the matching records, and confirm that the report types are related.
- Wrong totals. Each block calculates its own totals. Adding numbers across blocks by hand double counts anything the blocks share.
- Unavailable grouping. If a field is not shared by every report type in the report, you cannot use it as a common grouping.
- Block limit. A joined report holds at most five blocks.
When to use a joined report
Choose a joined report when the question spans related data that one report type cannot expose. If you can answer the question with a single report type, a summary or matrix report is simpler and has more options.
Exercise
You need one report that shows each account's open opportunity amount next to its open case count. Why does a single summary report not work here, and which format fits?
Show answer
One report type usually exposes a single main object relationship, so Opportunities and Cases cannot both be reported on freely in one summary report. A joined report fits. Use one block with an Opportunities report type and one with a Cases report type, group both by Account Name, and read the two sets of results side by side.