How can I apply this logic?
Moderators: chulett, rschirm, roy
How can I apply this logic?
Hi,
I have a input like this
ID Pin1 Pin2
1 123 0
1 855 1
1 855 2
2 52 0
2 120 1
I need output like this
ID Pin1 Pin2
1 855 2
2 120 1
Conditions:
Unique ID
Pin 1 maximum
if you have 2 records with maximum Pin 1 then take maximum Pin 2
Any suggestions?
Thanks,
I have a input like this
ID Pin1 Pin2
1 123 0
1 855 1
1 855 2
2 52 0
2 120 1
I need output like this
ID Pin1 Pin2
1 855 2
2 120 1
Conditions:
Unique ID
Pin 1 maximum
if you have 2 records with maximum Pin 1 then take maximum Pin 2
Any suggestions?
Thanks,
Bhanu
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I don't have any documentation in front of me at the moment but it should be pretty straight-forward to work out what you need there. Basically, for every field you are not grouping by you have to tell the Aggregator what aggregation method you want applied. One of the available methods is Max or Maximum or something very similar. Choose that as the derivation of the output columns.
Checked the docs: under Aggregations you would use Maximum Value.
Checked the docs: under Aggregations you would use Maximum Value.
Last edited by chulett on Thu Dec 06, 2012 11:25 pm, edited 1 time in total.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Thanks Ray,
One question, I didn't see any difference by selecting key as a partitioning algorithm. Even it returns same rows before also. I used sort stage to sort on key, id and id2 and after that I used remove duplicates. Whats the purpose of using partitioning (hash or modulus) on key.
Thank you,
One question, I didn't see any difference by selecting key as a partitioning algorithm. Even it returns same rows before also. I used sort stage to sort on key, id and id2 and after that I used remove duplicates. Whats the purpose of using partitioning (hash or modulus) on key.
Thank you,
Bhanu
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
"Key Adjacency" to make sure that any one Key value only occurs on one partition: that is, that each key value only generates a single group. You don't do this and, worst case, you'll get one group per key per node.
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: 18
- Joined: Tue Dec 25, 2012 10:39 pm
- Location: Detroit,MI
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 18
- Joined: Tue Dec 25, 2012 10:39 pm
- Location: Detroit,MI