You are not logged in.
Announcement
Unanswered posts
|
Pages: 1
Source table
eno;a_flag;r_flag;c_flag;dept
1;y;y;;10
2;y;n;;10
3;n;n;;10
4;y;y;;20
5;y;y;;20
6;n;y;y20
7;;;30
Output table
dept flag count
10 a_flag 2
10 r_flag 1
10 c_flag 0
20 a_flag 2
20 r_flag 3
20 c_flag 1
30 a_flag 0
30 r_flag 0
30 c_flag 0
how to do this?
Hi helptransform,
Welcome to the forum
tFileInput --> tUnpivotRow --> tMap --> tAggregateRow --> t<db>Output
tUnpivotRow is in the Talend Exchange
http://www.talendforge.org/exchange/tos … hp?eid=148
The output of tUnpivotRow will have the flag column.
In the tMap, you will use conditional expressions for the count.
"y".equals(row2.flag)?1:0
In the tAggregateRow, sum the count column, group by the others.
Send the result to a tMySQLOutput (or whatever database you are using)
Good luck.
Thanks,
Ben
Offline
Pages: 1