---
schema_version: "1"
id: a564a490a9767dd754a797887bdeeaae876a83af00e096ec97227a1034ba9a20
title: Create a Clawback Rule in Salesforce Spiff
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/sales/264-0-0/spiff_clawback.md
canonical_url: https://help.salesforce.com/s/articleView?id=sales.spiff_clawback.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 06252f956b6c402d73592823ff99b7f3cf9a48fa43fd39deee75347690c916a0
description: Track reclaimed commission payouts with a clawback rule in Salesforce Spiff. A clawback is when a company reclaims a commission previously paid to a rep. Typically, clawbacks occur when a deal is canceled or terminated after a commission is disbursed. In Spiff, a clawback is often represented as a negative entry in a data filter for opportunities or deals, with a reference to the original opportunity for accountability.
products:
  - Sales Cloud
  - Sales Enablement
release: "264"
---
# Create a Clawback Rule in Salesforce Spiff

Track reclaimed commission payouts with a clawback rule in Salesforce Spiff. A clawback is when a company reclaims a commission previously paid to a rep. Typically, clawbacks occur when a deal is canceled or terminated after a commission is disbursed. In Spiff, a clawback is often represented as a negative entry in a data filter for opportunities or deals, with a reference to the original opportunity for accountability.

### 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="d100758e77">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d100758e77 ">To create a clawback rule:</td>

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

In this example, a rep closes a deal in June and receives a $500 commission payout. In August, the deal is canceled, but now the admin must reclaim the $500 commission that was paid. The reclaimed amount is the same amount that was paid, and the amount towards quota attainment isn't deducted from total attainment.

1. Create a data filter that identifies any cancellations for reclaiming commission paid.
    
    For example, create a one-to-one relationship, OpportunityToClawback, that matches the Opportunity object's Id field with the Clawback object's Opportunity\_Id field. See [Set Up a Data Relationship in Salesforce Spiff](https://help.salesforce.com/s/articleView?id=sales.spiff_relationship_create.htm&release=264.0.0&type=5 "To set up a relationship between two object data tables in Salesforce Spiff, select a field with a common value for both objects.").
2. Create a data filter, ClawbackInPeriod\_\_Opp, that identifies the clawback for the period.
    
    Using the `date_between?()` function, check whether the clawback occurred during a specific period.
    
    ```
    date_between?(OpportunityToClawback.Clawback_Date,BeginningOfMonth,EndOfMonth)
    ```
    
    ![Data filter for a clawback rule, using the date\_between?() function](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_clawback_date_between.png)
3. Create a data filter, ClawbackByRepInPeriod, that further filters the ClawbackInPeriod\_\_Opp results by rep.
    
    ```
    ClawbackInPeriod__Opp AND ByRep
    ```
4. In Designer, go to Plans and create a datasheet named ClawbackInPeriodData.
    
    <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="d100758e175-option" id="d100758e179">Object</th><td style="vertical-align:top;" headers="d100758e175-desc d100758e179">Opportunity</td></tr><tr class=""><th style="vertical-align:top;" headers="d100758e175-option" id="d100758e188">Data filter</th><td style="vertical-align:top;" headers="d100758e175-desc d100758e188">ClawbackByRepInPeriod</td></tr><tr class=""><th style="vertical-align:top;" headers="d100758e175-option" id="d100758e197">Fields</th><td style="vertical-align:top;" headers="d100758e175-desc d100758e197">Account_Name__c, ARR__c, CloseDate, and Clawback_Date</td></tr></tbody></table>
5. Set up the attainment calculation.
    1. With the `quotas()` function, reference the annual quota for the current year and the quota for the year in which the deal closed.
        
        If the clawback is from a previous year, reference that year's quota. If the clawback is from a deal that closed earlier in the current year, reference this year's quota.
    2. Create a calculated field, ClawbackAmountInPeriod, for the clawback amount.
        
        This formula depends on other fields that you create next.
        
        ```
        ClawbackAmountInPeriod = OppARR * CommissionRateClawback
        ```
    3. Define the CommissionRateClawback formula.
        
        This formula uses the `mpercent()` function to calculate the rate that was used when the deal closed. This formula requires a range table, SalesRepAcceleratorTable, with different payout tiers based on attainment.
        
        ```
        =mpercent(YTDAttainmentAttributableToOppClawback, SalesRepAcceleratorTable, YTDAttainmentAsOfPriorOppClawback)
        ```
    4. Define the YTDAttainmentAttributableToOppClawback formula.
        
        Divide ARR by the quota field for the year when the deal closed.
    5. Define the YTDAttainmentAsOfPriorOppClawback field .
        
        Subtract YTDAttainmentAsOfThisOppClawback from YTDAttainmentAttributableToOppClawback.
    6. Define the YTDAttainmentAsOfThisOppClawback field.
        
        ```
        =YTDQuotaRetirementAsOfThisOppClawback / QuotaInFiscalYearOfCloseDate
        ```
    7. Define the QuotaInFiscalYearOfCloseDate field by referencing the quota from the year that the deal closed.
    8. Define the YTDQuotaRetirementAsOfThisOppClawback field with the `let()` function.
        
        The `let()` function assigns a temporary name to a given value and uses that value when evaluating the expression. For a clawback, the `let()` function can dynamically accumulate previous ARR values. Divide the historical ARR accumulation by the quota for the period.
        
        ```
        =let(ThisOppCloseDate, CloseDate, let(ThisOppID, Id, sumif(ClosedWonByRepNewAllTime, year(CloseDate) = year(ThisOppCloseDate) AND CloseDate <= ThisOppCloseDate AND if(CloseDate = ThisOppCloseDate, Id <= ThisOppID, TRUE), ARR__c)))
        ```
6. Add the ClawbackAmountInPeriod field as a payout rule.

#### See Also

- [Accelerators in Salesforce Spiff](https://help.salesforce.com/s/articleView?id=sales.spiff_accelerator.htm&release=264.0.0&type=5 "An accelerator in Salesforce Spiff helps your sales team amplify their earnings when they achieve outstanding results. Spiff provides multiple options for implementing accelerator rates in your commission plans.")
- [Data Relationships in Salesforce Spiff](https://help.salesforce.com/s/articleView?id=sales.spiff_relationship.htm&release=264.0.0&type=5 "Salesforce Spiff organizes data used for calculating commissions in multiple separate tables. To calculate commission logic correctly or create data filters, establish relationships between tables. A relationship requires a field in each table with a common value. For example, to connect Deals with Accounts, the values of the Deals table's CustomerAccount field match the values of the Accounts table's external_id field.")
- [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.")
- [quotas](https://help.salesforce.com/s/articleView?id=sales.spiff_function_ref_quotas.htm&release=264.0.0&type=5 "Returns a list of quota values from a quota table in Salesforce Spiff. The quota values are for a specific user in a specific time period.")