Sometimes, you want to calculate a total (gross, lump sum) commission amount based on complex rules.
Do You Need A Global Reward Formula?
In most cases, it's sufficient to rely to use pre-canned rewards such as "% of Revenue", "% of Profit", or "Cash Reward". Those options do not require formulas.
However, you may want to calculate commission amounts using formulas. This can be achieved by defining either a/ a global reward or b/ a per-transaction reward. This article describes option a/ (global reward). Click here for the other option, and here to determine if you are using the right approach.
Creating a Global Reward Formula
First, review this article about formulas to understand how they work, and which constructs are available.
Next, create a global reward formula:
- Edit your plan
- Click on the "Incentives" tab (if needed)
- Click on the "+ Reward" button
- Select "Global Reward"
- Enter a global formula (examples below)
Your formula's output should be numeric.
For each triggered reward, we provide two virtual data set you can refer to in your reward formula:
A virtual set of transactions credited to target user / team triggering the reward
A virtual set of rewards previously assigned to the current beneficiary
This is powerful as you can perform complex calculations using:
- System-calculated values
- Any field of credited transactions
- Other rewards previously assigned to the beneficiary
If your query refers to "Transactions", your SQL-like statement will be evaluated against a virtual set of transactions credited to each target user / team for this calculation.
If your query refers to "Rewards", your SQL-like statement will be evaluated against a virtual set of all previous rewards assigned to the beneficiary.
Getting Help
If you are not familiar with SQL-like queries, we recommend reaching out to our support for assistance. Creating your own query is an advanced topic and you may need our assistance.
Global Reward Formula Examples
Here are some examples of formulas you could use to configure global rewards.
Assume that you uploaded transactions with the following fields:
- Quantity (a number field)
- City (a text field)
Pay A Fixed Amount Which Depends On The Payee
250 + [Beneficiary].[@@Bonus] * 0.5
Pay $45 Per Credited Transaction Whose Quantity Is Greater Than 25
SELECT 45 * COUNT(*) FROM Transactions WHERE ([Transaction].[Quantity (Imported)] >= 25)
Pay 10% of Revenue For Credited Transactions At The Current Attainment Level Only
SELECT 0.10 * SUM([Transaction].[calculated_revenue]) FROM Transactions WHERE ([Transaction].[attainment_threshold] = [Credited].[attained_threshold])
Pay 8% Of Profit For Credited Transactions Having Osaka As A City
SELECT 0.08 * SUM([Transaction].[calculated_profit]) FROM Transactions WHERE ([Transaction].[City (Imported)] = 'Osaka')
Pay A Fixed Amount Which Depends On Credited Transaction Cities
SELECT SUM(
CASE
WHEN [Transaction].[City (Imported)] = 'Paris' THEN 10.5
WHEN [Transaction].[City (Imported)] = 'London' THEN 9.5
WHEN [Transaction].[City (Imported)] = 'Berlin' THEN 8.5
ELSE 0.0
END)
FROM Transactions WHERE [Transaction].[City (Imported)] IS NOT NULL
Pay 2X Rewards From Other Released Calculations Within The Same Period
SELECT 2 * SUM([Reward].[value]) FROM Rewards WHERE [Reward].[in_period] = 1 AND [Reward].[released] = 1