NickOE Posted August 29, 2013 Posted August 29, 2013 I am looking for a custom function that will get values based upon a list of value numbers. Example: Data = a¶b¶c¶d¶e¶f¶g Value Numbers = 3¶5¶6 Result should be = c¶e¶f Or if I can choose my own separator, that would be great. Any help I can get would be greatly appreciated.
eos Posted August 29, 2013 Posted August 29, 2013 Have a look here: http://www.briandunning.com/cf/1118
NickOE Posted August 29, 2013 Author Posted August 29, 2013 Thank you for the reply. That function does not get specific values. It gets every 2nd or 3rd or 4th and so on.
Raybaudi Posted August 29, 2013 Posted August 29, 2013 /* GetValues ( listOfValues ; listOfNumbers ) */ Let([ $i = $i + 1; v = GetValue ( listOfValues ; GetValue ( listOfNumbers ; $i ) ) ]; Case( $i ≤ ValueCount ( listOfNumbers ) ; List ( v ; GetValues ( listOfValues ; listOfNumbers ) ); Let ( $i = "" ; "" ) ) ) 1
comment Posted August 29, 2013 Posted August 29, 2013 Try something like: GetValues ( listOfValues ; valueNumbers ) = Let ( countValues = ValueCount ( valueNumbers ) ; GetValue ( listOfValues ; GetValue ( valueNumbers ; 1 ) ) & Case ( countValues > 1 ; ¶ & GetValues ( listOfValues ; RightValues ( valueNumbers ; countValues - 1 ) ) ) ) To use your own separator, just substitute it with ¶ when calling the function, then reverse the substitution on the result. 1
Raybaudi Posted August 29, 2013 Posted August 29, 2013 @Nick What should be the result if: Data = a¶b¶c¶d¶e¶f¶g Value Numbers = 8¶1¶2 ? If it shoud be: a¶b than my CF is OK else If it shoud be: ¶a¶b than Comment's CF is OK
NickOE Posted August 29, 2013 Author Posted August 29, 2013 Raybaudi, I tried your function and it works perfectly. Thank you!
Recommended Posts
This topic is 4171 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