Sub topic 3
Filtering and Scoping Report Data
This chapter assumes you can navigate Lightning Experience, know how objects, records, and relationships such as Account to Opportunity work, and have permission to create and run reports. You should also know that a report type decides which objects and fields a report can use. Here you will learn how filters decide which records a report returns, and why that matters before you add groupings or summaries.
Why filters come first
A report type defines the pool of records you could see. Filters narrow that pool. Every grouping, sum, average, and count in a summary, matrix, or joined report is calculated only from the rows that pass the filters. A wrong filter gives you wrong totals that look correct.
Filters work in layers. Salesforce applies them roughly in this order:
- Your sharing access and the report's scope decide which records are visible at all.
- The standard filters (such as date range) narrow that set.
- Field filters narrow it further.
- Filter logic combines the field filters.
- Cross filters and row limits apply last.
Totals, groupings, and charts are built from what remains.
Scope: whose records to include
The scope control sets which records are considered, relative to the person running the report. Common values depend on the object. For opportunities they include:
- My opportunities: records you own.
- My team's opportunities: records owned by you and the people below you in the role hierarchy.
- All opportunities: every record you have access to.
Scope never grants extra access. If sharing rules hide a record from you, "All" still does not show it. This matters when you schedule a report or share it. Two people can open the same report and see different totals because their sharing access differs.
Reports that run in a dashboard use a running user's access, not the viewer's. Keep that in mind when a dashboard total disagrees with a report you ran yourself.
Standard date filters
The date filter has two parts: a date field and a range. The date field is the field the range applies to, such as Close Date or Created Date. The range can be a fixed span (from 1 Jan 2026 to 31 Mar 2026) or a relative one such as This Quarter, Last Month, or Last 90 Days.
Relative ranges are preferable for reports you reuse, because they update themselves. Fixed ranges suit one-off analysis or a reconciliation that must be repeatable.
A common error is choosing the wrong date field. An opportunity report filtered on Created Date for "This Quarter" shows deals that were opened this quarter. It does not show deals expected to close this quarter. For a revenue forecast you usually want Close Date.
Relative ranges are also tied to your fiscal calendar settings. If your organization uses a custom fiscal year, "This Fiscal Quarter" can differ from the calendar quarter.
Field filters
A field filter has three parts: a field, an operator, and a value. For example, Stage equals Closed Won.
Operators depend on the field's data type.
| Field type | Typical operators |
|---|---|
| Text | equals, not equal to, contains, does not contain, starts with |
| Number or currency | equals, greater than, less than, greater or equal, less or equal |
| Picklist | equals, not equal to, includes, excludes |
| Date | equals, before, after, within a range |
| Checkbox | equals True or False |
You can enter several values for one filter by separating them with commas. Stage equals Prospecting, Qualification returns records whose stage is either value. This behaves like OR inside a single filter.
Filter logic
By default, multiple field filters are joined with AND. A record must satisfy all of them. Filter logic lets you change that using filter numbers.
Suppose you have three filters:
- Stage equals Closed Won
- Amount greater than 50000
- Type equals New Business
The default is 1 AND 2 AND 3. To return large closed-won deals, or any new-business deal, write:
(1 AND 2) OR 3Use parentheses to make the grouping explicit. Without them, readers (and sometimes the report) may not interpret the logic as you intended. After you edit filter logic, re-check the row count against a result you can verify by hand.
Blank values
Filters treat blanks carefully. Amount not equal to 0 may exclude records where Amount is blank, depending on the field and operator. If you want to find records missing a value, filter with equals and leave the value empty. To exclude blanks, use not equal to with an empty value. Test with a known record when blanks matter.
Cross filters
A cross filter keeps or removes records based on related records in another object. The syntax is: show records with or without related records, optionally with conditions on those related records.
Examples:
- Accounts with Opportunities where Stage equals Closed Won.
- Accounts without Cases.
- Opportunities with Products where Product Family equals Hardware.
Cross filters answer questions that a report type alone cannot, such as "which accounts have never opened a case?" The result still lists only the primary object's fields. You filter by the related object, but you do not get its columns unless the report type includes that object.
Cross filters are also a sub-filter source. Each cross filter can carry its own field conditions. Keep these conditions on the related object only. Conditions on the primary object belong in the normal field filters.
Row limits and sorting
You can limit a tabular report to the top or bottom N rows by a chosen field. This is useful for "top 10 accounts by revenue." In a summary or matrix report, groupings and summaries are calculated from the filtered rows, so changing the filters changes every total.
Limits apply to what the report displays and charts. They do not change the logic in your filters. If a limit is on, check that your totals still reflect what you want to report.
Filters in summary, matrix, and joined reports
The same filter tools behave differently by format.
- Summary and matrix: one set of filters applies to the whole report. Every group and cell is built from the same filtered rows.
- Joined: each block is its own report with its own report type and its own filters. A filter set on one block does not affect the others. Standard filters set at the report level, such as the date range and scope, can sit alongside block filters, but be careful: a date field must exist in each block's report type for a shared date filter to mean the same thing.
For comparing two dimensions in a matrix, a filter that removes a stage removes that row and its contribution to every column total. For a joined report comparing, say, Opportunities against Cases, you filter each block to the records that make the comparison fair. Two blocks with different date ranges produce a comparison that is easy to misread.
Filtering by group results
Row filters apply to individual records, before they are grouped. Summary filtering of the groups themselves (for example, "show only groups where the sum exceeds 100,000") is a different operation. Use a dashboard or chart limit, or the report's summary-level options, rather than a field filter, if you need to filter groups by their totals. A field filter on Amount compares each record's Amount, not the group's sum.
Relating filters to SOQL
A report's filters correspond to the WHERE clause of a query. Groupings correspond to GROUP BY. The example below shows the equivalent of a filtered summary report: closed-won opportunities, closing this fiscal quarter, grouped by stage with a sum.
SELECT StageName, SUM(Amount) total, COUNT(Id) cnt
FROM Opportunity
WHERE IsWon = true AND CloseDate = THIS_FISCAL_QUARTER
GROUP BY StageNameFiltering by group totals would correspond to HAVING, which is why a record-level field filter cannot do it.
Common mistakes
- Using Created Date when you meant Close Date.
- Forgetting that scope is limited by sharing, then comparing totals between users.
- Writing filter logic without parentheses and getting an unintended combination.
- Assuming a field filter acts on group totals.
- Using different date ranges in joined report blocks and comparing the results as if they were equivalent.
- Leaving a row limit enabled and wondering why totals are lower than expected.
Exercise
An opportunity summary report is filtered on Created Date = This Quarter and grouped by Stage with a sum of Amount. A sales manager says it does not show the deals expected to close this quarter. What is wrong, and how would you fix it? Also, how would you add a condition so the report shows only deals that are Closed Won, or any deal over 100,000?
Show answer
The date filter uses the wrong field. Created Date shows when records were created, not when they are expected to close. Change the date field to Close Date and keep the range at This Quarter. For the second part, add field filters 1: Stage equals Closed Won and 2: Amount greater than 100000, then set filter logic to 1 OR 2.
Exercise
You need a list of accounts that have no open cases. A normal field filter on the Account report does not work. Which filter type do you use, and why?
Show answer
Use a cross filter set to Accounts without Cases, with a condition on the related Cases (for example Status not equal to Closed) if you want only open cases excluded. A field filter checks values on the primary object's own records. A cross filter checks whether related records exist.