Sub topic 14
Choosing the right format
This chapter assumes you can build tabular, summary, matrix, and joined reports in Lightning Experience. You should know what a report type is, how filters work, and how row groupings and summarized fields behave. The goal here is to choose a format from the question being asked, not from habit.
Start from the question
Each format answers a different shape of question. Decide what the reader needs to see before you decide how to build it.
| Business question | Shape of the answer | Format |
|---|---|---|
| Which open cases are older than 30 days? | A list of individual records | Tabular |
| How much pipeline do we have in each stage? | One measure per category | Summary |
| How does pipeline by stage change from year to year? | One measure across two categories | Matrix |
| How do opportunities and cases look for the same accounts? | Two record sets side by side | Joined |
Ask three things in order:
- Does the reader need individual records, or only totals?
- How many dimensions are being compared, and do they need to appear on both axes?
- Do the numbers come from one report type, or from several?
The decision path
Use this as a default and then check the limits below. A joined report is the only format that can combine unrelated report types, so that test comes before the matrix test.
What each format does well
Tabular
A tabular report is a flat list with no groupings. Use it for exports, work lists, and quick checks of the data. It can show a grand total, but it cannot show subtotals. If you find yourself scanning a long tabular report and adding things up by hand, you need a grouping.
Summary
A summary report groups rows by one or more fields and calculates sum, average, minimum, maximum, or record count for each group. A summary report supports up to four row groupings. It keeps the detail rows visible under each group, so a reader can drill from a total down to the records behind it.
Pick summary when the question has one main category, or when several groupings are nested like a hierarchy (Region, then Owner, then Stage). Nested groupings read top to bottom, so deep nesting gets long.
Matrix
A matrix report groups by both rows and columns. A matrix supports up to two row groupings and two column groupings, and each cell holds a summary value. Use it when the comparison between two categories is the point, such as Stage by Close Year.
Think of the matrix as a pivot table. It is compact and good for spotting patterns across a grid. The cost is that it can hide detail. You can show the detail rows from the report, but the grid is the main view.
Joined
A joined report holds up to five blocks. Each block has its own report type, columns, filters, and summary values. Blocks are lined up by common groupings, which are fields shared across the blocks, such as Account Name. Use joined when two different report types describe the same entities, for example Accounts with Opportunities in one block and Accounts with Cases in another.
Joined reports are the most flexible format and the most restricted one. Keep these gotchas in mind:
- Each block is independent. A filter in one block does not apply to the others unless you set it as a report-level filter.
- Cross-block comparisons depend on the common grouping. If the groupings do not line up, values will appear under different group labels and you cannot compare them.
- Joined reports cannot be used as the source of a dashboard component.
Formulas and comparisons
Custom summary formulas work on summary, matrix, and joined reports, but they behave differently by format. In a summary report, a formula can calculate a ratio for each group:
AMOUNT:SUM / RowCountThis returns the average opportunity amount per group. For a trend, group by Close Date and compare each group to the one before it:
AMOUNT:SUM - PREVGROUPVAL(AMOUNT:SUM, CLOSE_DATE)Before you choose a format, check whether the calculation you need exists there. If you need a ratio between two different report types, such as won amount against support cases, only a joined report with a cross-block formula can compute it in one place.
Limits with charts and dashboards
The format you choose decides which visuals you can build, and which can go on a dashboard.
| Format | Chart support | Dashboard support |
|---|---|---|
| Tabular | No chart from groupings, since there are none | Usable as a source only with a row limit set |
| Summary | Bar, column, line, pie, donut, funnel, and others from one or more groupings | Fully supported |
| Matrix | Grouped or stacked charts built from the row and column groupings | Fully supported |
| Joined | Charts per block and across blocks | Not supported as a dashboard source |
Two practical rules follow from this:
- If the report will feed a dashboard, build it as a summary or matrix report. Do not start with a joined report and then discover that you cannot place it on a dashboard.
- If a stakeholder needs a joined view and a dashboard, build one summary report per block and put each on the dashboard as its own component. The dashboard then sits side by side, in the same way the blocks do.
Checking your choice against SOQL
If you are comfortable with SOQL, you can test whether a summary or matrix is the right shape. A summary report with one grouping maps to a query with one GROUP BY:
SELECT StageName, SUM(Amount) total, COUNT(Id) cnt
FROM Opportunity
GROUP BY StageNameA matrix with rows and columns maps to a query grouped by two dimensions:
SELECT StageName, CALENDAR_YEAR(CloseDate) yr, SUM(Amount) total
FROM Opportunity
GROUP BY StageName, CALENDAR_YEAR(CloseDate)If the answer you need would require two separate queries against different objects, that is the signal for a joined report. A single GROUP BY can only aggregate across one root object and its relationships. A report grouped on one report type behaves the same way.
Common mistakes
- Using a matrix when a summary is enough. If one axis has a single value, you have a summary report with extra layout. The reader has to scan a grid for no benefit.
- Using a summary report with deep nesting to imitate a matrix. Four nested groupings produce a long scroll. If the real question is "A by B", use a matrix.
- Choosing joined for convenience. Joined reports are harder to maintain and cannot feed dashboards. If both datasets come from one report type, use summary or matrix.
- Forgetting row limits. A tabular report on a dashboard needs a row limit, and a long list does not suit a chart anyway.
- Treating formulas as format-neutral. Test the formula in the format you chose before you commit to it.
Exercises
Exercise
A sales director wants a dashboard chart showing won amount by region and by quarter. Which format should the source report use, and why?
Show answer
A matrix report, with Region as the row grouping and Close Quarter as the column grouping. It compares two dimensions, and a matrix can feed a dashboard component. A joined report could not be a dashboard source, and a summary report would show only one dimension at a time.
Exercise
A service manager wants cases and opportunities for the same accounts in one view, grouped by Account Name, and also wants both on a dashboard. How do you meet both needs?
Show answer
Build a joined report with a Cases block and an Opportunities block, grouped by the common field Account Name. Because joined reports cannot be a dashboard source, also build one summary report per dataset, grouped by account, and add each to the dashboard as its own component.
Exercise
You need the average opportunity amount for each stage in a summary report. Which formula do you use, and which SOQL query returns the same numbers?
Show answer
Use the custom summary formula AMOUNT:SUM / RowCount. The matching query is SELECT StageName, SUM(Amount) total, COUNT(Id) cnt FROM Opportunity GROUP BY StageName, where the average is total divided by cnt.