On most standard and custom object reports, Salesforce provides a Time Frame date range filter that lets you specify either literal values (e.g. 12/9/2015) or relative values (e.g. Current FY or This Month or Yesterday) to filter data:
However, the Time Frame date range is not immediately available with standard Campaign report types:
Why is this a problem, you ask?
The relative time range filters are powerful because they dynamically filter data based on rolling dates so that as the user you aren’t always having to change the filter each time you run the report. For example, without relative time range filters when you go to run a report you would have to change the date filter because it would still be querying data from say last Tuesday (or whatever the last saved date filter value was) =/
The relative time range is especially important when you begin scheduling reports to run automatically and send email notifications or custom apex actions as you usually are wanting data from some relative time, like “Yesterday” or “Last Week” and not a specific date. In fact, I recently wrote a post about leveraging the report subscriptions feature introduced in Spring ’15 to add contacts from a report to a campaign on a schedule.
So how do we fix this?
Custom Report Types
Very simply, create a custom report type for Campaigns and you’ll magically now have the awesome Time Frame date range filter available in your reports when using that report type.
- In Salesforce Classic UI, go to Setup | Create | Report Types
- Click New Custom Report Type button
- Choose Campaigns as your Primary Object
- Fill out the other required information (label, unique name, description, category, deployment status)
- Click Next button
- Click Save button
- Go to Reports tab and create a new report using your custom campaign report type
- Notice the Time Frame date range filter now available on your report!