---
schema_version: "1"
id: 2f9c73321aed845e8ba99d0e2231e39dca06424157576771b5761adcfe14192b
title: Solve Data Drift Issues in a Rep's Statement with Historical Data
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/sales/264-0-0/spiff_statements_data_drift.md
canonical_url: https://help.salesforce.com/s/articleView?id=sales.spiff_statements_data_drift.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: ac40386c41abac9eab01e7470ffaca079e72854d7030bb2fe50884361164f36d
description: Data that changes over time causes data drift. For example, an opportunity that changed ownership as it moves through different stages can show up in a rep's data filter in Q1 but not in Q2. Salesforce Spiff administrators sometimes need to know the commission value from a previous period, such as how much a rep earned on new deals three months ago. Because of data drift, that value can be different now than it was when the commission statement was first calculated. To overcome this issue and look up past commission statement and payout rule values, use the amounts_from function.
products:
  - Sales Cloud
  - Sales Enablement
release: "264"
---
# Solve Data Drift Issues in a Rep's Statement with Historical Data

Data that changes over time causes data drift. For example, an opportunity that changed ownership as it moves through different stages can show up in a rep's data filter in Q1 but not in Q2. Salesforce Spiff administrators sometimes need to know the commission value from a previous period, such as how much a rep earned on new deals three months ago. Because of data drift, that value can be different now than it was when the commission statement was first calculated. To overcome this issue and look up past commission statement and payout rule values, use the `amounts_from` function.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: both Salesforce Classic (not available in all orgs) and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available for an additional cost in: <strong>Professional</strong> Edition with Web Services API Enabled</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d46148e81">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d46148e81 ">To create worksheet calculations:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d46148e81 ">
              <p>A Spiff <a href="https://help.salesforce.com/s/articleView?id=sales.spiff_users_roles_and_permissions.htm&amp;release=264.0.0&amp;type=5" title="Give users the appropriate level of access so they can be successful in Salesforce Spiff, and enforce the principle of least privilege. Assign a default role to each user, or create custom roles with access to specific Spiff functionality.">user role</a> with this permission turned on.</p>
              <p style="margin-bottom:0;">Designer Configuration: Manage</p>
            </td>

          </tr>
        </tbody>
      </table>

For example, to accurately calculate Year-to-Date (YTD) totals for Closed ARR, use the `amounts_from` function to combine current month live data with historical data from previous months.

1. Create a ghost rule to calculate the current period valuesuch. Name the rule Historical ARR Ghost Rule.
    
    Ghost rules are invisible to reps and don't affect commission totals.
2. For the final payout amount, create a worksheet calculation that sums the total ARR for the deals closed in the period.
    
    This payout rule references closed ARR for each period and is unaffected by data drift.
    
    ```
    =sum(ClosedInPeriod, ARR)
    ```
    
    ![Create the Historical ARR ghost rule.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sales-sales_performance_management-264-0-0-production-enus/b1f2feb4-26b8-444f-97f7-be2349869d93/sales_performance_management/images/spiff/spiff_statements_historical_values.png)
3. Create the historical values worksheet calculation that sums the amounts for the ghost rule for every period before the current period for the calendar year.
    
    ```
    PriorMonthsHistoricalData = amounts_from(BeginningOfYear, EndOfPriorPeriod, “PlanName”, “Historical ARR Ghost Rule”)
    ```
    
    The EndOfPriorPeriod date prevents pulling prior year values in the first period. The formula includes every period except the current period so that the current period is still updated as new ARR values are added.
4. Create a YTD calculation by summing the closed ARR from all previous periods in the year and the current monthly total.
    
    ```
    YTD_Total = CurrentMonthLiveData + PriorMonthsHistoricalData
    ```
    
    ```
    CurrentMonthLiveData = sum(ClosedInPeriod!ARR)
    ```

#### See Also

- [amount\_from](https://help.salesforce.com/s/articleView?id=sales.spiff_function_ref_amount_from.htm&release=264.0.0&type=5 "Returns a commission amount for a specific payout rule or the total commission amount from a previous statement period in Salesforce Spiff. A commission plan that pays year-to-date totals and subtracts previous earnings can use this function to reference and subtract commission amounts.")