Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good Morning to all,
I have a stright table in that I have a field name called as "Comments", it contains around 300 rows of values.
My requirement is I would like to find and replace a particular value.
example In the field REMAINDER is a word and I would like to change into CANCEL. Is it possible to replace the values for the entire table.
Please advise..
Joe
Simply you can use if statement to convert the text
hi,
check out the Replace() function. this shoudl do what you want.
from help:
Returns a string after replacing all occurences of a given substring within the string s with another substring. The function is non-recursive and works from left to right.
s is the original string.
fromstring is a string which may occur one or more times within string.
tostring is the string which will replace all occurences of fromstring within string.
replace('abccde','cc','xyz') returns ‘abxyzde’
You can either use it in an expression in your chart or to transform the field when you load it into your qvw from your data source.
Thanks for your reply,
I tried using If statement, but I failed, Can you expain it....
Regards
Joe
Did you try like this?
if(Comments='REMAINDER', 'CANCEL',Comments)
Dear Bala,
Thanks for your update
I have attached my qvw file in the orginal post, can you see and advise me..
Many thanks
Joe
Sorry I didn't see the attachment before...You can use =replace(Comments,'REMINDER','CANCEL') in the list box
Hello Joe,
Agree with Pat. Try replacing
if([Comments]='REMINDER','XXXXXXXXXXXXXX',[Comments]) as comm
In your script by
Replace(Comments, 'REMINDER' 'CANCEL') AS comm
Hope that helps.
BI Consultant
Thanks a lot both Bala and Miguel its working fine now...
but using the same replace command I would like to replace multiple values, is it possible..
like
REPLACE([commentFollow],'n'', 'Name','qu'','Name1') as NcommentFollow
Is it possible..
Thanks a lot again.
Joe
Hello Joe,
If I understood you right, it is possible, although the function is different. Take a look at the following sample code
CharMap:
MAPPING LOAD * INLINE [
Old, New
á, á
é, é
];
Data:
LOAD *,
MapSubString('CharMap', OriginalField) AS ModifiedField
INLINE [
OriginalField
áé
ae
aé
];
Hope that helps.
BI Consultant