COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: CognosBen on 02 Dec 2014 06:26:35 AM

Title: Set number of Decimals in Charts to 0
Post by: CognosBen on 02 Dec 2014 06:26:35 AM
Hi,

Im not able to set number of decimals in a chart to 0 on the values on the bars.
Values are comping up in the chart with f.ex '318.666667' instead of '319'. Looks horrible!

What am I doing wrong here?
Title: Re: Set number of Decimals in Charts to 0
Post by: BigChris on 02 Dec 2014 06:37:00 AM
Hi - what have you tried so far? Have you set the Data Format for example?
Title: Re: Set number of Decimals in Charts to 0
Post by: CognosBen on 02 Dec 2014 07:03:24 AM
Hi BigChris,

Yes, I have been setting the dataformat to 'Number' and then 'Number of decimals' to 0
I've done this in all fields I am able to do this in a chart.

It's working perfectly if I instert a list and do the same, then there are no decimals.
Havent been able to achieve this in a Chart yet.
Title: Re: Set number of Decimals in Charts to 0
Post by: MFGF on 02 Dec 2014 11:04:59 AM
Quote from: CognosBen on 02 Dec 2014 06:26:35 AM
Hi,

Im not able to set number of decimals in a chart to 0 on the values on the bars.
Values are comping up in the chart with f.ex '318.666667' instead of '319'. Looks horrible!

What am I doing wrong here?

Hi,

When you refer to "values on the bars", do you mean the values displayed when you set the Series property "Show Values" to "Absolute"? Does your chart have a default measure? If the answers to these questions are both "yes", then all you should need to do is to select the default measure and set it's Data Format property. I just tried this and it works fine for me (Cognos 10.2.1 with FP5 using a Clustered Column chart).

Cheers!

MF.
Title: Re: Set number of Decimals in Charts to 0
Post by: CognosBen on 03 Dec 2014 06:21:39 AM
Quote from: MFGF on 02 Dec 2014 11:04:59 AM
Hi,

When you refer to "values on the bars", do you mean the values displayed when you set the Series property "Show Values" to "Absolute"? Does your chart have a default measure? If the answers to these questions are both "yes", then all you should need to do is to select the default measure and set it's Data Format property. I just tried this and it works fine for me (Cognos 10.2.1 with FP5 using a Clustered Column chart).

Cheers!

MF.

Hi,

Thanks for your effort to solve this.
I've tried this and it works in all formats except Excel 2007 format. Then a lot of decimals are displayed.
Not sure if you are able to produce that error aswell?
Title: Re: Set number of Decimals in Charts to 0
Post by: CognosBen on 05 Dec 2014 05:12:06 AM
Hi,

I was able to fix this be creating a new Data Item with the following expression based on the [Average] - Field
Works like a charm.

CEILING(CAST ([Average] AS FLOAT))