---
schema_version: "1"
id: 3cd29d6ff382253d66baa104e5fa9fdc312b31e70f412642e3681df5dabe6083
title: Determining a Rep's Team Membership Status When a Deal Closes
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/sales/264-0-0/spiff_teams_deal_close.md
canonical_url: https://help.salesforce.com/s/articleView?id=sales.spiff_teams_deal_close.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 0adf902e1a5fe42f4e848030c2fda7fb2821f10ac2ff22d7a0756d6f61fedca2
description: Calculate rollups, territories, and split percentages for reps correctly in Salesforce Spiff. Determine whether a rep is part of a team on the date when a deal closes. You can use data filters or worksheet calculations.
products:
  - Sales Cloud
  - Sales Enablement
release: "264"
---
# Determining a Rep's Team Membership Status When a Deal Closes

Calculate rollups, territories, and split percentages for reps correctly in Salesforce Spiff. Determine whether a rep is part of a team on the date when a deal closes. You can use data filters or worksheet calculations.

### 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>

## Data Filters

Team membership status is often an issue with rollups or territories. ‌For example, a rep is part of the East team and is credited for East deals closed during their tenure with the team. ‌Or, a manager receives credit for deals closed by team members. ‌However, it's crucial that they were on the team on the specific close date, not just within the same period.

With a guided rollup, you can automate the comparison of team effective dates with a selected date field.

![Guided rollup](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_teams_closedate_guided_rollup.png)

In this scenario, the guided rollup returns deals where the `CAM__c` field matches a rep and that rep was effectively part of the team on the deal's `CloseDate`. The selected timeframe, Rolling 5 Years, means that the filter matches deals from the previous five years. This timeframe doesn't mean that the rep has to be on the team only at some point during those five years.

Alternatively, you can use a double-filter.

 
| Item | Formula |
| --- | --- |
| Filter | `contains(ListOfDealClosedByTeamMembers, Id)` |
| Summary Calculation | `ListOfDealClosedByTeamMembers = transform_list(filter(DealsInSpecifiedPeriod, ClosedByActiveTeamMember), Id)` |
| Calculated Field | `ClosedByActiveTeamMember` |

## Calculations

Guided rollups are useful for returning the correct deals, but commission logic often requires a similar check within the payout logic. ‌For example, when a manager receives credit for deals, they typically obtain related rollup credit. ‌If a rep contributes to closing a deal and receives a 30% split, the manager also receives 30% credit. ‌If many reps help close the deal, such as one rep with a 30% split and another rep with a 30% split, the manager gets the total amount, which is 60%.

The `members()` function returns a list of reps for a given team or teams and date ranges. ‌In this case, return the reps for a specific date by setting the start date and end date as the same date. There are multiple ways to retrieve team objects, and the `members()` function will also accept various input values, such as team names (strings).

For example, maybe you want to check an opportunity owner. ‌All fields are built on the Opportunity object, and the dates specified are the `CloseDate`. ‌The first calculation, ClosedByActiveTeamMember, returns `true` or `false` and other calculations can reference it, like the double filter.

```
ClosedByActiveTeamMember = contains(TeamMembers_OnCloseDate, OwnerId)
```

```
TeamMembers_OnCloseDate = members(ManagersTeams, CloseDate, CloseDate)
```

```
ManagersTeams = direct_manager_of(CloseDate, CloseDate)
```

In another example, maybe you want to check split owners for a sum of their splits. ‌This example uses the same team calculation, because the specific date is linked to the opportunity. ‌In certain scenarios, the team member list and subsequent uses of that list can pertain to the Opportunity Split level. ‌In such cases, apply the same logic and replace `CloseDate` with `Relationship.CloseDate`.

```
SplitPercentageRollup = sumif(OppToOppSplits, contains(TeamMembers_OnCloseDate, SplitOwnerId), Split_Percentage)
```

```
TeamMembers_OnCloseDate = members(ManagersTeams, CloseDate, CloseDate)
```

```
ManagersTeams = direct_manager_of(CloseDate, CloseDate)
```

#### See Also

- [Create a Double Filter in Salesforce Spiff](https://help.salesforce.com/s/articleView?id=sales.spiff_data_filter_double.htm&release=264.0.0&type=5 "When you’re creating a data filter, there are limitations on how much you can manipulate the data. In these cases, use double filtering. For example, calculated fields aren’t supported in filters, but you can still use a calculated field in a filter by combining the filter() function, a summary calculation, and the contains() function.")