Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Does a reverse of "Last" function exist?

Featured Replies

Is there something like an opposite version of the "Last" function that will find the FIRST non-empty record?

I am trying to calculate the time between my first record (with an associated timestamp) and my last record (with an associated timestamp.

None required. Any time you get a related field you are always getting the first value - as defined by the sort order of the relationship.

Set variable [ $first; LineItems::ProductID]

Set variable [ $last; Last(LineItems::ProductID) ]

A reference to a related field returns the value from the first related RECORD - not necessarily the first VALUE: if the field happens to be empty in the first record, the reference will return empty too.

The exact opposite of the Last() function, i.e. one that returns the first non-empty value, would be =

GetValue ( List ( Related::Field ) ; 1 )

Well, I do think it is important for the OP to understand the details of how this works, and consider whether he want the first non-empty value (which could the 13th value) ; or the true first value - empty. If in fact that is the result of the data contents and relation sort order.

Yes, I believe a simple reference may suffice in this case, as it doesn't seem likely that the value will be ever empty. I only added the clarification because the OP specifically asked for value from "the FIRST non-empty record".

  • Author

Yes, I am looking for the first non-empty value, as defined by the sort order.

  • Author

Hmm, the "GetValue..." solution isn't working.

I currently have the calc below, but it isn't giving me a real number for everything because it is finding the first value, and not the first NON-EMPTY value. And for some, the first value is empty.

(Last (Behavior to Follow by Date ID#:Timestamp_Begin)

 - 

( Behavior to Follow by Date ID#::Timestamp_Begin ))/60


When I change it to incorporate comment's solution I get unusable values for all records.  My adjusted calc that doesn't seem to work at all looks like this:




(Last(Behavior to Follow by Date ID#::Timestamp_Begin)

 - 

GetValue(List(Behavior to Follow by Date ID#::Timestamp_Begin) ; 1))/60

Try =


( 

Last ( Behavior to Follow by Date ID#:Timestamp_Begin )

 - 

GetAsTimestamp ( GetValue ( List ( Behavior to Follow by Date ID#::Timestamp_Begin ) ; 1 ) )

) / 60

  • Author

Once again, you have solved my problem. It worked like a charm. Thanks!

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.