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.
Instructions
- 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!
Resources
- Video: Hands-On Training: Custom Report Types
- Trailhead: Getting Started with Reports and Dashboards
- Salesforce Help: Create a Custom Report Type
Thank you so much!!! No longer hitting my head on my keyboard. Most thankful!
LikeLiked by 1 person
You’re welcome, Sheila. Glad to help!
LikeLike
Doug, this is great. Can you tell me why I can’t do the same with the Campaign Member reports? It’s not an option when creating a Custom Report Type.
LikeLiked by 1 person
Hi Chris,
I’m able to get a date filter on my reports, could you provide more details about your setup and whether you are in Classic or Lightning experience?
In Lightning Experience, with the Lightning Report Builder (beta) enabled to create my report using standard report type “Campaigns with Campaign Members” then I can add date filters to the report. Then when viewing the report in Lightning Experience I can filter on date fields like Start Date.
In Classic Experience, the standard report type “Campaigns with Campaign Members” does not offer date filter options (hence this blog post).
When I create a custom report type with primary object “Campaign” with or without related “Camapaign Member” records then when I create a report using that report type I can see date filter available in both Classic and Lightning.
Doug
LikeLike
Thanks for the reply, Doug, but I was able to figure it out.
LikeLiked by 1 person