Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 5345 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted

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) ]

Posted

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 )

Posted

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.

Posted

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".

Posted

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

Posted

Try =


( 

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

 - 

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

) / 60

This topic is 5345 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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