Page 1 of 1

Replace command

Posted: Mon Nov 30, 2009 3:58 pm
by edison
remove unnecessary character from First Names(Cominf from source). Valid characters are 0-9, A-Z, ^-_^.,!& ''
All other characters are considered invalid and should be replaced with ' '"

need replace command to use in tranformation logic

Posted: Mon Nov 30, 2009 4:05 pm
by ray.wurlod
There is no replace command. There is, however, a Convert() function. Convert all non-required characters to "".

Tip: initialize a stage variable to contain a full list of non-required characters.

Posted: Mon Nov 30, 2009 4:38 pm
by chulett
... or store the valid characters (if smaller) and do the "double convert" that's been posted here before.

convert()

Posted: Tue Dec 01, 2009 5:26 pm
by edison
I tried to do this stage variables,the field populating empty

Convert('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!&^-_\,','',upcase(LNK_ARNGM_CLASS.ACCOUNT_FIRST_NAME)) - StageVar1

Convert(StageVar1,str(' ',len(StageVar1)),LNK_ARNGM_CLASS.ACCOUNT_FIRST_NAME)

Posted: Wed Dec 02, 2009 3:16 am
by Sainath.Srinivasan
Remove the str function in second convert.

convert()

Posted: Wed Dec 02, 2009 5:31 pm
by edison
I tried to do this stage variables,the field populating empty

Convert('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!&^-_\,','',upcase(LNK_ARNGM_CLASS.ACCOUNT_FIRST_NAME)) - StageVar1

Convert(StageVar1,LNK_ARNGM_CLASS.ACCOUNT_FIRST_NAME)

Posted: Wed Dec 02, 2009 5:38 pm
by chulett
Convert requires three arguments.

Convert()

Posted: Wed Dec 02, 2009 5:44 pm
by edison
I tried to do this stage variables,the field populating empty

Convert('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!&^-_\,','',upcase(LNK_ARNGM_CLASS.ACCOUNT_FIRST_NAME)) - StageVar1

Convert(StageVar1,(' ',len(StageVar1)),LNK_ARNGM_CLASS.ACCOUNT_FIRST_NAME)

Posted: Wed Dec 02, 2009 7:25 pm
by chulett
Bejeebus, kind of like a broken record. If it didn't work before, why would it suddenly start working now? :?

What happens if you use this as your derivation:

Convert(StageVar1,"",LNK_ARNGM_CLASS.ACCOUNT_FIRST_NAME)

Posted: Thu Dec 03, 2009 2:42 am
by Sainath.Srinivasan
By asking you to remove the str function, I meant to change it with the character which must replace your "special characters".

If you want them to be replaced by blank space, use ' '.