Loading
Sales Performance Management
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Salesforce Spiff Function Reference

          Salesforce Spiff Function Reference

          Each function in Salesforce Spiff requires specific syntax and arguments.

          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
          • all?
            Checks whether every record in a data filter or datasheet in Salesforce Spiff satisfies one or more conditions. This function returns true when the condition is satisfied. This function is the opposite of the any? function.
          • 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.
          • 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.
          • beginning_of_day
            Returns the first second for a specific date or time value in Salesforce Spiff. The return format is YYYY-MM-DDT:hour:minute:second:millsecond, plus or minus the hours and minutes away from Coordinated Universal Time (UTC).
          • beginning_of_fiscal_quarter
            Returns the first day of the fiscal quarter for a specific date or time in Salesforce Spiff. The return format is YYYY-MM-DD. If you haven't specified fiscal year dates in Spiff, this function falls back to a standard calendar year.
          • beginning_of_fiscal_year
            Returns the first day of the fiscal year for a specific date or time in Salesforce Spiff. The return format is YYYY-MM-DD. If you haven't specified fiscal year dates in Spiff, this function falls back to a standard calendar year.
          • beginning_of_month
            Returns the first day of the month for a specific date or time value in Salesforce Spiff. The return format is YYYY-MM-DD.
          • beginning_of_period
            Returns the first day of the statement period for a specific date or time value in Salesforce Spiff. The return format is YYYY-MM-DD.
          • beginning_of_quarter
            Returns the first day of the quarter for a specific date or time value in Salesforce Spiff. The return format is YYYY-MM-DD. If you've specified fiscal year dates that are different from standard calendar dates, use the beginning_of_fiscal_quarter() function instead.
          • beginning_of_year
            Returns the first day of the year for a specific date or time value in Salesforce Spiff. The return format is YYYY-MM-DD. If you've specified fiscal year dates that are different from standard calendar dates, use the beginning_of_fiscal_year() function instead.
          • end_of_day
            Returns the last second for a specific date or time value in Salesforce Spiff. The return format is YYYY-MM-DDT:hour:minute:second:millsecond, plus or minus the hours and minutes away from Coordinated Universal Time (UTC).
          • end_of_fiscal_quarter
            Returns the last day of the fiscal quarter for a specific date or time in Salesforce Spiff. The return format is YYYY-MM-DD. If you haven't specified fiscal year dates in Spiff, this function falls back to a standard calendar year.
          • end_of_fiscal_year
            Returns the last day of the fiscal year for a specific date or time in Salesforce Spiff. The return format is YYYY-MM-DD. If you haven't specified fiscal year dates in Spiff, this function falls back to a standard calendar year.
          • end_of_month
            Returns the last day of the month for a specific date or time value in Salesforce Spiff. The return format is YYYY-MM-DD.
          • end_of_period
            Returns the last day of the statement period for a specific date or time value in Salesforce Spiff. The return format is YYYY-MM-DD.
          • end_of_quarter
            Returns the last day of the quarter for a specific date or time value in Salesforce Spiff. The return format is YYYY-MM-DD. If you've specified fiscal year dates that are different from standard calendar dates, use the end_of_fiscal_quarter() function instead.
          • end_of_year
            Returns the last day of the year for a specific date or time value in Salesforce Spiff. The return format is YYYY-MM-DD. If you've specified fiscal year dates that are different from standard calendar dates, use the end_of_fiscal_year() function instead.
          • choose
            Returns a value from a list based on a specified index in Salesforce Spiff. List values in Spiff aren't sorted by any default order. To make sure that you select the appropriate value, combine this function with sort() so that you sort the list values before you select a specific index.
          • contains
            Checks whether a string or list includes a specified value in Salesforce Spiff. This function returns true or false.
          • count
            Returns the total number of items in a list or data filter in Salesforce Spiff.
          • currency
            Converts a number of string into a specified currency in Salesforce Spiff.
          • date
            Converts a string into a Date data type in Salesforce Spiff. This function finds the date value for a field that isn't specifically a Date data type so that Spiff can use the date value in calculations and other functions related to dates.
          • date_between?
            Checks whether a date falls within an upper and lower date range in Salesforce Spiff. When used in a calculated field, this function returns true or false.
          • datevalue
            Converts a string or object that represents a date or time value into an integer in Salesforce Spiff. The integer represents the elapsed days since December 30, 1899. This function helps you compare date values more easily.
          • day
            Returns the number of the calendar day for a specified date or time in Salesforce Spiff.
          • days_ago
            Returns the date that's a specified number of days before another date in Salesforce Spiff.
          • days_to
            Returns the number of days between two dates or times in Salesforce Spiff.
          • error
            Returns a custom message for a statement calculation error in Salesforce Spiff. This function stops statement calculations and helps you alert admins that information is missing or preventing the calculation from executing.
          • exp
            Returns the value of the mathematical constant e, the base of the natural logarithm, raised to the power of a specified number for use in Salesforce Spiff. The value of e is approximately 2.72.
          • filter
            Further filters records in a Salesforce Spiff data filter, list, or relationship and returns a list of records that match a specified condition. This function helps refine an existing data filter.
          • first
            Returns the first item in a sorted list in Salesforce Spiff.
          • if
            Tests for a condition in Salesforce Spiff and returns different values depending on the outcome.
          • iferror
            Checks whether an expression results in an error or null value in Salesforce Spiff and either returns the result of the expression or returns a default value for error handling. This function provides an alternative nested if() statements, but this function can also disguise real errors and result in inaccurate calculations if not used carefully.
          • ifnull
            Replaces a null value in a field with a specified value in Salesforce Spiff.
          • ifs
            Returns the first true result from a series of logical tests in Salesforce Spiff. This function is similar to multiple if() functions. You can include multiple conditions and return different values based on the result of each condition.
          • last
            Returns the last item in a sorted list in Salesforce Spiff.
          • ln
            Returns the natural logarithm of a specified number in Salesforce Spiff. The natural logarithm is based on the mathematical constant e, the value of which is approximately 2.72.
          • mamount
            Returns the commission total for a deal in Salesforce Spiff, based on a range table and the rep's current attainment. To return a commission rate instead, use the mpercent() function.
          • managers
            Returns a list of user objects for managers of one or more teams in Salesforce Spiff, based on a specific date range and levels of team hierarchy. To return team members and managers, use the members() function.
          • members
            Returns a list of user objects for users who belong to one or more teams in Salesforce Spiff, based on a specific date range and levels of team hierarchy. Optionally return both managers and team members or team members only. To return managers only, use the managers() function.
          • month
            Returns the number of the calendar month for a specified date or time in Salesforce Spiff.
          • monthname
            Returns the full or abbreviated name of the calendar month for a specified date or time in Salesforce Spiff.
          • months_ago
            Returns the date that's a specified number of months before another date in Salesforce Spiff.
          • months_to
            Returns the number of months between two dates or times in Salesforce Spiff. If the return value is a negative number, the second date occurred before the first date.
          • mpercent
            Returns the commission rate for a deal in Salesforce Spiff, based on a range table and the rep's current attainment. To return a commission total amount instead, use the mamount() function.
          • name
            Returns the name of a logic reference such as a calculation, data filter, or API name in Salesforce Spiff. The returned name can be different from the item's corresponding display name.
          • networkdays
            Returns the number of work days between an upper and lower date or time in Salesforce Spiff, excluding weekends and holidays.
          • numbervalue
            Converts a text string or currency value into an integer or decimal in Salesforce Spiff.
          • periods_ago
            Returns the statement period start date that's a specified number of statement periods before another date in Salesforce Spiff.
          • quota
            Returns a quota value from a quota table in Salesforce Spiff. To sum values across multiple reps for a specific quota, use the quotas() function instead.
          • quotas
            Returns a list of quota values from a quota table in Salesforce Spiff. The quota values are for a specific user in a specific time period.
          • range_lookup
            Returns a value from within an upper and lower range of values in Salesforce Spiff, based on a range table. This function returns the specified column expression for that value.
          • rank
            Compares a list of filtered numbers that represent rep metrics in Salesforce Spiff, such as monthly attainment, and returns a ranking relative to the rest of the list. This function doesn't break ties and awards the same ranking to all numbers that tie.
          • single
            Returns the first and only record of a list in Salesforce Spiff. This function validates that only one record is returned and converts the list of records into an individual record.
          • sort
            Organizes records in a Salesforce Spiff data filter by a date, string value, or number value and returns a list of sorted records.
          • sum
            Calculates a total value from a list of numbers in Salesforce Spiff. This function works well with records in a data filter.
          • sumif
            Calculates a total value from a list of numbers in Salesforce Spiff, but only for records that satisfy a specified condition.
          • switch
            Compares an input value against a list and returns a corresponding value or error message in Salesforce Spiff. This function is similar to the vlookup() function except the lookup tables are specified within the function rather than in a lookup table.
          • team
            Returns a Team object in Salesforce Spiff and includes all fields such as the team name, leads, and effective dates. Use this function with other functions that require a reference to a Team object.
          • tier_payout
            Returns a payout amount from within an upper and lower range of values in Salesforce Spiff, based on a range table. This function returns the specified column expression for that value.
          • transform_list
            Applies an expression to each record in a data filter in Salesforce Spiff and returns a new list with the results. For example, identify a specific field from a list of records and return a list of the values for only that field from those records.
          • users_in_team
            Returns a list of user IDs from a team in Salesforce Spiff. Combine other functions to count the number of reps on a team or sum team member quotas. For a rollup of team members, use a Guided Rollup instead.
          • vlookup
            References a value from a lookup table in Salesforce Spiff and returns the specified column expression for that value.
           
          Loading
          Salesforce Help | Article