Page 1 of 1

Left function

Posted: Wed Apr 12, 2006 3:08 pm
by somu_june
Hi,

I have a requirement like this . I have a field1 and field2 with decimal(7,4) in DB2 table for example if have a value of field1 as 001.2000 and 001.4000. I need output as 1.20001.4000 and I am using in transformer left (field1,eight):left(field2,eight) but iam getting output as 001.200 001.400 how to eliminate the zeros before numeric values and how toget the other Zero after decimal the output I want is Char .

THe final output must be 1.2000 1.4000


Thanks,
Somaraju.

Posted: Thu Apr 13, 2006 1:10 am
by ArndW
Convert the numeric values to VarChar then do a trim to remove leading 0's and then perform your concatenation. Look up the trim() function declaration in the PX manual, I think it is trim(In.Column,"0","F") but I'm not certain and don't have access to the manual here.

Posted: Fri Apr 14, 2006 10:06 am
by somu_june
Hi Arnd,


Thanks for reply. My problem was solved Iam using right(trim(DecimalToString(field1,"fix_Zero")),6) : right (trim(DecimalToString(field2,"fix_Zero")),6).


Thanks,
Somaraju.