Brian Dunning's FileMaker Custom Functions

OmitValues ( values ; omitList )

Returns "values" not in "omitList"

  Average rating: 4.0 (34 votes) Log in to vote

Geoff Graham   Geoff Graham
Renewlife
http://renewlife.com

Share on Facebook Share on Twitter

  Sample input:
OmitValues ( 2 "¶" 3 "¶"4 "¶" 5 "¶";3 "¶" 5 "¶")
  Sample output:
2 "¶" 4 "¶"

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

Opposite of the built-in "FilterValues" function. Will return values from the left-hand parameter, "values", that are not in the right-hand parameter, "omitList". Both parameters are value lists.

Scrambled output caused by empty values in omitlist has been fixed.

 

Comments

Tim Owen   Tim Owen, Sedona, AZ
Aug 2, 2015
I have noted that the last value of the values parameter will not be evaluated correctly without a trailing paragraph return (¶), if that value is within the omitList. Following is a suggested revision, which adds the paragraph return character (¶) to the values parameter result via a var=expression parameter in the Let function:

Let ( [ values = values & "¶" ; x = RightValues ( omitList ; 1 ) ] ;

If ( x = "¶" ; OmitValues ( values ; LeftValues ( omitList ; ValueCount ( omitList ) -1 ) ) ;

If ( ValueCount ( omitList ) > 1 ;

OmitValues ( Substitute ( values ; x ; "" ) ; LeftValues ( omitList ; ValueCount ( omitList ) -1 ) ) ;

Substitute ( values ; x ; "" )

) ) )

Tim Owen
Tim Owen Consulting, LLC.
tim@timowenconsulting.com
 

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 15 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:

Under construction. Email me your wish list for improvements.