Analyzing Analytic Snapshots

11/12/2012 by Roger Mitchell
Diving into Analytic Snapshots: basics, setup, and a use case.

Analytic Snapshots is not a new feature to Salesforce, and has been around since Summer ‘08. Snapshots solve the problem of capturing data at specific time intervals to use later for analytics and trending. Prior to these, if a user needed to capture data in this fashion, it would require them run a report and export it on a specific interval, and perform analytics external to Salesforce.

Give me the basics

An Analytic Snapshot combines a tabular or summary report, a custom object, and a time interval to capture data from a moment in time as records in Salesforce. The report acts as the data source for the snapshot, and the snapshot will create a record on the custom object for every row that exists in the source report. Data from each column populates a field on the custom object to house this data. After running a snapshot, users can create reports to slice and dice their snapshot data.

Setting it up

Before creating an Analytic Snapshot, you must have already created your report and custom object and fields. The easiest way to do this is to create the source report and have it open in a separate tab, then create a custom object, and a field for each column that is captured in the snapshots. When these are set up, go to Your Name → Setup → Administration Setup → Data Management → Analytic Snapshots and create a new snapshot. Source reports are run as a specific user, very much like dashboards, and this user is specified when creating the snapshot. To avoid missing data due to visibility, ensure that the selected user that has the desired level of access.

Salesforce pulls in the report columns and custom fields in the next step, and columns are then mapped to fields. Considering Opportunities, if Stage and Probability are two columns from the source report, these would be mapped to Stage and Probability fields on the custom object. The final step is setting up the scheduled run for the snapshot. Like reports and dashboards, this can occur daily, weekly, or monthly during a specified date range and start time.

Use case: student’s membership status

Capturing data at specific time intervals is applicable to a few uses cases, which is why Analytic Snapshots are not spoken of often. A client approached us with a business problem where they track students and the students’ monthly membership status. This status is determined based on their monthly attendance and a list of ranges:

  • Active = 5+ hours
  • Inactive = 0 - 5 hours
  • Non-Member = 0 hours

Attendance data is tracked in a custom object as records. A filtered roll up summary field on the contact summates the number of hours that a student has attended in a particular month. This number combined with the ranges above drives a formula field, and every student starts the month as a non-member.

The client’s interest lies in trending and viewing monthly status history, hence where Analytic Snapshots come into play. We created a source report with the contact’s name, account name, status, and contact ID, and feed this into an analytic snapshot that runs at the end of every month. To satisfy their requirement to see a specific contact’s history, a custom button was created that passes the contact’s ID into a report filter, which will only return status records for that contact.

If you have any interesting use cases for Analytic Snapshots, or want to see if a business problem can be solved with snapshots and configuration, be sure to leave a comment on Facebook or below via Disqus, or tweet at me directly @RogerMitchell.