Page 1 of 1

concatenate the three columns

Posted: Tue Mar 22, 2011 11:23 pm
by suresh_dsx
Hi,

I want to concatenate the three columns on the emp information.

Code: Select all

Source data

ename,eid,eflag
"abc","100","yes"
"bbc","200","new"
"cbc","300","old"
"dbc","400","NA"

output: 

ename,eid,eflag,eval
"abc","100","yes","abc100new"
"bbc","200","new","bbc200old"
"cbc","300","old","cbc300NA"
"dbc","400","NA",""
eval is similar like encrypted value. Tried with transfer stage and able to concatenate the same value but I am unable to concatenate the next row value.

Any help greatly appreciated

Thanks

Posted: Wed Mar 23, 2011 1:09 am
by ray.wurlod
Sort in reverse order and use stage variables to remember previous value. Initialize the "remembering" stage variable to "". Re-sort if necessary downstream of the Transformer stage.

Posted: Wed Mar 23, 2011 1:12 am
by ersunnys
Unfortunately all processing is done in order...

If you want value of second record in first record then sort the data in descending (reverse) order first and then process through transformer...

use stage variable store value of eflag of previous record and use it with next record...