Page 1 of 1

Removing all characters before a certain type of character

Posted: Tue Mar 04, 2008 4:28 pm
by zendo59
In a Transformer stage

I have a field defined as Varchar (50) which contains values like

CBAIB\jon
CBAIB\fred
PBS\jon
XXXX\xxx

I need to strip off the \ and all characters preceding it so the output will look like

jon
fred
jon
xxx

Can someone point me in the right direction?

Thanks in advance.

Posted: Tue Mar 04, 2008 4:40 pm
by chulett
Is Field() available in PX? If so:

Code: Select all

Field(YourColumn,"\",2)

Posted: Tue Mar 04, 2008 5:32 pm
by ray.wurlod
Yes, Field() is available in parallel Transformer expressions.

Posted: Tue Mar 04, 2008 5:34 pm
by ray.wurlod
Yes, Field() is available in parallel Transformer expressions.

Posted: Tue Mar 04, 2008 5:47 pm
by zendo59
Thanks guys. FIELD worked like a charm!

Posted: Tue Mar 04, 2008 10:36 pm
by kduke
I think you want:

Field(YourColumn,"\",2,9999)

Posted: Wed Mar 05, 2008 8:18 am
by chulett
Only if there are multiple delimiters in the string and you want all of the 'fields' after the first one. The assumption here was there were only two fields in the string, i.e. one delimiter.