Finding Max and Min on varchar column
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 5
- Joined: Sun Dec 30, 2012 11:56 pm
Finding Max and Min on varchar column
Can any one suggest how to find Maximum and Minimum on varchar column in Datastage 8.1
Sriram@BCL
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 5
- Joined: Sun Dec 30, 2012 11:56 pm
Re: Finding Max and Min on varchar column
Thanks for the reply. I tried all the possibilities with Agg. We have incoming data contains like 'abcdefg' etc. we are facing issue in finding min and max on string. In server job using aggregator we are able to do. in PX i am not able to do it. Plz suggest
Sriram@BCL
-
- Premium Member
- Posts: 376
- Joined: Sat Jan 07, 2012 12:25 pm
- Location: Piscataway
Please post the expected and the actual outputs.
Jerome
Data Integration Consultant at AWS
Connect With Me On LinkedIn
Life is really simple, but we insist on making it complicated.
Data Integration Consultant at AWS
Connect With Me On LinkedIn
Life is really simple, but we insist on making it complicated.
-
- Participant
- Posts: 5
- Joined: Sun Dec 30, 2012 11:56 pm
Re: Finding Max and Min on varchar column
My iniput column contains
112A
112B
112C
My output should be Max(Column) i.e 112C
112A
112B
112C
My output should be Max(Column) i.e 112C
Sriram@BCL
I just tried it and it would seem that the MAX() function of the aggregator stage is limited to numeric data in Parallel jobs.
Along similar lines to what Ray mentioned, use one stream for a sort and a remove duplicates (first or last, depending upon whether you want a min or a max value) to get the highest or lowest value of that field.
Along similar lines to what Ray mentioned, use one stream for a sort and a remove duplicates (first or last, depending upon whether you want a min or a max value) to get the highest or lowest value of that field.
-
- Participant
- Posts: 5
- Joined: Sun Dec 30, 2012 11:56 pm
That's quite odd, I did a test job earlier to see about the aggregator and had a functioning max() working using a sort and remove duplicates within 5 minutes. Perhaps you might want to revist your approach, and if you wish assistance here you might wish to post what you did and what the problem was.
-
- Participant
- Posts: 15
- Joined: Wed May 02, 2012 3:38 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: