Brian Dunning's FileMaker Custom Functions

CountValuesUnderAReference_CFpub ( ValuesListOf ; ReferenceValue ; NumValues )

Returns number of values under ReferenceValue

  Average rating: 4.3 (29 votes) Log in to vote

Rafael Caballé   Rafael Caballé
adventoplus
http://www.adventoplus.com

Share on Facebook Share on Twitter

  Sample input:
CountValuesUnderAReference_CFpub ( 1¶3¶1¶5¶2­¶ ; 2 ; 0)
  Sample output:
2

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

From a list of numbers (as text) returns the number of them under a reference value

 

Comments

eos   eos, Teg
Feb 5, 2015
Try

// CountOfValuesSmallerThanThreshold ( listOfValues ; thresholdValue )

Let ( [
~check = GetValue ( listOfValues ; 1 ) ;
~found = Case ( IsEmpty ( ~check ) ; 0 ; ~check < thresholdValue ) ;
~rest = RightValues ( listOfValues ; ValueCount ( listOfValues ) - 1 )
] ;
$count + ~found +
Case (
not IsEmpty ( ~rest ) ;
CountOfValuesSmallerThanThreshold ( ~rest ; thresholdValue ) ;
Let ( [ a = $count ; $count = "" ] ; a )
)
)
 
eos   eos, Teg
Feb 5, 2015
…no line indentation in reply box :-(
 

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.