One Star

[resolved] How to fetch Count in TALEND

Hi
Here is what I am trying to do:
I have Oracle as Source and Destination is SQL. My requirement is to join 2 tables in Oracle on Org Id field and load the output to SQL Server.
Please let me know how to achieve this?
Table 1:
Org Id | Org Name
------- ----------
1        | Org 1
---------- --------
2        | Org 2
---------- --------
3        | Org 3
---------- --------
4        | Org 4
---------- --------
5        | Org 5
******************************************************************
Table 2:
Emp Id | Org Id | Emp Name
-------- -------- -------
1         | 1         | abcxyz
-------- -------- -------
2         | 2         | abcxyz
-------- -------- -------
3         | 3         | abcxyz
-------- -------- -------
4         | 1         | abcxyz
-------- -------- -------
5         | 1         | abcxyz
-------- -------- -------
6         | 3         | abcxyz
-------- -------- -------
7         | 1         | abcxyz
-------- -------- -------
8         | 2         | abcxyz
-------- -------- -------
9         | 2         | abcxyz
-------- -------- -------
10        | 1         | abcxyz
-------- -------- -------
11        | 2         | abcxyz
-------- -------- -------
12        | 3         | abcxyz
-------- -------- -------
13        | 1         | abcxyz
-------- -------- -------
14        | 1         | abcxyz
-------- -------- -------
15        | 1         | abcxyz
-------- -------- -------
Now I want to fetch the number of employees foreach Org Name. My output should look something like below:
Expected Output
Org Name | Count
---------- --------
Org 1        | 8
---------- --------
Org 2        | 4
---------- --------
Org 3        | 3
Thanks
1 ACCEPTED SOLUTION

Accepted Solutions
Four Stars

Re: [resolved] How to fetch Count in TALEND

Hi kalyan,
Following is the result of the above configuration...
connected
 Org 1|8
 Org 2|4
 Org 3|3
disconnected
Following were changes..
Add count column in tMap output as integer
Use count column in operations... check screenshot below.


thanks
vaibhav
5 REPLIES
Four Stars

Re: [resolved] How to fetch Count in TALEND

Hi,
Use tMap, innerJoin, and they taggregaterow with count function....
Vaibhav
One Star

Re: [resolved] How to fetch Count in TALEND

I tried the same (tMap -> InnerJoin -> tAggregateRow -> tSortRow) but i am getting count as 0
Four Stars

Re: [resolved] How to fetch Count in TALEND

Show your tMap configuration? how many rows you are receiving at the output of your tMap? which aggregate column you are using?
Seventeen Stars

Re: [resolved] How to fetch Count in TALEND

hi
could be something like


Read & test example on different component from Talend Help
NOtice I aggregate first and join looking for the name i expected after
regards
laurent
Four Stars

Re: [resolved] How to fetch Count in TALEND

Hi kalyan,
Following is the result of the above configuration...
connected
 Org 1|8
 Org 2|4
 Org 3|3
disconnected
Following were changes..
Add count column in tMap output as integer
Use count column in operations... check screenshot below.


thanks
vaibhav