Stephen K Posted January 23, 2005 Share Posted January 23, 2005 I have a field called "topic_id"...contains information such as "8BS". I want to set up a calculation field that uses information within the text string to calculate data. eg if the text string contains "8" then "Year 8" is generated. in a separate field...if the text string contains "8" then "Stage 4" is generated. I can't identify a text function that does this...is there one or do I need to make up a script? TIA Stephen K Link to comment Share on other sites More sharing options...
BobWeaver Posted January 23, 2005 Share Posted January 23, 2005 The TextToNum() function will return any numbers in a field with the text stripped off. Then you can use them in a calculation as necessary. If the data may contain more than one number separated by text, it gets a bit more complicated. Link to comment Share on other sites More sharing options...
Vaughan Posted January 23, 2005 Share Posted January 23, 2005 Stephen K: The PatternCount() function can be used in combination with Case() to conditionally do all the string generation for you... Case( PatternCount( topic_id ; "8" ) ; "Year 8" ; PatternCount( topic_id ; "7" ) ; "Year 7" ; ... ) BobWeaver: good to see you back! Link to comment Share on other sites More sharing options...
BobWeaver Posted January 23, 2005 Share Posted January 23, 2005 Hi Vaughan, Yeah, Nice to be back. Got abducted by those pesky aliens again. Link to comment Share on other sites More sharing options...
Vaughan Posted January 24, 2005 Share Posted January 24, 2005 Yeah it's hard having to type while standing up. LOL Link to comment Share on other sites More sharing options...
Stephen K Posted January 24, 2005 Author Share Posted January 24, 2005 Thanks fellas Both do what I need...its good to have options! Stephen Link to comment Share on other sites More sharing options...
BobWeaver Posted January 24, 2005 Share Posted January 24, 2005 Yeah it's hard having to type while standing up. LOL Well, I wasn't going to say anything about that. Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 6635 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