amounts_from

Returns a sum of commission amounts for specific payout rules or total commission amounts from previous statement periods in Salesforce Spiff. This function is similar to amount_from() but requires a date range instead of a specific date.

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

amounts_from(start_date, end_date, plan_name, payout_rule_name, user_id)

Arguments

Argument Required? Description
start_date Required The beginning of the date range to calculate amounts for. This argument supports any date functions.
end_date Required The end of the date range to calculate amounts 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 amounts 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 amounts for. Enclose the rule name in double quotes. If you omit this argument, the function returns the total commission amounts.
user_id Optional The name of a specific user on the statement to return amounts for.

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 amounts from the most recently calculated statements. If you modify a calculation in Designer and change commission amounts, recalculate all affected statements in chronological order.
  • Calculate statements in chronological order.
  • To make sure that previous amounts don't change, freeze previous statements in chronological order as they're finalized and approved. 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.
  • To calculate quarter-to-date or year-to-date amounts, it's more efficient to add multiple statement amounts than to recalculate previous commission amounts.
  • If a statement is missing, Spiff assigns a $0 commission amount by default. If a rep is paid in a currency other than USD, avoid mismatch errors by saving separate calculations for each period, converting amounts to the rep's currency, and summing the amounts.

Example

Return the amounts from the beginning of the year in the rep's preferred currency.

=currency(amounts_from(BeginningOfYear, PreviousPeriod, PlanName), RepPreferredCurrency)

See Also