How Can I Specify A Dynamic Crediting Formula (Advanced)

How Can I Specify A Dynamic Crediting Formula (Advanced)


Sometimes, you want to credit users or teams based on dynamic crediting rules.



Do You Need A Crediting Formula?
In most cases, it's sufficient to rely on aliases and system mapped transaction fields to credit users or teams.

The following crediting logic is used:
  • For individual-based plans, crediting defaults to transaction fields assigned to the "Owner / Sold By" category
    • User aliases are then used to map values found in those transaction fields to users  
  • For team-based plans, crediting defaults to transaction fields assigned to the "Team / Territory" category
    • Team aliases are then used to map values found in those transaction fields to teams

For some plans, you may want to specify which exact transaction fields should be used to credit users or teams. Simply configure a crediting override (on the "Targets" tab) like this:



However, there are situations where you may need to credit transactions to users or teams in a more flexible way. For example:
  • The rep to credit depends on the ordered quantity
  • The team to credit depends on the product name
  • Under some conditions, crediting splits are required
  • Etc. 

For those cases, you can use a dynamic crediting formula.

Creating a Dynamic Crediting Formula
First, review this article about formulas to understand how they work, and which constructs are available.

Next, create a dynamic crediting formula:
  • Edit your plan
  • Click on the "Targets" tab (if needed)
  • Scroll down to advanced options
  • Enter a dynamic crediting formula (examples below)

Your formula's output should be a text value, listing all users / teams to credit. You can use ; or || to separate entities (if multiple entities should be credited). Your returned text value can refer to any alias set on users / teams and they will be credited. 

We provide an initial crediting text value (based on default crediting rules), which is [Transaction].[calculated_text]:
  • For an individual-based plan, it is set to the value of the transaction field(s) mapped to the "Owner / Sold By" category 
  • For a team-based plan, it is set to the value of the transaction field(s) mapped to the "Team / Territory" category

Your formula can return this default value, or you can override it and return a different text value. In some cases, you may take the default value and append to it (ex: another user needs to be credited under certain conditions).

Dynamic Crediting Formula Examples
Assume that you uploaded transactions with the following fields:
  • Quantity (a number field)
  • Rep #1 (a text field mapped to the Other category)
  • Rep #2 (a text field mapped to the Other category)
  • Rep (a text field mapped to the Owner / Sold By category)
  • Team (a text field mapped to the Team / Territory category)

For an individual-based plan, the provided [Transaction].[calculated_text] will contain the value for the "Rep" field. For a team-based plan, the initial [Transaction].[calculated_text] will contain the value for the "Team" field. This is the default crediting behavior which your formulas can override.

Here are some examples of formulas you could use to configure dynamic crediting.

Credit Rep #1 Or Rep #2 Depending On The Quantity
var $rep1 = [Transaction].[Rep #1 (Imported)]
--------------------------------------------------------------------
var $rep2 = [Transaction].[Rep #2 (Imported)]
--------------------------------------------------------------------
var $quantity = [Transaction].[Quantity (Imported)]
--------------------------------------------------------------------
IFEX($quantity >= 1000, $rep1)
--------------------------------------------------------------------
IFEX($quantity >= 500, $rep2)
--------------------------------------------------------------------
[Transaction].[calculated_text]

Credit Team A If The City Is Osaka
var $city = [Transaction].[City (Imported)]
--------------------------------------------------------------------
IFEX($city = 'Osaka', 'Team A')
--------------------------------------------------------------------
[Transaction].[calculated_text]

Credit Both Rep #1 And Rep #2 If Both Are Set
var $rep1 = [Transaction].[Rep #1 (Imported)]
-------------------------------------------------------------------- 
var $rep2 = [Transaction].[Rep #2 (Imported)]
--------------------------------------------------------------------
IFEX(LEN($rep1) > 0 AND LEN($rep2) > 0, $rep1 + '||' + $rep2)
--------------------------------------------------------------------
[Transaction].[calculated_text]

Formula-Based Crediting Splits
Most of the time, you would use one of those built-in options to apply crediting splits:



For example, if you choose the option to split credits equally, and two users are credited, each will get 50% of the transaction's value. For more complex scenarios, a crediting formula allows you to specify weights.

For example, if your formula returns "user1[0.4];user2[0.6]":
  • User1 will be credited with 40% of the transaction's value
  • User2 will be credited with 60% of the transaction's value

This mechanism allows you to dynamically control splits using a formula. You still need to select an option (see dropdown above) to allow multiple crediting. Your formula overrides the behavior provided by the dropdown.

    • Related Articles

    • How Can I Specify A Dynamic Transaction Filtering Formula (Advanced)

      Sometimes, you want to filter transactions based on dynamic rules. Do You Need A Filtering Formula? In most cases, it's sufficient to rely on saved queries to filter transactions. For example, you could define a transaction filter such as this: And ...
    • How Can I Specify a Dynamic Quota Formula (Advanced)?

      Sometimes, you need quotas to be calculated dynamically using a quota formula. Do You Need A Quota Formula? In most cases, it's sufficient to use available quota options (such as "As Percentages of a Per-Target Dynamic Quota" or "As Percentages of a ...
    • How Can I Specify a Scoring Formula (Advanced)?

      Sometimes, you want each transaction's value to be calculated using dynamic rules. Do You Need A Scoring Formula? In most cases, calculating a transaction's value based on its revenue or profit is sufficient. When using revenue or profit as an ...
    • How Can I Specify a Custom Formula (Advanced)?

      Sometimes, you want to customize attainment and require a formula to do so. Do You Need A Custom Formula? In most cases, calculating a transaction's value based on its revenue or profit is sufficient. When using revenue or profit as an attainment ...
    • How Can I Credit Multi-Dimensional Hierarchies (Advanced)?

      This article applies if you've configured teams to represent a single hierarchy, but ran into issues because you want to use different hierarchies to credit users or teams depending on the plan or scenario. Let's say that you have configured a single ...