Aggregator
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 8
- Joined: Thu Feb 21, 2008 4:22 am
Aggregator
Hey Friends,
I have an Input File as follows;
KeyID EmpId1 EmpId2 Col3_1 Col3_2
101 1043 0 A 0
101 0 1059 0 B
101 0 0 0 0
101 0 0 0 0
102 0 0 0 0
102 0 0 0 0
103 1043 0 Y 0
103 0 0 0 0
104 0 1059 0 Z
104 0 0 0 0
104 0 0 0 0
104 0 0 0 0
Using Aggregator Stage I mentioned;
1. In the group - KeyID
2. In the column for calculation - EmpId1
3. Sum of calculation - EmpId1
4. Repeated the Steps 2 and 3 for other columns too
Expected Output;
KeyID EmpId1 EmpId2 Col3_1 Col3_2
101 1043 1059 A B
102 0 0 0 0
103 1043 0 Y 0
104 0 1059 0 Z
But I had an Output as follows;
KeyID EmpId1 EmpId2 Col3_1 Col3_2
101 1043 1059 0 0
102 0 0 0 0
103 1043 0 0 0
104 0 1059 0 0
For Integer(EmpId1 and EmpId2) we can sum the Input But for an Alphabet(Col3_1 and Col3_2) What to do?
Please help me out
Regards,
Rajasingam.
I have an Input File as follows;
KeyID EmpId1 EmpId2 Col3_1 Col3_2
101 1043 0 A 0
101 0 1059 0 B
101 0 0 0 0
101 0 0 0 0
102 0 0 0 0
102 0 0 0 0
103 1043 0 Y 0
103 0 0 0 0
104 0 1059 0 Z
104 0 0 0 0
104 0 0 0 0
104 0 0 0 0
Using Aggregator Stage I mentioned;
1. In the group - KeyID
2. In the column for calculation - EmpId1
3. Sum of calculation - EmpId1
4. Repeated the Steps 2 and 3 for other columns too
Expected Output;
KeyID EmpId1 EmpId2 Col3_1 Col3_2
101 1043 1059 A B
102 0 0 0 0
103 1043 0 Y 0
104 0 1059 0 Z
But I had an Output as follows;
KeyID EmpId1 EmpId2 Col3_1 Col3_2
101 1043 1059 0 0
102 0 0 0 0
103 1043 0 0 0
104 0 1059 0 0
For Integer(EmpId1 and EmpId2) we can sum the Input But for an Alphabet(Col3_1 and Col3_2) What to do?
Please help me out
Regards,
Rajasingam.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You can't include "A" and "B" as values to be summed. DataStage substitutes zero, and probably logs a warning of the form "non-numeric where numeric required, zero used".
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.
-
- Participant
- Posts: 8
- Joined: Thu Feb 21, 2008 4:22 am
-
- Participant
- Posts: 8
- Joined: Thu Feb 21, 2008 4:22 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 8
- Joined: Thu Feb 21, 2008 4:22 am
There is not stage that can perform mathematic operations on non-mathematic objects. You need to define what the result of "B+Z" is, as BugFree has noted. Once you have a rule for that you can either convert your values to numerics and use an Aggregator stage or you can write your own code to do this.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You can do Min, Max, or Count on non-numeric data. You can NOT do Sum, Avg or Std Dev. Most of the other functions available also require that the data be numeric.
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.