---
schema_version: "1"
id: 6f5e620e85b0b3eeecce675f503e6dcf84b34a6ff46077e9e1525db9ac9e6f1e
title: Create a Leaderboard Rule with Emoji
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/sales/264-0-0/spiff_statement_emoji_leaderboard.md
canonical_url: https://help.salesforce.com/s/articleView?id=sales.spiff_statement_emoji_leaderboard.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: aa0b41b2690f5c2691d2151b1f4a3e8b38617ba1bd62ca5e5903964a2359a4e7
description: Encourage reps to meet company goals by adding emoji to the visual display of team performance rankings.
products:
  - Sales Cloud
  - Sales Enablement
release: "264"
---
# Create a Leaderboard Rule with Emoji

Encourage reps to meet company goals by adding emoji to the visual display of team performance rankings.

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

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

To create a leaderboard rule, establish a guided rollup that uses the User object and returns all of the specific users that you want on the leaderboard. Depending on the requirements, select different options to determine the participants. Create calculated fields in a specific order so your data applies to each user in the data set.

1. Using the rollup that you created, create a calculation that returns the number of total participants in the leaderboard.
    
    ```
    count(AE_Leaderboard)
    ```
    
    ![Leaderboard participant count calculation](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_emoji_leaderboard_count.png)
2. Create a calculation that returns the quota for each user in the data filter, not just the user selected in the context menu.
    
    To handle null values, use the default value in the right panel instead of the `OR 0` addition.
    
    ```
    quota("QuotaAE", statement_period.end_date, user) OR 0
    ```
    
    ![Leaderboard quota calculation](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_emoji_leaderboard_quota.png)
3. Create a calculation that returns the amount of revenue closed for the user in the period.
    
    Make sure your data filter doesn’t filter by rep. The `sumif` part of the function performs the conditional rep filtering. If your data filter is filtered by rep, results are shown only for the rep selected in the context menu.
    
    ```
    sumif(ClosedWonInPeriod, OwnerId = user.Id, AR__c)
    ```
    
    ![Leaderboard closed deal calculation](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_emoji_leaderboard_closed.png)
4. Create a calculation that returns the monthly attainment.
    
    To prevent errors when dividing by zero, divide revenue in the period by quota with a null check.
    
    ```
    if(MonthlyAEQuota > 0, UserClosedRevenueInPeriod / MonthlyAEQuota, 0)
    ```
    
    ![Leaderboard monthly attainment calculation](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_emoji_leaderboard_attainment.png)
5. Create a calculation that ranks the users based on their attainment.
    
    The `rank` function returns the opposite of what you expect. If there are five reps, the highest rep returns a `5`. Subtracting the rank from the total and adding `1` reverses the order and puts the highest attainment at `1`.
    
    ```
    Total_AEs - rank(user, AE_Leaderboard, LeaderboardMonthlyAEAttainment) + 1
    ```
    
    ![Leaderboard rank calculation](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_emoji_leaderboard_rank.png)
    
    The top-level formula takes the leaderboard rank and multiplies it by zero because you aren’t summing the ranks, but you want to see the ranks on the leaderboard.
    
    ```
    AE_MonthlyLeaderboardRank * 0 + LeaderboardFields
    ```
    
    ![Leaderboard rank display calculation](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_emoji_leaderboard_rank_show.png)
6. Add the leaderboard fields for visibility on the statement.
    
    <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="d17574e272-option" id="d17574e276">AE_Quota</th><td style="vertical-align:top;" headers="d17574e272-desc d17574e276">A summary calculation that can be a statement metric for each specific user and shows their quota.</td></tr><tr class=""><th style="vertical-align:top;" headers="d17574e272-option" id="d17574e285">AE_Rank</th><td style="vertical-align:top;" headers="d17574e272-desc d17574e285">A version of the AE_MonthlyLeaderboardRank formula.</td></tr><tr class=""><th style="vertical-align:top;" headers="d17574e272-option" id="d17574e294">FullName</th><td style="vertical-align:top;" headers="d17574e272-desc d17574e294">A duplicate of the normalized Name field on manually imported data. Normalized fields aren’t available on statements, so duplicating them allows the extra field to be used.</td></tr></tbody></table>
    
    ```
    if(AE_Quota,0,0) + if(AE_Rank,0,0) + if(FullName,0,0)
    ```
    
    ![Leaderboard emoji visibility calculation](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_emoji_leaderboard_visibility.png)
7. Add emoji to the leaderboard with the nested `if` function and set your rankings with the emoji you want.
    
    ```
    if(AE_MonthlyLeaderboardRank = 1, "1st 🥇",
    if(AE_MonthlyLeaderboardRank = 2, "2nd 🥈",
    if(AE_MonthlyLeaderboardRank = 3, "3rd 🥉",
    if(AE_MonthlyLeaderboardRank > 3, AE_MonthlyLeaderRank, 0))))
    ```
    
    ![Leaderboard calculation to add emoji](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_emoji_leaderboard_final.png)

#### See Also

- [Rollup Filters in Salesforce Spiff](https://help.salesforce.com/s/articleView?id=sales.spiff_rollup.htm&release=264.0.0&type=5 "Give credit for closed deals to users who don't own the deal in Salesforce Spiff. For example, let managers receive credit for the deals closed by their team members. Or, a user on one team gets credit deals closed by another team. In Spiff, implement a rollup with a guided rollup, plan assignment custom field, or team function.")