Aggregator Stage

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
dsconultant
Participant
Posts: 10
Joined: Sat Dec 05, 2009 2:05 pm

Aggregator Stage

Post by dsconultant »

Hi,
Is it possible to sum negative values in aggregator stage?

I have a job in which I use an aggregator stage to calculate the sum. If the column has positive values the sum amount is correct, but if there is a negative value then the amount defaults to 0.

e.g
Key_Col Value_Col
1 1
1 1
2 -1
2 -2

For my result I should have

Key_Col Sum_col
1 2
2 -3 but instead it is 2 0.

My group_by column =Key_Col
Aggregation_type=Calculation
I use the Sum option and define my output column. I checked to see if there were any option for negative values but did not see any.
How can this scenario be handled?

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

Post by ray.wurlod »

What is the data type of Value_Col? In particular check the extended properties and inform us whether it is of type uint (unsigned integer).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
dsconultant
Participant
Posts: 10
Joined: Sat Dec 05, 2009 2:05 pm

Post by dsconultant »

It is not UINT. I am not 100% sure but it is either a numeric or decimal field and has no extended properties set.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Be sure. Check.
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