Loading
Feature degradation | Gmail Email delivery failureRead More
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
          Returning the First or Last Date from a Data Filter in Salesforce Spiff

          Returning the First or Last Date from a Data Filter in Salesforce Spiff

          Returning the first or last date in a period is helpful when filtering data in Salesforce Spiff. For example, maybe you want to know the date of the first deal closed in a period or the last deal in the quarter.

          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

          Consider a datasheet that uses the ClosedInPeriod data filter, which returns all closed deals for a specific rep in a specific time period.

          Datasheet with a ClosedInPeriod data filter

          To return the date of the first deal in the period, add a formula.

          =choose(1, transform_list(sort(ClosedInPeriod, CloseDate), CloseDate))
          • The sort() function sorts datasheet rows by CloseDate in ascending order.
          • The transform_list() function transforms the sorted rows into an array of CloseDate values.
          • The choose() function selects the first item in the array.

          To return the date of the last deal in the period instead, sort datasheet rows by CloseDate in descending order by adding -1 as an optional third argument for the sort() function.

          =choose(1, transform_list(sort(ClosedInPeriod, CloseDate), CloseDate, -1))
           
          Loading
          Salesforce Help | Article