Aggregate the Data

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
neeraj
Participant
Posts: 107
Joined: Tue May 24, 2005 4:09 am

Aggregate the Data

Post by neeraj »

HI,

I have a data

Stud Subject1 Subject2 Subject 3 Subject4
a1 Null Null 10 Null
a1 Null 5 Null Null
a1 Null Null Null Null
a1 Null Null Null Null

I want an output like
Stud Subject1 Subject2 Subject 3 Subject4
a1 Null 5 10 Null

To acheive it, used an aggregate function,group by Stud and used Max function and got the results like
Stud Subject1 Subject2 Subject 3 Subject4
a1 0 5 10 0

For Subject 2 ad 3, it is OK but for Suject 1 and Subject4, Insead of Null, I am getting 0. The data type is Small int.

Please let me know how can I get the expected results.

Regards
Neeraj
neeraj
Participant
Posts: 107
Joined: Tue May 24, 2005 4:09 am

Post by neeraj »

I found the solution.

By setting Allow Null Output=True.. I am getting the correct output.

Thanks
Neeraj
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Please mark thread as Resolved using green button at top. Well done for finding the solution.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply