3

I've seen how to use tMap in TOS to map different fields in a SQL-like JOIN. How do I aggregate based on certain fields?

If I have two tables:

[ A, B, C, D ]
and               that are tMap'ped to  [ B, C, F, G ]
[ B, E, F, G] 

how can I aggregate the results to that instead of the many entries of the non-unique B I can see something like:

[ B, count(B), avg(C), avg(F), avg(G) ]

Thanks!

batman
  • 1,447
  • 5
  • 16
  • 27
  • Update: I don't even know if Talend can do this. Ended up using Awk instead. But the question is still open! – batman Jun 01 '11 at 15:55

1 Answers1

5

You certainly can. Use the tAggregate component to do that. You can group by column B and then compute all of the different aggregations, like count, sum, and average in the other columns.

drmirror
  • 3,698
  • 26
  • 26