---
schema_version: "1"
id: 6439f98eba03b7a9dc7aa52f62b3d2d3dde423813b5e91476de129c1681ea4d1
title: Calculate Year Over Year Growth Aggregates by Member (Example)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/admin_rebates_calculate_yoy_growth_aggregates.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.admin_rebates_calculate_yoy_growth_aggregates.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: d8090209f4bdcc64cb9f49a326aad30f4f373253878a90ef7c223acd81beb38d
description: This example shows how you can use the Year over Year Growth Aggregate using Member template to compare aggregate values for the same payout periods for the current and previous years.
products:
  - Partner Cloud
  - Cross Cloud
  - Manufacturing
release: "264"
---
# Calculate Year Over Year Growth Aggregates by Member (Example)

This example shows how you can use the Year over Year Growth Aggregate using Member template to compare aggregate values for the same payout periods for the current and previous years.

### 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: <strong>Enterprise</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions that have Rebate Management enabled.</td></tr></tbody></table>

## Transaction Journal Records

Acme is a member of a rebate program. Here are the sample Transaction Journal records for Acme for January 2021 and January 2020.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:25%">
          <col style="width:25%">
          <col style="width:25%">
          <col style="width:25%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d34134e73">Member</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d34134e76">Activity Date</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d34134e79">Transaction Quantity</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d34134e82">Transaction Amount</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Member" class="slds-cell-wrap" rowspan="2" style="vertical-align:top;" headers="d34134e73 ">
              <p style="margin-bottom:0;">Acme</p>
            </td>

            <td data-label="Activity Date" class="slds-cell-wrap" style="vertical-align:top;" headers="d34134e76 ">05 Jan 2021</td>

            <td data-label="Transaction Quantity" class="slds-cell-wrap" style="vertical-align:top;" headers="d34134e79 ">150</td>

            <td data-label="Transaction Amount" class="slds-cell-wrap" style="vertical-align:top;" headers="d34134e82 ">$50,000</td>

          </tr>
          <tr class="">
            <td data-label="Activity Date" class="slds-cell-wrap" style="vertical-align:top;" headers="d34134e76 ">14 Jan 2020</td>

            <td data-label="Transaction Quantity" class="slds-cell-wrap" style="vertical-align:top;" headers="d34134e79 ">60</td>

            <td data-label="Transaction Amount" class="slds-cell-wrap" style="vertical-align:top;" headers="d34134e82 ">$15,000</td>

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

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-channel_revenue_mgmt-264-0-0-production-enus/0afcbbd8-b325-4d62-baa1-63243d1c10aa/images/icon_note.png)

Note A member usually has multiple transaction records for a month, but here only one record is shown.

## Benefit Tiers

The rebate program offers a growth-based rebate type. The program has 12 monthly payout periods. Members are rewarded if they record an increase in sale quantity compared to the same payout period for the previous year.

The program manager defines these benefit tiers for the growth-based rebate type:

- Tier 1: Offers a 5% rebate on the total transaction amount when the growth quantity is less than 50 units.
- Tier 2: Offers an 8% rebate on the total transaction amount when the growth quantity exceeds 51 units.

## Data Processing Engine

The Transaction Journal records for a payout period are filtered and aggregated for the current year and the previous year. The definition then adds the member’s previous transaction amount, current transaction amount, previous transaction quantity, and current transaction quantity. Total values are updated in the Rebate Member Product Aggregate object. One aggregate record is created per rebate type per member.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-channel_revenue_mgmt-264-0-0-production-enus/0afcbbd8-b325-4d62-baa1-63243d1c10aa/images/icon_note.png)

Note

If you've customized the Year over Year Growth Aggregate using Member Data Processing Engine definition or based it on an earlier template, update your aggregation logic to correctly handle leap year scenarios. Replace the function `ADDMONTHS({EndDate}, -12)` with the following expression: `IF((SUBSTR(TEXT({EndDate}),6,2) != SUBSTR(TEXT(ADDDAYS({EndDate},1)),6,2)),ADDDAYS(DATEVALUE(CONCAT(SUBSTR(TEXT(ADDMONTHS(ADDMONTHS({EndDate},-12),1)),0,8), "01"), "yyyy-MM-dd"),-1),ADDMONTHS({EndDate} ,-12))`.

Replace ‘{EndDate}’ with the actual date field used in your DPE definition. This update ensures accurate year-over-year calculations regardless of leap years.

## Aggregate Data

This sample record is created in the Rebate Member Product Aggregate object for January.

         
| Record | Member | Prior Total Quantity | Total Quantity | Growth Quantity | Growth Quantity Percent | Prior Total Amount | Total Transaction Amount | Growth Amount | Growth Amount Percent |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Record 1 | Acme | 60 | 150 | 90 | 60% | $15,000 | $50,000 | $35,000 | 70% |

These values update whenever the scheduled flow runs. The flow triggers the data processing engine definition. The aggregate values on the payout calculation date for Jan FY21 are used to update the final payout amount in the Member Payout object.

## Final Payout

Acme’s payout is based on the Tier 2 benefit because the growth quantity exceeds 50 units. So, for January 2021, Acme receives $4,000 (8% of $50,000).