COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Zimbo_African_1980 on 25 Feb 2015 09:12:50 AM

Title: Remove % sign from interest rate field
Post by: Zimbo_African_1980 on 25 Feb 2015 09:12:50 AM
I am trying to remove the % sign on an interest rate field.
I tried to use the cast, replace and left function and it all erred out.

Can someone help, any ideas

Thanks for your priceless time

Ruzv
Title: Re: Remove % sign from interest rate field
Post by: MFGF on 25 Feb 2015 09:22:14 AM
Quote from: Ruzvmun on 25 Feb 2015 09:12:50 AM
I am trying to remove the % sign on an interest rate field.
I tried to use the cast, replace and left function and it all erred out.

Can someone help, any ideas

Thanks for your priceless time

Ruzv

You need to determine whether the % sign is included in the underlying value (ie the value is a string) or whether it is being added because the item has a data format of 'Percent' defined. I'm assuming that since casting wasn't successful the latter may be the case?

Try going to the properties of the item and setting the data format to be 'Number' - does this work?

MF.
Title: Re: Remove % sign from interest rate field
Post by: Zimbo_African_1980 on 25 Feb 2015 10:06:52 AM
Yes, that is correct. It gave me an error when I tried that:(
Title: Re: Remove % sign from interest rate field
Post by: Michael75 on 25 Feb 2015 10:45:42 AM
Would you be prepared to give us a clue as to just what this error is, or would you prefer that everybody carries on spending their "priceless time" trying to guess what's come up on your screen?

Here's the post which explains what to include in a request for assistance:

http://www.cognoise.com/index.php/topic,24030.0.html (http://www.cognoise.com/index.php/topic,24030.0.html)

Title: Re: Remove % sign from interest rate field
Post by: Zimbo_African_1980 on 25 Feb 2015 12:46:52 PM
Actually, the cast as decimal worked.

"cast([Accounts].[Interest Rate]*100,decimail(12,4))"

this turned 6.5000% to 6.5000

Thank you for your priceless time again

Ruzv
Title: Re: Remove % sign from interest rate field
Post by: MFGF on 02 Mar 2015 05:17:45 AM
Quote from: Ruzvmun on 25 Feb 2015 12:46:52 PM
Actually, the cast as decimal worked.

"cast([Accounts].[Interest Rate]*100,decimail(12,4))"

this turned 6.5000% to 6.5000

Thank you for your priceless time again

Ruzv

Hi,

Since you're successfully multiplying [Accounts].[Interest Rate] by 100, it looks like the underlying interest rate is a number to begin with. I'm thinking you could make your report more efficient by removing the *100 and the cast() and simply setting the data format to number with a scale of 2?

MF.