Hi,
In my job i have to count the no. of records coming from the input and i have to carry that to the transformer for some formatting.Along with that count , i have to carry one column from the source to the same transformer. For this i am using an aggregator to count the total rows and keeping that in the group. I have to pass one more column simply.Since, i am using an aggregator i can count the records, but i cannot pass the column through it.But to do this i need to keep that column also in the grouping list..
Is there any way around to this...........
Thanks,
dspxlearn
aggregator
Moderators: chulett, rschirm, roy
aggregator
Thanks and Regards!!
dspxlearn
dspxlearn
-
- Participant
- Posts: 437
- Joined: Fri Oct 15, 2004 6:13 am
- Location: Pune, India
If I got it correctly and what you intend to do is as follows:
there are 3 columns: A, B, C and you want to group on A & B and get count on A & B.
and you also want column C along with the count...
You may need to duplicate the data on other link before aggregation and then do the join on the duplicated dat once the aggregation is done.
there are 3 columns: A, B, C and you want to group on A & B and get count on A & B.
and you also want column C along with the count...
You may need to duplicate the data on other link before aggregation and then do the join on the duplicated dat once the aggregation is done.
Regards,
S. Kirtikumar.
S. Kirtikumar.
Hi,
Reconsidire your requirement once again.
You need to group based on a column an you need to carry out another column with grouping. Which means one column with fewer rows and another with full number of rows. How do you plan to match it.
Getting the first value for each group?
Getting last value for each group?
Getting average for each gropu?
Any of the above answer will give you the way to get the column out of the transformer.
regards
kumar
Reconsidire your requirement once again.
You need to group based on a column an you need to carry out another column with grouping. Which means one column with fewer rows and another with full number of rows. How do you plan to match it.
Getting the first value for each group?
Getting last value for each group?
Getting average for each gropu?
Any of the above answer will give you the way to get the column out of the transformer.
regards
kumar
Hi kirtikumar and kumar_s,
My requirement is to count the records of one column by grouping them and to simply pass another column to the next transformer for further formatting. I have a transformer from where 2 columns are there say A & B.Next an aggregator is used to count the no of rows of column 'A' .So in the aggregator i gave column A as a Group by column and same for "Aggregation type" as "Count".So from my source 600 rows are coming and the count is passed.Whereas i also need to pass column 'B' along with it without doing any grouping or anykind of caluculation to the next transformer....
I guess it the column 'B' needs to be kept in the grouping for it to pass to the output of the aggregator...Please advice on this....
If there is any other method to do this please let me know............
My requirement is to count the records of one column by grouping them and to simply pass another column to the next transformer for further formatting. I have a transformer from where 2 columns are there say A & B.Next an aggregator is used to count the no of rows of column 'A' .So in the aggregator i gave column A as a Group by column and same for "Aggregation type" as "Count".So from my source 600 rows are coming and the count is passed.Whereas i also need to pass column 'B' along with it without doing any grouping or anykind of caluculation to the next transformer....
I guess it the column 'B' needs to be kept in the grouping for it to pass to the output of the aggregator...Please advice on this....
If there is any other method to do this please let me know............
Thanks and Regards!!
dspxlearn
dspxlearn
Hi,
Can you write a SQL code for you requirement.
You may not. Aggregator works similar to you SQL code. You cannot expect somthing different from that.
You cannot take a aggregated column value and a column which is not aggregate together.
If i understand you requirement properly, you need
A B Group
3 x I
3 y I
3 z I
2 w II
2 x II
Column A is the total number of rows per group. Column B is the direct value.
To acheive this you may need to aggregate seperatly to find the number of row count. And need to do a join.
Or you can try the sort utility to sort based on the group and use the function of Create Key "Change Column to calculate number" of rows per group and can do further manipulation using a transformer.
- Kumar
Can you write a SQL code for you requirement.
You may not. Aggregator works similar to you SQL code. You cannot expect somthing different from that.
You cannot take a aggregated column value and a column which is not aggregate together.
If i understand you requirement properly, you need
A B Group
3 x I
3 y I
3 z I
2 w II
2 x II
Column A is the total number of rows per group. Column B is the direct value.
To acheive this you may need to aggregate seperatly to find the number of row count. And need to do a join.
Or you can try the sort utility to sort based on the group and use the function of Create Key "Change Column to calculate number" of rows per group and can do further manipulation using a transformer.
- Kumar
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
System variables and/or stage variables can be used to count things without the need to introduce an Aggregator stage.
Conceptually the Aggregator stage behaves like SQL, but physically it works differently. This is, and should be, transparent.
Conceptually the Aggregator stage behaves like SQL, but physically it works differently. This is, and should be, transparent.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.