nulls to zero in 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
DS1
Charter Member
Charter Member
Posts: 29
Joined: Wed Mar 29, 2006 1:13 pm

nulls to zero in aggregator stage

Post by DS1 »

Hello,

the aggregator stage converts nulls to zero for the columns used for calculations.

is this a very reliable way / right way ????
or is it safer to use a modify stage before the aggregator stage to make the nulls in the caculation fields '0'
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

It is always better to do Null handling before processing.
Null is defined as unknown value and if you do add/sub/mul/div on any null value will return you an unknown value.

Sam
meena
Participant
Posts: 430
Joined: Tue Sep 13, 2005 12:17 pm

Re: nulls to zero in aggregator stage

Post by meena »

HI DS1,
If you are extracting data from a table then you can use a NulltoZero function in the SQL query else you can pass the data first to the transformer and use a function called NulltoZero in the transformer and next pass to the aggregator..It depends on your source whether to use transformer and aggregator stages are not. Because if your source is any database we can do it in SQL query both the calculations and nulltozero. And again it depends on what kind of calculations you want to do..

DS1 wrote:Hello,

the aggregator stage converts nulls to zero for the columns used for calculations.

is this a very reliable way / right way ????
or is it safer to use a modify stage before the aggregator stage to make the nulls in the caculation fields '0'
Thank you..
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There are some null-handling properties in the Aggregator stage that give you some alternative strategies. Investigate these.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DS1
Charter Member
Charter Member
Posts: 29
Joined: Wed Mar 29, 2006 1:13 pm

Post by DS1 »

Thanks everyone for the response.

meena, the method you suggested is always there , thanks for it.

however i wanted to know -- if only 'sum' is calculated in the aggregator stage, is it okay if i donot use a modify / transformer to make null to zero.

in the dev I am not using any null to zero but the aggregator stage is still doing proper calculations and is even converting nulls to zero.

I wanted to know if its going to be okay even with huge chunks of data .

If anbody has faced issues with letting the aggregator stage do null to zero please let me know.

I will even try to work on null-handling properties as mentioned by Ray.

Thanks everyone.
Post Reply