depends on the way auhors are stored. Typically, there's a separate table for them
If there is a way to get a FileMaker-list (list function) of authors (list(authors::names)) You can get the count by valuecount(list..)
if they are stored in one single field without a new-line between two of them, it's difficult since they can hav names like Tom Test, John Paul Doe, etc.)
if there is a new-line (the 'pi' character...) between 2 names in one field, You can get a list of them via substitute (YourTextField;"pi";";") - replace the new-line by a ";"
if You have a repeating field for them, the 'list' function works as well
My Colleague (and father) GordonCox just answered this in the fmpexperts mailing list.
Here was his response:Tas,
Let ( [
toList = Substitute ( testTable::author ; ".," ; ". ,¶" ) ;
countAuthors = valuecount ( toList )
Substitute ( LeftValues ( toList ; countAuthors - 1 ) ; ". ,¶" ; ",." ) & " & " & GetValue ( toList ; countAuthors )
Grothe, B. , et al.
If you current field has authors in a carriage-return separated list like this:
… then you can parse the list using a Let ( ) calc along the following lines:
theList = "Grothe, B.¶Jacobs, G.¶Padgett, K.¶Aaronson, N.K.¶Jacobs, G."
; count = ValueCount ( theList )
; long = count > 6
; authsShort = Substitute ( theList ; "¶" ; ", " )
; last = " & "
; etAl = " et al"
; authsLong = GetValue ( theList ; 1 ) & etAl
; result = If ( long ; authsLong ; authsShort )
result // in this example: "Grothe, B., Jacobs, G., Padgett, K., Aaronson, N.K., Jacobs, G."
1. if you had authors listed in a separate table (which is what I would do) you can generate the list from there and use it in the first parameter.
2. You would need to work out a way to put " & " before the final entry in the short list instead of ", ". I don't have time right now.
Here's the answer I posted to the FMXperts list. FYI it's appreciated if you label such posts as "[xpost]" so people don't waste time posting duplicate answers.
PatternCount( authors ; ".," ) > 5 ;
Left( authors ; Position( authors ; ".," ; 1 ; 1 ) + 1 ) & " et al." ;
or perhaps neater:
PatternCount( authors ; ".," ) < 6 ; authors ;
Left( authors ; Position( authors ; ".," ; 1 ; 1 ) + 1 ) & " et al."