AnalyticSnapshot

Represents an analytic snapshot. An analytic snapshot lets you report on historical data. Authorized users can save tabular or summary report results to fields on a custom object, then map those fields to corresponding fields on a target object. They can then schedule when to run the report to load the custom object's fields with the report's data. Analytic snapshots enable you to work with report data similarly to how you work with other records in Salesforce.

Declarative Metadata File Suffix and Directory Location

Force.com AnalyticSnapshot components are stored in the analyticSnapshots directory of the corresponding package directory. The file name matches the unique name of the analytic snapshot, and the extension is .analyticsnapshot.

Version

Force.com AnalyticSnapshot components are available in API version 16.0 and later.

Fields

Field Field Type Description
description string A description of the analytic snapshot.
fullName string The analytic snapshot name used for API access. The name can only contain characters, letters, and the underscore (_) character, must start with a letter, and cannot end with an underscore or contain two consecutive underscore characters. This field is inherited from the Metadata component.
groupColumn string A column that specifies which level to extract data from the source report. It is only applicable for summary reports.
mappings AnalyticSnapshotMapping[] A list of analytic snapshot mappings. For valid values, see AnalyticSnapshotMapping.
name string Required. The display name of the analytic snapshot.
runningUser string The username of the user whose role and sharing settings are used to run the analytic snapshot.
sourceReport string Required. The report where data will be extracted from.
targetObject string Required. The custom object where data will be inserted into.

AnalyticSnapshotMapping

AnalyticSnapshotMapping defines the mapping for the analytic snapshot. Valid values are:

Field Field Type Description
aggregateType ReportSummaryType[] (enumeration of type string) List that defines if and how each report field is summarized. For valid values, see ReportSummaryType.
sourceField string The sourceField can be one of the following:
  • The field on the sourceReport that you want to map to the targetField in the targetObject
  • A summary of a filed on the sourceReport (for Summary reports only)
  • A field on the analytic snapshot, such as JobName, RunningUser, or ExecutionTime (set through the user interface)

Note: The sourceField must correspond to the sourceType you specify.

sourceType ReportJobSourceTypes[] (enumeration of type string) List that defines the report format for the analytic snapshot. For valid values, see ReportJobSourceTypes.
targetField string A field on the targetObject into which this particular sourceField will be inserted.

ReportJobSourceTypes

An enumeration of type string that defines the report format for the analytic snapshot. Valid values are:

Enumeration Value Description
snapshot Use this option if the sourceField contains snapshot-specific information such as JobName, RunningUser, or ExecutionTime.
summary Use this option if referencing a summary (Sum, Average, Minimum, Maximum) of a field from the sourceReport.
tabular Use this option if referencing an available column from the sourceReport.

Declarative Metadata Sample Definition

A sample XML definition of an analytic snapshot is shown below.

<?xml version="1.0" encoding="UTF-8"?>
<AnalyticSnapshot xmlns="http://soap.sforce.com/2006/04/metadata">
    <description>my description</description>
    <groupColumn>INDUSTRY</groupColumn>
    <mappings>
        <aggregateType>Average</aggregateType>
        <sourceField>SALES</sourceField>
        <sourceType>summary</sourceType>
        <targetField> myObject __c.Name</targetField>
    </mappings>
    <mappings>
        <sourceField>ExecutionTime</sourceField>
        <sourceType>snapshot</sourceType>
        <targetField> myObject __c.field3__c</targetField>
    </mappings>
    <mappings>
        <sourceField>INDUSTRY</sourceField>
        <sourceType>tabular</sourceType>
        <targetField>testObject__c.Name</targetField>
    </mappings>
    <name>my snapshot</name >
    <runningUser>user@salesforce.com</runningUser>
    <sourceReport>myFolder/mytSummaryReport</sourceReport>
    <targetObject>myObject__c</targetObject>
</AnalyticSnapshot>
© Copyright 2000–2014 salesforce.com, inc. All rights reserved.
Various trademarks held by their respective owners.