#1 2012-05-25 21:23:06

talendnewbie1
Guest

transformation

eno;role;dept
1;App;10
1;Cert;10
1;App;20
2;App;10
2;Cert;10
2;Rev;20
2;Cert;30
3;cert;10

how to use tIterate and TMap to do get the output like this

eno;app_flag;cert_flag;rev_flag
1;y;y;n
2;y;y;y
3;n;y;n

#2 2012-05-25 21:38:42

phobucket
Member
Company: Knoetry
Registered: 2010-07-27
Posts: 146
Website

Re: transformation

Hi,

No need for tIterate:

tFileInput --> tMap --> tAggregateRow --> (rest of job)

Send the input to a tmap with eno;app_flag;cert_flag;rev_flag
map row1.eno to output.eno
"App".equals(row1.role)?"y":"n"    mapped to app_flag
"Cert".equals(row1.role)?"y":"n"   mapped to cert_flag
"Rev".equals(row1.role)?"y":"n"    mapped to rev_flag

send this to a tAggregate row
group by eno
max() each of the other fields

Thanks,
Ben

Offline

Board footer

Powered by FluxBB