Nicholas Boyer Posted February 8, 2022 Share Posted February 8, 2022 Is anyone aware of a way to return specific parts of a Description in IBI For example, for a value like Advocate Reward - 11111111111 I would only want my report to output everything prior to the hyphen so it displays like Advocate Reward Note, I am using InfoAssist. Link to comment Share on other sites More sharing options...
Walter Brengel Posted February 8, 2022 Share Posted February 8, 2022 nicholas.boyer: Advocate Reward - 11111111111 Take a look at the token function: DEFINE FILE CAR MYFIELD/A50=Advocate Reward - 11111111111; MYFIELD_LEFT/A50=TOKEN(MYFIELD, - ,1); MYFIELD_RIGHT/A50=TOKEN(MYFIELD, - ',-1); END TABLE FILE CAR PRINT MYFIELD MYFIELD_LEFT MYFIELD_RIGHT BY COUNTRY WHERE RECORDLIMIT EQ 1 END If you dont see the token function there is also an older GETTOK function which will require more parameters: MYFIELD_LEFT/A50=GETTOK(MYFIELD,50,1,-,50,A50); MYFIELD_RIGHT/A50=GETTOK(MYFIELD,50,-1,-,50,A50); Walter Link to comment Share on other sites More sharing options...
Martin Yergeau Posted February 8, 2022 Share Posted February 8, 2022 Walter, Must use the below code otherwise this error is displayed : DEFINE FILE CAR MYFIELD /A50V = 'Advocate Reward - 11111111111'; MYFIELD_LEFT /A50V = TOKEN(MYFIELD, '-', 1); MYFIELD_RIGHT /A50V = TOKEN(MYFIELD, '-',-1); END TABLE FILE CAR PRINT MYFIELD MYFIELD_LEFT MYFIELD_RIGHT BY COUNTRY WHERE RECORDLIMIT EQ 1 END Link to comment Share on other sites More sharing options...
Walter Brengel Posted February 8, 2022 Share Posted February 8, 2022 Thanks Martin, I ran from the server console in 8207.28 with no problem. Link to comment Share on other sites More sharing options...
Nicholas Boyer Posted February 8, 2022 Author Share Posted February 8, 2022 I was able to get what I needed using the TOKEN function. Thanks for the help! Link to comment Share on other sites More sharing options...
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