---
schema_version: "1"
id: 5bbb68706c09219ba2185a953160ae8679bb729a346b79780206ae2b0330cc30
title: Create an Accumulated Variable for a Marginal Payout Function
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/sales/264-0-0/spiff_accelerator_accumulated_variable_create.md
canonical_url: https://help.salesforce.com/s/articleView?id=sales.spiff_accelerator_accumulated_variable_create.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: a0afd1bef9ef515b8ce0d52f381b7c51a1985b00dd70b778e3a0c9d231f40693
description: Create an accumulated variable for the initial_value argument in the mamount() and mpercent() accelerator functions in Salesforce Spiff.
products:
  - Sales Cloud
  - Sales Enablement
release: "264"
---
# Create an Accumulated Variable for a Marginal Payout Function

Create an accumulated variable for the initial\_value argument in the `mamount()` and `mpercent()` accelerator functions in Salesforce Spiff.

### 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="d98196e86">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d98196e86 ">To configure an accumulated variable in Spiff Designer:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d98196e86 ">
              <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>

1. In a datasheet, create a calculated field, Accumulated\_ARR, and enter the variable that you want to accumulate, ARR\_\_c.
    
    ![Accumulated\_ARR column in a datasheet](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_accelerator_accumulated_variable_arr.png)
2. In the right panel, open Accumulation and turn on **Accumulated**.
3. Optionally, select Accumulation Filter and Accumulation Sort options.
    
    <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small "><tbody><tr class=""><th style="vertical-align:top;" headers="d98196e150-option" id="d98196e154">Accumulation Filter</th><td style="vertical-align:top;" headers="d98196e150-desc d98196e154">The data filter for the accumulated variable. Typically, this filter is the same data filter applied to the commission rule. For example, if the datasheet uses the ClosedInPeriod data filter, also use ClosedInPeriod for the accumulation filter. The ClosedInPeriod accumulation filter specifies that accumulation restarts at the beginning of each period.</td></tr><tr class=""><th style="vertical-align:top;" headers="d98196e150-option" id="d98196e163">Accumulation Sort</th><td style="vertical-align:top;" headers="d98196e150-desc d98196e163">The value to sort accumulated records by. Sorting by CloseDate accumulates ARR in chronological order. To sort deals that close on the same day, select a different field, such as ID.</td></tr></tbody></table>
    
    ![Accumulation Filter and Accumulation Sort values for an accumulated variable](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_accelerator_accumulated_variable_filter.png)
4. Save your changes.
    
    The The Accumulated\_ARR field accumulates values throughout the period. The last value in chronological order is the sum of all of the ARR\_\_c for the period.
    
    ![Accumulated\_ARR column in the datasheet, showing accumulated values for the period](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_accelerator_accumulated_variable_sum.png)
5. Create another calculated field, Previous\_ARR, that subtracts the current deal ARR from the accumulated ARR.
    
    The Accumulated\_ARR represents a running total of ARR after each deal is closed. But if you want to know a rep's ARR before a current deal closed, remove the value of the current deal from the accumulation.
    
    ```
    =Accumulated_ARR - ARR__c
    ```
    
    ![PreviousARR column in the datasheet](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_accelerator_accumulated_variable_previous.png)
    
    Use PreviousARR for the initial\_value argument in the `mamount()` and `mpercent()` functions.

#### See Also

- [Accumulated Variables in Salesforce Spiff](https://help.salesforce.com/s/articleView?id=sales.spiff_accumulated_variable.htm&release=264.0.0&type=5 "An accumulated variable is like a running total, where Salesforce Spiff sums a field or value within a sorted data filter and returns a cumulative value up to a current record. An accumulated variable helps you quickly sum multiple values with fewer calculations.")
- [Considerations for Accelerator Functions in Salesforce Spiff](https://help.salesforce.com/s/articleView?id=sales.spiff_accelerator_functions.htm&release=264.0.0&type=5 "Salesforce Spiff provides several functions that support accelerators, including mamount(), mpercent(), range_lookup(), and tier_payout.")
- [mamount](https://help.salesforce.com/s/articleView?id=sales.spiff_function_ref_mamount.htm&release=264.0.0&type=5 "Returns the commission total for a deal in Salesforce Spiff, based on a range table and the rep's current attainment. To return a commission rate instead, use the mpercent() function.")
- [mpercent](https://help.salesforce.com/s/articleView?id=sales.spiff_function_ref_mpercent.htm&release=264.0.0&type=5 "Returns the commission rate for a deal in Salesforce Spiff, based on a range table and the rep's current attainment. To return a commission total amount instead, use the mamount() function.")