Author: Rishabh Dubey
Requirement : The management wants to check how their opportunity pipeline is moving every month. They want to check on the 1st of every month how many opportunities are open and how many have been closed and what their stages are. The management also wants to keep this historical data for reporting purposes.
Solution : This can not be done using Standard salesforce Reports. A reporting snapshot needs to be created that will run every month on the first day to store the data.
Reporting Snapshot : A Reporting Snapshot lets you report on historical data, and captures and stores data at a specific scheduled time over a period of time.
It is very common that the business users use Salesforce Reports to view their organization data frequently, but when they run the report, it would display only the most recent data available at the time of running the report. If the users need to analyze the data changes over a period of time—last few months, weeks, days, etc., Salesforce provides a very useful feature to accomplish it, and the feature is called Reporting Snapshot.
Steps to create Historical Reporting Solutions
- Create a source Report
- Create target Object
- Create a Reporting Snapshot
- Create Report on target object record
1. Create a Source Report
For our requirement the source report needs to be created on the Opportunity object that will show the current pipeline.
- Go to reports tab
- Click on new report and select opportunity Report type
- Set the filters as follows
- Column should be as follows
- Save the report in the Public folder.
2. Create Target object to store the historical data
The Target Object is used to store the data generated by the report. The data will be stored at the time of the scheduling. It should have at least one field to map with the Source Report. The fields are created with the same data type as the report’s columns. It’s better to create the object and name it clearly as being a Snapshot Object such as “Opportunity Pipeline Snapshot’.
We can generate Reports and Dashboards from the Target Object
- Go to object manager, click on create new custom object.
- Name the object “Opportunity Pipeline Snapshot” and select Allow reports checkbox
- Click on save
- Now we will need to create custom fields for all the columns of our source report in our target object.
|Report Column||New Field Name||New Field Data Type|
|Opportunity Owner||Opportunity Owner||Text|
|Account Name||Account Name||Text|
|Opportunity Name||Opportunity Name||Text|
3. Create and Define Reporting Snapshot
- Go to setup type reporting snapshots
- Click on “Reporting Snapshots”
- Click on New Reporting Snapshot
- Name = “Monthly opportunity Pipeline”
- Running user = Add yourself
- Source Report = Opportunity Source Report
- Target object = opportunity Pipeline Snapshot
- Click on save and edit mappings
- Mapping should be as follow
|Account Name||Account Name (Text(255))|
|Amount||Amount (Currency(18, 0))|
|Opportunity Name||Opportunity Name (Text(255))|
|Opportunity owner||Opportunity Owner (Text(255))|
|Reporting Snapshot Name||Opportunity Pipeline Snapshot Name (Text(80))|
- Click on save
- Schedule the frequency for the snapshot
- Select Monthly on day 1 of every month\
- Start date should be today and end date can be after 5 year.\
- Click on save
The Snapshot will run at 1 am on every first day of the month and you will see records created on the target object.
4. Create report on Source object
Once the snapshots run on the scheduled time you will be able to see records created on the Target objects.
The report needs to be created on this target object
- Go to reports tab click on new
- Select Record Type – “Opportunity Pipeline Snapshot”
- Filter should be All records and all time.
- Group the report by created date and group date by calendar Month.
- Add stage as other grouping and add Amount as Column
- Click on Add chart select “Stacked column”
- On X-axis select created date, On Y-axis select Sum of account and stack by stage.
The Report will show only one bar for the first month. But as soon as the snapshot runs for the coming months, there will be additional bars for corresponding months.
Pros and Cons of Reporting Snapshot
- Measure the effectiveness of business for a period of time.
- Get the historic trend data and store the report’s data as records in an object.
- View the data differently, by creating the views in the Target object.
- Only 100 fields are allowed in the Target object.
- 2000 records are allowed to load at a time.
- Record deletion is protected.
- Custom frequencies like quarterly and semi-annually can not be defined.