📣 Attention Salesforce Certified Trailblazers! Link your Trailhead and Webassessor accounts and maintain your credentials by December 14th. Learn more.
close
trailhead

Create Reports with the Report Builder

Learning Objectives

After completing this unit, you'll be able to:
  • Use the drag-and-drop report builder.
  • Explain the value of using filters, cross filters, and filter logic.
  • Create a tabular report.

Use the Report Builder

When you create a report in Salesforce, the criteria you enter is essentially a question you’re asking, and the results returned are the answer. But in order to ask a question, you have to speak the database’s language. Good news! Salesforce comes with a built-in translator, allowing you to ask your database all the questions you want through a point-and-click interface. Meet the drag-and-drop report builder, your way to get the answers you need about your data.

The first thing you need to do is make sure you’ve enabled the report builder. New organizations automatically get the latest version of report builder. For existing organizations, you may need to take steps to enable the drag-and-drop report builder.

To enable the report builder for all users, from Setup, enter Reports and Dashboard Settings in the Quick Find box, then select Reports and Dashboard Settings. Review the Report Builder Upgrade section of the page, and then click Enable. If you don’t see the button, report builder has been enabled for your organization. Confirm your choice by clicking Yes, Enable Report Builder for All Users.

Good work! Now you need to open the report builder. But before you do that, you have to select a report type.

Select a Report Type

Choosing the right report type is one of the most important steps in building a report. When you pick a report type, you’re picking the records and fields you’ll be able to see in your report.

At this point, let’s press the pause button and make sure you understand how report types are structured.

Each report type has a primary object and one or more related objects. For standard report types, you will typically see this represented in the report type name. For example, with the 'Contacts & Accounts' report type, 'Contacts' is the primary object and 'Accounts' is the related object. For custom report types, from Setup, enter Report Types in the Quick Find box, then select Report Types to see the primary and related objects. As a best practice, consider following the standard report type naming convention when creating custom report types.

Depending on how the report type is set up, the results can include one of the following.
  • Primary object with related object—Records returned are only those where the primary object has at least one related object record. In our example of ‘Contacts & Accounts’, the only records that would be displayed on the report would be ‘Contacts’ that have at least one related ‘Account’ record.
  • Primary object with or without related object—Records returned are those where the primary object may or may not have a related object record. If we were to create a custom report type ‘Contacts with or without Accounts’, then ‘Contacts’ would be displayed whether or not they have a related ‘Account’ record. You can have up to four related objects, and each can have the “with” or “with or without” distinction.
Permission set overview page

Pay close attention to the primary object and the related object criteria when you’re selecting a report type. Don’t see the fields you want? You may need to create a new custom report type, or adjust an existing custom report type to add or hide fields.

Note

Note

You can’t edit a standard report type.

Get to know the Drag-and-Drop Report Builder

Using the drag-and-drop report builder, you can create reports with the criteria, fields, filters, groupings, and charts you need.

Check out this short video to learn more about how the report builder works.

Don’t like videos? Check out this short summary instead.

Permission set overview page

Just like the name implies, the drag-and-drop report builder allows you to create reports by dragging and dropping fields from the fields pane [1] onto the preview pane [3]. The filters pane [2] is where you can enter additional criteria to limit your results. In the example above, we’re filtering by a specific Account Owner, Type, and Billing State/Province.

Note

Note

The preview pane is just that: a preview. When you're building a report, the data you see here will just be a limited set. To see your full set of results, you'll need to click Run Report.

Tip

Tip

Don’t see any columns in the Preview Pane? Click on the down arrow next to Show and select Details.

In the next section, we’ll dive into how you can use filters to get specific results.

Use Filters

When you’re using the report builder to ask a question about your data, filters and filter logic allow you to get more specific, and row limits help you limit the answer you receive. First, let’s take a high-level look at these features, and then we’ll walk you through how to build a filter.

You can filter the data in a report using the following filter options.

Filter Type Description
Standard Filter Standard filters are applied by default to most objects. Different objects have different standard filters, but most objects include the standard filters Show Me and Date Field. Show Me filters the object around common groupings (like “My accounts” or “All accounts”). Date Field filters by a field (such as Created Date or Last Activity) and a date range (such as “All Time” or “Last Month”).
Field Filter Field filters are available for reports, list views, workflow rules, and other areas of the application. For each filter, set the field, operator, and value. With tabular, summary, and matrix reports, you can drag a field from the Fields pane to the Filters pane to add a report filter.
Filter Logic Add Boolean conditions to control how field filters are evaluated. You must add at least 1 field filter before applying filter logic.
Cross Filter Filter a report by the child object using WITH or WITHOUT conditions. Add subfilters to further filter by fields on the child object. For example, if you have a cross filter of Accounts with Opportunities, click Add Opportunity Filter and create the Opportunity Name equals ACME subfilter to only include those opportunities.
Row Limit For tabular reports, select the maximum number of rows to display, then choose a field to sort by and the sort order. You can use a tabular report as the source report for a dashboard table or chart component, if you limit the number of rows it returns.

Now that you’ve got that down, let’s build a filter. In this example, we'll build a tabular report, which is the default report format. We'll cover report formats in more detail in the next unit.

  1. Go to the Reports tab and click on New Report .
  2. Select the ‘Accounts’ report type and click Create.
  3. In the filters pane, click Add and select Field Filter.
  4. Choose a field from the first drop-down list. For this example, let’s choose Type.
  5. Set the filter operator to Equals.
  6. Click the lookup icon next to the third field, select the value Customer - Direct , and click OK.
  7. For the Date Field, select Created Date and set the range to All Time.

Nice job! You’ve just created a report filter that shows all of your Accounts where the Type = Customer - Direct. Click Run Report to see your results. Please note, depending on which org you’re using to run through this tutorial, you may or may not see data in your report at runtime.

Here’s a handy shortcut. When creating a filter, try dragging a field from the fields pane to the filters pane. Voilà! You’re ready to build your next filter. You can also use the type-ahead feature to locate a field. You’ve got options!

In the above example, we used the ‘Equals’ operator to create our filter, however there are a number of operators you can use in building your reports. However, a word of caution: Watch your performance carefully when using ‘Not Equals’ as an operator. The full list of operators can be found here: https://help.salesforce.com/HTViewHelpDoc?id=filter_operators.htm.

Use Cross-Object Filters

Now that you’ve built a filter, let’s take this to the next level with cross-object filters, or “cross filters.” These allow you to extend your report types to objects related to the original objects defined in the report type. Cross filters help you fine tune your results, without writing code or using formulas. The most common use case is exception reporting. Here are some examples.

  • ‘Stale Opportunities’ - Opportunities without activities in the past 30 days
  • ‘Orphan Contacts’ - Contacts without Accounts
  • ‘Neglected Accounts’ - Accounts with no Opportunities

Check out this short video on cross filters:

Now let’s practice adding a cross filter to a report.

  1. Go to the Reports tab and click on New Report.
  2. Let’s select the ‘Contacts & Accounts’ report type and click Create.
  3. In the filters pane of report builder, click Add | Cross Filter.
  4. Select a parent object from the drop-down list. Your choice determines which related objects you see in the child object list. For this example, let’s select ‘Contacts’.
  5. Choose ‘with’ as the operator.
  6. Select a child object from the drop-down or search by its name. The drop-down list contains all eligible child objects of your selected parent object. For this example, let’s select ‘Opportunities’.
  7. Optionally add subfilters:
    1. Click Add Opportunities Filter.
    2. Select a field. The fields are determined by the child object in the cross filter. For example, if your cross filter is ‘Contacts with Opportunities’, you can use Opportunity fields for your subfilter. For this example, let’s select ‘Stage’ for our subfilter.
    3. Select ‘Equals’ for the operator.
    4. Click the lookup icon and select ‘Closed Won’.
    5. Click OK.

Good work! You’ve created a report that shows Contacts & Accounts, where the Contacts are related to Opportunities that are Closed Won. This kind of report could be used to identify Contacts you might want to invite to a local event for customers. If you add an additional subfilter on Opportunity Amount or Close Date, you can learn more about how big the deal was or when it closed.

Use Filter Logic

Now that you’ve learned how to apply filters to your report, you might want to apply logic, so that you can conditionally apply those filters. Enter filter logic, which allows you to specify conditions for your filters.

So when should you use filter logic? Let’s look at an example.
  1. Account Owner equals Allison Wheeler
  2. Industry equals Manufacturing
  3. Annual Revenue greater than 500,000

If you apply filter logic (1 AND 2) OR 3, then you’ll see any manufacturing accounts owned by Allison, or any accounts with a revenue greater than 500,000.

Alternatively, if you apply filter logic 1 AND (2 OR 3), you’ll see accounts owned by Allison that are either in the manufacturing industry or are greater than 500,000.

The following operators are available.

Operator Definition
AND Finds records that match both values.
OR Finds records that match either value.
NOT Finds records that exclude values.

To add filter logic, click Add | Filter Logic from the filters pane.

Note

Note

Every time you add a new filter, revisit your filter logic to make sure it’s still correct.

Resources

Flower icon used to indicate that the content is for Salesforce Classic

Remember, this module is meant for Salesforce Classic. When you launch your hands-on org, switch to Salesforce Classic to complete this challenge.

retargeting