This example shows how you can use the Aggregate by Account template to aggregate transaction records for an account that’s added as a member in two rebate programs.
Required Editions
| Available in: Enterprise, Unlimited, and Developer Editions that have Rebate Management enabled. |
Transaction Journal Records
Acme is an account in an org and is a beneficiary of multiple rebate programs where it’s enrolled as a member. The admin has created a lookup field on the Transaction Journal object for Account. Here are sample Transaction Journal records for January 2021.
| Member | Product | Transaction Quantity | Product Unit Price | Transaction Amount |
|---|---|---|---|---|
|
Acme |
Radius | 5 | $100 | $500 |
| Radius | 4 | $100 | $400 | |
| Spectra | 7 | $120 | $840 | |
| Spectra | 2 | $120 | $240 | |
| Compass | 10 | $60 | $600 | |
| Compass | 4 | $60 | $240 |
Rebate Program Rules
Acme is enrolled as a member in two active rebate programs.
- Rebate Program A: Offers revenue-based rebates. The program has 12 monthly payout periods.
- Rebate Program B: Offers volume-based rebates. The program has 12 monthly payout periods.
The program manager sets up the eligibility criteria for the rebate types in the rebate programs.
| Rebate Type | Eligibility Criteria |
|---|---|
| Revenue-Based | Include all transactions for Radius and Compass products. |
| Volume-Based | Include all transactions for Radius and Spectra products. |
The program manager sets up the benefit criteria for the rebate types in the rebate programs.
Rebate Program A has these benefit tiers:
- Tier X: Offers no rebate when the total transaction amount is less than $1500.
- Tier Y: Offers a 3% rebate when the total transaction amount exceeds $1501.
Rebate Program B has these benefit tiers:
- Tier 1: Offers no rebate when the total transaction quantity is less than 20 units.
- Tier 2: Offers a $2 rebate per unit when the total transaction quantity exceeds 21 units.
Data Processing Engine
If an account has an active membership in multiple rebate programs, each Transaction Journal record is evaluated separately against each program’s eligibility criteria to get the aggregate values. You need not create separate Transaction Journal records to tie the membership for each rebate program.
For example, the first sample transaction record for Radius qualifies for aggregation for Rebate Program A and B because the rebate-type eligibility criteria in both programs include Radius products. The definition sums up the transaction amount and quantity and updates the total values in the Rebate Member Product Aggregate object. For each payout period, two aggregate records are created for an account. Each aggregate record shows a rebate type’s aggregate values for a member.
Aggregate Data
These sample records are created in the Rebate Member Product Aggregate object for January.
| Record | Member | Payout Period | Rebate Type | Total Quantity | Total Transaction Amount |
|---|---|---|---|---|---|
| Record 1 | Acme in Rebate Program A | Jan FY21 | Revenue-Based | 23 | $1740 |
| Record 2 | Acme in Rebate Program B | Jan FY21 | Volume-Based | 18 | $1980 |
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 amounts in the Member Payout object.
Final Payouts
Acme receives these payouts based on the benefit tier they qualified for:
- For Rebate Program A, Acme receives a payout because the total transaction amount matches the criteria for Tier Y. The payout is $52.20 (3% of $1740).
- For Rebate Program B, Acme receives no payouts because the total quantity matches Tier 1.