Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6098 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I'm having a challenge figuring out how to identify and remove a single value from a list of values within a single non-repeating text field.

The value to be removed always starts with "V" while the values that will stay do not start with "V".

For example:

123-12345

123-23456

123-345456

[color:red]V123-removeThisValue (not just the V)

123-234567

Thanks for any help.

Posted (edited)

Do you need to do this with a calc? Cant you script it? If not you can use a Recursive Custom Fuuction. Something like:

RemoveV ( field )


Let ( j = ValueCount ( Field );

      Case ( j > 0;

             Case ( Left ( GetValue ( Field ; 1 ); 1 )  ≠ "V"; GetValue ( Field ; 1 ) &  ¶ ) &  

                    RemoveV ( RightValues ( Field ; j - 1 ) )

           )

     )

Edited by Guest
Added CF
Posted

Or a non recursive one ;)

http://www.briandunning.com/cf/747

Posted

Try:

FilterValues ( listOfValues ; Substitute ( ¶ & listOfValues ; "¶V" ; ¶ ) )

Note that this is case-sensitive, so it will remove all values starting with "V", but not values starting with "v" (this can be fixed easily by a slight modification, if so desired).

As it happens, the credit for this idea also goes, at least partially, to Agnès Barouh - adapted from:

http://www.fmforums.com/forum/showpost.php?post/273449/

Posted

Thanks Comment (and others) - Fast and simple.

I guess I've never looked at FilterValues. It's time to review some functions.

This topic is 6098 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.