hopkins

"Any" and "All" Custom Functions

Discussion created by hopkins on Feb 9, 2012
Latest reply on Feb 10, 2012 by hopkins

I use FileMaker Pro Advanced 9 and do not know if counterpart functions have been implemented in 10 or 11, but here are two custom functions I find useful:

 

"Any" looks at related data and is true if any one or more meet criteria (soughtValue).

 

If ( rFieldCount > 1 ;

If ( GetNthRecord ( relatedField ; rFieldCount ) = soughtValue ;

1 ;

Any ( relatedField ; rFieldCount - 1 ; soughtValue ) ) ;

If ( GetNthRecord ( relatedField ; rFieldCount ) = soughtValue ;

1 ;

0 ) )

 

"Any" looks at related data and is true only if all meet criteria (soughtValue).

 

If ( rFieldCount > 1 ;

If ( GetNthRecord ( relatedField ; rFieldCount ) ≠ soughtValue ;

0 ;

All ( relatedField ; rFieldCount - 1 ; soughtValue ) ) ;

If ( GetNthRecord ( relatedField ; rFieldCount ) ≠ soughtValue ;

0 ;

1 ) )

 

I also have a "None" custom function but it is rather redundant as "not Any" does the same job.

 

Here is an example file.

 

Any who also find these useful, enjoy,

Ted.

Attachments

Outcomes