Brian Dunning's FileMaker Custom Functions

sumreps ( rfield ; from ; to )

Sums repeating field rep values from rep `from` to `to`

  Average rating: 4.6 (25 votes) Log in to vote

Oliver Reid   Oliver Reid
FGM, LLC
http://firstgm.com

Share on Facebook Share on Twitter

  Sample input:
sumreps(field;4;6)


where field is (1,2,3,4,5,6)
  Sample output:
15

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

Handy function to sum a subset of repeating field reps

 

Comments

Matthew Fero   Matthew Fero, Seattle
Dec 31, 2012
This is exactly what I was looking for. However, the function seemed to be broken until I changed 'rfield' to 'GetFieldName ( rfield )' ... as follows:

Let ( [
nn = If ( to ≠ ""; to - from + 1 ; 200) ;
xx = Evaluate( "MiddleValues (List (" & GetFieldName ( rfield ) & ");" & from & ";" & nn &")" );
lln = Length (xx) - 1 ;
uu = Left (xx ; lln)
] ;
Evaluate( Substitute(uu ;¶;"+")) )
 
Oliver   Oliver, Stamford Ct
Dec 31, 2012
rfield should be inserted in quotes actually: I have added a note to clarify that.
 
Martin   Martin, Switzerland
May 20, 2013
Does not work if some of the repetitions are empty
 
Oliver   Oliver, CT
May 20, 2013
That's true Martin. I will fix when I figure that out.
One could use as an argument that is the Max of the intended rep field and another that contains only 0's
 
Jim   Jim, NY
Oct 19, 2014
Dosent work at all!
 

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.

Under construction. Email me your wish list for improvements.