PatternCountValues ( haystack ; needles )
Does a pattern count for multiple values at once, counting the number of times values in the second value list appear in the first value list.
Be the first to rate this function Log in to vote
Richard Dyce - Show more from this author
Dyce & Sons LTD.
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
There is one gotcha with this function. For backwards compatibility, I haven't included a UniqueValues ( ) check on the needles value list - which means that duplicate values in needles leads to double counting, i.e. PatternCountValues ( "123¶234¶235" ; "123¶123¶234" ) will give the answer 3. For 16 & 17 users, use:
// PatternCountValues ( haystack ; needles )
searchterms = ValueCount ( needles );
needles = UniqueValues ( needles ) // prevents double counting
haystack = "" ; 0 ;
searchterms = 0 ; 0 ;
searchterms = 1 ; PatternCount( haystack ; needles ) ;
"patterncount( " &
Quote ( haystack ) & "; \"" &
"\" ) + patterncount( " & Quote ( haystack ) & " ; \""
Fabrice Nordmann, 1-more-thing
Jan 27, 2019
ValueCount ( Filtervalues ( listA ; listB ))
Richard Dyce, Dyce & Sons LTD.
Jan 28, 2019
|Much better ;-)|
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.