Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Groupby with count

0683p000009Lspu.jpg

Please help me out this in talend.

Labels (1)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

OK, this is a little difficult to talk you through on here, so I have knocked up a quick example Job in v6.2.1. If you are using a later version of Talend you will be able to import this.

 

The important logic is in the tMap and the tAggregate. 

 

1) I combine the Name fields

2) I add a 1 to non-numeric rows and a 0 to numeric rows then use the tAggregate to "sum" that field ....giving the count.

3) I group by the Name field and return only the first record of the Group

 

 

 

 

 

 


GroupByExample.zip

View solution in original post

4 Replies
Anonymous
Not applicable
Author

You need to give more information. We will need precise rules for grouping which are not provided. For example, are only non-numeric IDs that come after numeric IDs counted? What happens is Nam1, Name2 and Name3 all have values? What happens if the same ID (numeric) has different Names?

 

You need to analyse this and fully understand your problem so that you can ask for advice on how to achieve it.

Anonymous
Not applicable
Author

Hi Hall,

Thanks for your reply.

 

1. Are only non-numeric IDs that come after numeric IDs counted?

---Yes, non-numeric IDs that come after numeric IDs should be counted.

 

2.What happens is Nam1, Name2 and Name3 all have values?

---Either of Name1, Name2 and Name3  have value

 

3.What happens if the same ID (numeric) has different Names?

---Same ID with same names is considered.

 

Tried using Tmap & aggregate row, but things not worked for me

Please help me out Hall.Much appreciable

 

Regards,

Blessey

Anonymous
Not applicable
Author

OK, this is a little difficult to talk you through on here, so I have knocked up a quick example Job in v6.2.1. If you are using a later version of Talend you will be able to import this.

 

The important logic is in the tMap and the tAggregate. 

 

1) I combine the Name fields

2) I add a 1 to non-numeric rows and a 0 to numeric rows then use the tAggregate to "sum" that field ....giving the count.

3) I group by the Name field and return only the first record of the Group

 

 

 

 

 

 


GroupByExample.zip
Anonymous
Not applicable
Author

Great..!

Thanks for all your help & your time Hall.Worked for me

 

Regards,

Blessing