FMDuck Posted May 12, 2008 Posted May 12, 2008 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.
mr_vodka Posted May 12, 2008 Posted May 12, 2008 (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 May 12, 2008 by Guest Added CF
fabriceN Posted May 12, 2008 Posted May 12, 2008 Or a non recursive one http://www.briandunning.com/cf/747
comment Posted May 12, 2008 Posted May 12, 2008 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/
FMDuck Posted May 13, 2008 Author Posted May 13, 2008 Thanks Comment (and others) - Fast and simple. I guess I've never looked at FilterValues. It's time to review some functions.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now