if the id is same for several records,then the phone numbers will concatenate.
how to do it with transformer or without using transformer
source
id,name,phone
1,abcd,7687656543
1,abcd,9876342123
2,bmp,6545365342
2,bmp,6575434566
3,xyz,9087878765
target
id,name,phone
1,abcd,7687656543,9876342123
2,bmp,6545365342,6575434566
3,xyz,9087878765
thnx in advance
concatenate phone numbers with same customer id
Moderators: chulett, rschirm, roy
the solution above scenario like this
source---->sort---->transformer---->target
sort the data based on id and provide key change column
in transformer take three stage variables
prevkey 0 integer 1
newaccnt 'n' char 1
accnts 'y' varchar 255
map key change to prevkey
if prevkey=1 then 'y' else 'n' to newaccnt
else
accnts:',':in.accnt
then accnts drag to phonenum
source---->sort---->transformer---->target
sort the data based on id and provide key change column
in transformer take three stage variables
prevkey 0 integer 1
newaccnt 'n' char 1
accnts 'y' varchar 255
map key change to prevkey
if prevkey=1 then 'y' else 'n' to newaccnt
else
accnts:',':in.accnt
then accnts drag to phonenum
ANILKUMAR JAKKAMPUDI
Re: concatenate phone numbers with same customer id
i found the solution for this.
seqfile-->sort-->-->transformer-->remove duplicates-->dataset
in sort stage,set create key change column to true.
then u will get the required output
seqfile-->sort-->-->transformer-->remove duplicates-->dataset
in sort stage,set create key change column to true.
then u will get the required output
jhansi