Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
Training
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages
Videos
Adventures
Links

Shopping Cart
Shopping Cart

Search:

Free Newsletter
Signup


Contact


Privacy Policy



FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.

 

 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

RemoveValue ( Value ; ValueList )

Rate this function:  

RatingRatingRatingRatingRating
  Average rating: 3.8  (46 votes)
  Discuss this Custom Function

Caleb Ruth, Data Performance LLC
http://www.dataperformancellc.com

A recursive function that removes all matching values from the supplied list

Sample Input:
RemoveValue ( "rabbit" ; "mouse¶jackrabbit¶rabbit¶lynx" )
Sample Output:
mouse
jackrabbit
lynx


 Then copy & paste into FileMaker Advanced's Edit Custom Function window.

Click here to copy To Clip Manager if you have myFMbutler's Clip Manager installed

Description:

This function removes all matching values from a list. Unlike other functions it does not require any padding nor adds nor removes any extra paragraph chars to the resulting list (save one at the end). Recursion limits apply to the size of the list.

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it

Discuss:

5 most recent comments | Show all 11 comments

yes !! but how do you remove values such as 2-5 or 1-7 or 5-10 ?

rob 'jesus Land Tidd' lewis, wawaka Indiana USA
February 07, 2013 3:30am

How about just:

Let (
a = Substitute ( valueList & ¶ ; theValue & ¶ ; "" ) ;
Left ( a ; Length ( a - 1 ) )
)

Jack James, London
April 22, 2013 2:33am

Sorry put a bracket in the wrong place, should be:

Let (
a = Substitute ( valueList & ¶ ; theValue & ¶ ; "" ) ;
Left ( a ; Length ( a ) - 1 )
)

Jack James, London
April 22, 2013 3:35am

custom function: RemoveValue
parameters: values, value

Let(
text = Substitute ( ¶ & values & ¶ ; ¶ & value & ¶ ; ¶ );
Middle ( text ; 2 ; Length( text )-2 )
)

Mattias Thorslund, Sweden
September 08, 2016 7:30am

I didn't see the hidden comments on this page with additional suggestions until after I wrote up this variant.

This one is ExclueValue*s* because you can specify multiple items to be excluded. I needed this in order to compare two checklist sets against each other to find which one had been added/removed. It also has checks the parameters for trailing line breaks.

- RG>

// Custom function: ExcludeValues ( ValueList ; ValuesToExclude )
// 2016-11-07 - RG>
// Based on discussions at https://www.briandunning.com/filemaker-custom-functions/detail.php?fn_id=11 75&comments=all
// e.g. ExcludeValues ( "a¶b¶c¶c¶d" ; "a¶c" ) will return "b¶d"

Let (
[
ValuesToExclude = ValuesToExclude & If ( Right ( ValuesToExclude ; 1 ) = ¶ ; "" ; ¶ ) ;
ValueListPlusBreak = ValueList & If ( Right ( ValueList ; 1 ) = ¶ ; "" ; ¶ ) ;
FirstValue = Left ( ValuesToExclude ; Position ( ValuesToExclude ; ¶ ; 1 ; 1 ) ) ;
RemainingValuesPlusBreak = Right ( ValuesToExclude ; Length ( ValuesToExclude ) - Length ( FirstValue ) ) ;
RemainingValues = Left ( RemainingValuesPlusBreak ; Length ( RemainingValuesPlusBreak ) - If ( Right ( RemainingValuesPlusBreak ; 1 ) = ¶ ; 1 ; 0 ) ) ;
FilterOutFirstValue = Substitute ( ValueListPlusBreak ; FirstValue ; "" ) ;
Result = Left ( FilterOutFirstValue ; Length ( FilterOutFirstValue ) - If ( Right ( FilterOutFirstValue ; 1 ) = ¶ ; 1 ; 0 ) )
]
;

If ( Length (RemainingValues ) = 0 ; Result ; ExcludeValues ( Result ; RemainingValues ) )

) //let

RealGrouchy, Ottawa
November 07, 2016 11:23am

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
City/Location:
Comment:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 3 + 3 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. ProperAllWords ( text )
  (Thu, Dec 14, 5:19pm)
2. MatchExist ( SourceTable.Field ; DestTable.Field ; ReturnField )
  (Thu, Dec 14, 1:07pm)
3. BVR_Format ( bvr )
  (Wed, Dec 13, 5:32pm)
4. NumberToHexadecimal(NumberValue)
  (Fri, Dec 08, 8:54am)
5. Get_BaseTable
  (Thu, Dec 07, 4:27pm)
6. JSONCreateVarsFromKeys ( json ; namespace )
  (Wed, Dec 06, 8:21pm)
7. GetTableNzme ( field )
  (Tue, Dec 05, 9:16pm)
8. TimeFormatAsText ( theTime )
  (Mon, Nov 13, 1:59pm)

RSS Feed of Custom Functions