Brian Dunning's FileMaker Custom Functions

GetFieldStat ( Function ; Field )

Do stats from values in a field or a value list

  Average rating: 4.2 (32 votes) Log in to vote

Ugo DI LUCA   Ugo DI LUCA
DLSYSTEMS
http://www.dlsystems.fr

Share on Facebook Share on Twitter

  Sample input:
GetField ( "Max" , 2¶12¶10 )
  Sample output:
12

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Change the function to Min, Average, Sum or whatever the aggregate function needed.
You may work with a list of values with other separators than the "¶", just change this separator to match yours

 

Comments

Howard   Howard, Los Angeles
Dec 20, 2012
It's a small thing, but I added a case() statement to mine, to check if there's only one value (in which case any of the aggregate functions will fail).

Here's what mine looks like (sorry, I also changed the function and parameter names to better suit my needs...but you get the idea):

// AggregateValues ( Function; Values )

Case(
ValueCount(Values) <= 1; GetValue(values; 1);

Evaluate ( Function & " ( " & Substitute ( Values ; "¶";";" ) & " )" )

)
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: