Page 1 of 1

Adding the amount column value from Sequencial file.

Posted: Tue Nov 25, 2008 12:14 am
by laknar
Hi,

I'm reading from fixed width file.
in that i have a amount column starts with + or -

i.e -10.00
-12.12
+14.98
+25.78

im reading the file as squential mode.
i want to sum the column + seperately and - values seperately.

and finally differences for + values and -Values.
how can i acheive this.

Posted: Tue Nov 25, 2008 1:18 am
by bi_fujitsu
Convert to Decimal first and then use an aggregator stage to calculate the sum. Even if the order is sequential, it should give you correct sum irrespective of the sign.
-10+5 is always going to be -5.

Posted: Tue Nov 25, 2008 2:10 am
by laknar
From source itself im getting as decimal value.
how can i convert.
please suggest me.

Posted: Tue Nov 25, 2008 2:20 am
by us1aslam1us
If your source already have it as decimal then what is stopping you to use aggregator for Summing those values??

Posted: Tue Nov 25, 2008 2:27 am
by bi_fujitsu
if it's decimal in source, then there is no need of any type conversion. Use an aggregator stage to perform regular summation.