Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Impromptu - reversal of text word by word

Status
Not open for further replies.

kajarekar

MIS
Mar 31, 2001
34
KW
I have a need to create a column in Impromptu where text in a given column should be reversed word by word. e.g. If the value in the input column is "DCBA HGFE LKJI ", the new column is expected to show "ABCD EFGH IJKL". The number of words in the input column can be anything i.e. sometimes 2 sometimes 4 or sometimes 7. In a nutshell, I am looking for reversal of text word by word
 
The "REVERSE" function, in the data-definition of a column, will do just what you ask....EXCEPT.....
it is truely reversed.
Example: "The sun is hot"......would be: "toh si nus ehT"
That's pretty close to what you want, eh?
 
Thanks sln007 for your prompt response. I had tried reverse function but it does not suit my requirement, though pretty close as you rightly mentioned.

My requirement is "The sun is hot" to be converted to "ehT nus si toh".

 
I would use a combination of columns and add them together at the end. Use your reverse, and right, and left for each, first word, something to catch the space so you have the number of letters correctly, then use the "+" to add them together in the end.

CP [cook]
 
If you knew there was a limited number of words in the string, you can use a combination of reverse and position to identify the location of the spaces that delimit the words, parse the word strings, and then reverse them. Then concatenate the reversed string words back together again.

Complex? Yes, but if you really need it, it may be the way to go.

Regards,

Dave Griffin


The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
Want good answers? Read FAQ20-2863 first!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top