You are here:
amount_from
Returns a commission amount for a specific payout rule or the total commission amount from a previous statement period in Salesforce Spiff. A commission plan that pays year-to-date totals and subtracts previous earnings can use this function to reference and subtract commission amounts.
Required Editions
| Available in: both Salesforce Classic (not available in all orgs) and Lightning Experience |
| Available in: Enterprise, Unlimited, and Developer Editions |
| Available for an additional cost in: Professional Edition with Web Services API Enabled |
Syntax
amount_from(date, plan_name, payout_rule_name, user_id)Arguments
| Argument | Required? | Description |
|---|---|---|
| date | Required | The statement period to return an amount for. This argument supports any date functions, such as days_ago(), which returns the last day before the current statement period. |
| plan_name | Required | The name of the plan that includes the amount to return. Enclose the plan name in double quotes, or use the plan.name reference. |
| payout_rule_name | Optional | The name of a specific payout rule to return an amount for. Enclose the rule name in double quotes. If you omit this argument, the function returns the total commission amount. |
| user_id | Optional | The name of a specific user on the statement to return an amount for. This argument often requires a Users object data filter and a sumif() function. See the user ID example. |
Considerations
- This function can't reference the value of a calculated field.
- This function supports only previous statement periods, not the current statement period.
- This function doesn't account for adjustments. To include adjustments, create adjustment rules.
- This function returns the value from the most recently calculated statement. If you modify a calculation in Designer and change commission amounts, recalculate the statement.
- Calculate statements in chronological order. If this function rolls forward, start calculating from the first statement. Confirm that the statement is correct, and then continue to the next statement. If statement or rule amounts change in a previous period, those changes aren't rolled forward to future statements. Recalculate each subsequent statement in chronological order, even if statements were previously frozen.
Example
Return the total commission amount since the end of the previous statement period.
=amount_from(days_ago(statement_period.start_date), 1)Return the total commission amount for the Strategic Account Executive plan in the statement period.
=amount_from(days_ago(statement_period_date), 1), "Strategic Account Executive")Example with User ID
Return a specific rep's commission for a New Booking Commissions payout rule from the previous statement period.
First, create an All_Users data filter on the Users object that returns a list of all reps.
Id!=nullOn the Users object, create a datasheet field, AmountFromPriorMonth, that uses the amount_from() function to return the commission amount for every rep from the previous month. Specify id for the user_id argument.
=amount_from(days_ago(statement_period.start_date, 1), "Strategic Account Executive", "New Booking Commissions", id)Create a worksheet calculation that returns only the rep's previous commission on the rule. Use the sumif() function with the All_Users data filter you created, a rep's ID, and the AmountFromPriorMonth datasheet field. This function uses the commission amount for every rep from the previous month but returns only a specific user's data.
=sumif(All_Users, Id="18DigitUserId", AmountFromPriorMonth)
