jfortes Posted September 9, 2009 Posted September 9, 2009 Hi, I'm trying to remove a list of items from a given value list. I tried using some custom functions like AddRemove etc but they only accept single values to remove. Can anyone help me to make a function to produce this? listOfValues = "GSX¶TZR¶CBR¶YZF¶FZR¶CBF" listToRemove ="TZR¶FZR" RemoveListFromList(listOfValues;listToRemove)= "GSX¶CBR¶YZF¶CBF"
bcooney Posted September 9, 2009 Posted September 9, 2009 How is the value list defined? From a field?
jfortes Posted September 9, 2009 Author Posted September 9, 2009 No, it is defined with personal values so I cannot do it through relationships. It's result will go in a calculation field that I need indexed as it will form part of another relationship. Thanks for your interest!!
bcooney Posted September 9, 2009 Posted September 9, 2009 OK. You have a value list that contains "Red Green Black Orange and you wish to remove Orange. Some records have Orange stored in the "color" field. Why can't you just delete Orange from the value list definition. It will not be a choice anymore, but it won't disappear in records that have used it. What am is missing?
comment Posted September 9, 2009 Posted September 9, 2009 See if this helps: http://fmforums.com/forum/showtopic.php?tid/187248/
jfortes Posted September 9, 2009 Author Posted September 9, 2009 I am doing it like you say at the moment, but it would be goog to have a function like the one I am trying to find and do things like this without loops in a script. :
bcooney Posted September 9, 2009 Posted September 9, 2009 Loops? We're not on the same page at all. Are you looking to remove data from records?
NovaChan Posted September 9, 2009 Posted September 9, 2009 It looks like the thread comment mentioned has several functions and a couple demo files. There's another function I didn't see there that I've used. It's from Agnes and is non-recursive: http://fmfunctions.com/functions_display_record.php?functionId=150
bcooney Posted September 9, 2009 Posted September 9, 2009 None of which, to me, has anything to do with value lists. Lists of values <> Value Lists.
NovaChan Posted September 9, 2009 Posted September 9, 2009 (edited) Our goal, as I understand it, is to get a list into an indexed calculation field based on a revised version of a hand-entered value list. The aforementioned calculations can be used in the calculation field to filter the unwanted value from the value list. Here's an example of the field definition using Agnes' function: Let([ lisRemove = "ValueA¶ValueB¶ValueC" ; lisOrig = ValueListItems ( Get( FileName ) ; "ValueListName" ) ; lisFiltered = FilterList ( lisOrig ; "Equals" ; lisRemove ; False ) ]; lisFiltered ) Edited September 9, 2009 by Guest Further edited by LaRetta to keep it civil
NovaChan Posted September 9, 2009 Posted September 9, 2009 I appreciate you attempting to keep the forums civil LaRetta. I removed the unnecessary remark about bcooney appearing "confused". I believe the rest, however, is between me and bcooney. I am sure she can speak for herself. The reason I took offense at her previous comment is that it offered no question or clarification and thus appeared to be critical in nature. If I am mistaken, then bcooney can let me know. In that case, I will surely offer an apology. I hope for jfortes' sake that this thread does not venture any further off topic. We are all just trying to make the forum a better place.
bcooney Posted September 9, 2009 Posted September 9, 2009 I thought the OP just wanted to edit a value list, and thought that they needed a CF to do so. Often, novice users jump to complex solutions unnecessarily. I can't expect them to use FM terminology correctly, I know. The thread title kept me thinking that they were editing a value list, not using one to compare to another list.
bcooney Posted September 9, 2009 Posted September 9, 2009 (edited) "our goal...is to get a list into an indexed calculation field based on a revised version of a hand-entered value list. " If only the OP had said that. Instead, "Hi, I'm trying to remove a list of items from a given value list." Hence, the cause of my "confusion." PS My post about value lists <> lists of values was meant for the other readers of this thread, many of whom are novices, that might also assume that editing a value list requires a CF. This forum, unlike TechNet, caters more to novices who are still trying to master the terminology. When I correct a post's misuse of terminology, it's to help, not to be condescending. If taken that way, I apologize. Edited September 9, 2009 by Guest
NovaChan Posted September 9, 2009 Posted September 9, 2009 Thanks for responding so nicely. I think the misunderstanding is clear now. I didn't get stuck on the terminology in part because I came along after this statement had been given in jfortes' second post: It's result will go in a calculation field that I need indexed as it will form part of another relationship. When I said you were coming across as brash, I might have been wiser to pose it as a question. I did take offense at the comment, so I offer my apologies as well. Your comment makes more sense now that I know you're trying to be extra clear for other users. I still think the statement itself can be reasonably seen as brash, but I have a better sense for your tone by your subsequent posts. I'm sure we will get along well as we continue to interact in the forums. jfortes, I hope your questions have been answered. By all means, don't let this little tiff discourage you from further posts.
bcooney Posted September 9, 2009 Posted September 9, 2009 Comment's post certainly got me to reread the thread from the top, and still I didn't make the leap that that's what jfortes required. It happens. That's why we all pitch in. Anyway, also looking forward to working with you here, and on TechNet. Remember, forums aren't conversation, and as with email, tone is hard to convey.
jfortes Posted September 10, 2009 Author Posted September 10, 2009 Hi, I finally found the custom function I was looking for. It is called SwitchList(ListA;ListB;CaseSensitive) and it works fine for my purpose. Thanks to all of you for your colaboration. I`m sorry if I was not clear enough in my previous comments, I feel like the cause of some kind of uncomfortable situation. What I wanted was a Custom funcition, this wish is somthing general, not to get something in particular to work right now, as things can be done in many many ways. In particular, the first use for this CF that I found is this: I have a table with three fields. With(text), Countries(text), cCountriesIncluded(text in stored calculation). The user can sellect out of three possible values for the field with: "all, without, with". For the last two opitons he must enter countries with carridge returns in the field Countries wich are validated against a predefined value list with all countries. In the field cCountriesIncluded I need the complete value list if the option "all" is selected, only the countries specified if the option "with" is selected and all but the countries speficied if "without"... Previously I had a script adding all countries or removing countries from the field Countries. This script was called everytime a user modified any of the involved fields: Countries or With. This script had a loop to remove sigle countries one by one. Now I don´t need neither scripts nor plugins or scripts activators Thank you one more time for your help as it pointed me in the right direction to find what I wanted. I'll be looking forward to any comments on the solution that i´m going to implement...
Recommended Posts
This topic is 5554 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 accountSign in
Already have an account? Sign in here.
Sign In Now