Page 1 of 1

Decimal value (00000000000000000000.000000) to blank it

Posted: Mon Dec 03, 2012 3:37 am
by srini.dw
Hi,

Decimal values from source getting as 00000000000000000000.000000(DECIMAL (26,6)).If it's value of integer part and also decimal part is 0(ZERO) then convert it as blank("").

Could you please let me know how to achieve this logic?

Regards,
Srini

Re: Decimal value (00000000000000000000.000000) to blank it

Posted: Mon Dec 03, 2012 4:51 am
by Satwika
Multiply with 10,00,000 and convert from decimal to integer and check the value is zero. If Yes, populate "" else value.

Re: Decimal value (00000000000000000000.000000) to blank it

Posted: Mon Dec 03, 2012 5:13 am
by srini.dw
Satwika wrote:Multiply with 10,00,000 and convert from decimal to integer and check the value is zero. If Yes, populate "" else value.
1.if value 0000000000000000000.001000 then - final value as 0.001000
2.if value 0000000000000001000.000000 then - final value as 1000
3.if value 0000000000000000000.000000 then - final value as ""(blank)

Whatever your suggestion would work out 2 & 3.What about condition 1?

Regards,
Srini

Posted: Mon Dec 03, 2012 5:20 am
by BI-RMA
How about: If Columnname = 0 then "" Else Columnname ?

Re: Decimal value (00000000000000000000.000000) to blank it

Posted: Mon Dec 03, 2012 8:16 am
by Satwika
srini.dw wrote:Whatever your suggestion would work out 2 & 3.What about condition 1?
Even For 1st condition also it works . if you are multipling with 6 zeros then it replaces the decimals and makes it complete integer value. the 1st one's output is 1000. it is greater than 0 . so not required to replace with "".

Multplication and all checks do in stage variable and replace blank to the Original column.

Posted: Thu Dec 27, 2012 1:01 am
by harishkumar.upadrasta
please try this logic also


if( decimaltostring( input_decimal_field,"suppress_zero")=0) then '' else input_decimal_field

Posted: Thu Dec 27, 2012 2:01 pm
by ray.wurlod
There is an environment variable that allows the otherwise illegal situation of all zero bits in a decimal data type.