Page 1 of 1

Summation in transformer stage

Posted: Tue Sep 16, 2008 8:50 am
by jani
Hi All,

I am trying to sum a column without grouping.I need the summation as a single value so that i can use that as variable in calculation.Please help me out.

Thanks in advance.

Re: Summation in transformer stage

Posted: Tue Sep 16, 2008 9:24 am
by sachin1
stage variable will help............

stage variable = stage variable + input column value

Re: Summation in transformer stage

Posted: Tue Sep 16, 2008 12:59 pm
by vivekgadwal
sachin1 wrote:stage variable will help............

stage variable = stage variable + input column value
Yeah, this should work. Don't forget to initialize the stage variable to whatever value you want (ex. '0').

Re: Summation in transformer stage

Posted: Wed Sep 17, 2008 3:52 am
by jani
sachin1 wrote:stage variable will help............

stage variable = stage variable + input column value
Hi Sachin,
Sorry i did not get u.For example if Quantity is a column then i want sum(Quantity) as a single value irrespective of the other columns.

Thanks

Re: Summation in transformer stage

Posted: Wed Sep 17, 2008 4:43 am
by sachin1
jani wrote:
sachin1 wrote:stage variable will help............

stage variable = stage variable + input column value
Hi Sachin,
Sorry i did not get u.For example if Quantity is a column then i want sum(Quantity) as a single value irrespective of the other columns.

Thanks
hello dear in stage variable palette define one variable for example sum_quant, in derivation put sum_quant + input_column_name.

in transformer put derivation for column Quantity as stage variable.

Derivation column name
sum_quant Quantity.

Posted: Wed Sep 17, 2008 5:56 am
by ray.wurlod
You're all crazy! Use an Aggregator stage to sum the column. Specify no grouping columns. It will use no memory (apart from the actual running sum) and be very fast. And it will require no "programming".