May 12, 200817 yr 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.
May 12, 200817 yr 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 May 12, 200817 yr by Guest Added CF
May 12, 200817 yr 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/
May 13, 200817 yr Author Thanks Comment (and others) - Fast and simple. I guess I've never looked at FilterValues. It's time to review some functions.
Create an account or sign in to comment