COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: hauge9 on 11 May 2010 02:25:31 PM

Title: Cognos - Rounding (Round Up)
Post by: hauge9 on 11 May 2010 02:25:31 PM
Has anyone else dealt with or heard of this issue. Basically I need to display whole numbers with .5 rounded up. According to Cognos support they always display using "half even" rounding and there is no work-around to change it. This means it rounds .5 down to even or up to even.

I have a hard time believing there is no way to change it, as this seems like a fairly common need.....

Any insight?
Title: Re: Cognos - Rounding (Round Up)
Post by: CognosPaul on 12 May 2010 03:14:49 AM
The following was done usnig the SQL Server round function.

-0.25   0
0       0
0.25    0
0.5     1
0.75    1
1.25    1
1.5     2
1.75    2
2.25    2
2.5     3
2.75    3
3       3
4       4
4.25    4
4.75    5
5.5     6
5.75    6
6       6
6.25    6
6.5     7


It may be that Cognos will do that only in local processing. Can you give more details?
Title: Re: Cognos - Rounding (Round Up)
Post by: bloggerman on 20 May 2010 01:05:02 PM
I ran into the same problem with my reports. I vaguely remember that i pulled something out of Cognos7 and had it inserted in Cognos 8. Cognos 7 has a function which works well with rounding. I got the sql code for that function by looping up n the SQL tab and inserted it in Cognos 8. Give this a shot and see what happens.
Title: Re: Cognos - Rounding (Round Up)
Post by: mvjcognos on 24 Jun 2010 04:05:04 AM
In cognos u have data format property is there click the particular data item then go to the properties pane data format like nuber then select the no.of values rounded to zero. Try this......
Title: Re: Cognos - Rounding (Round Up)
Post by: LR on 12 Oct 2012 06:28:54 AM
I have a number that is 34 digits long. I just want cognos to render it as such
eg: 12345677934353485746546895460412312323
but it does a round off and renders it on the screen like this.
eg 12345677934353500000000000000000000000

From report studio, the value is a direct pull from the db and I haven't done any modifications.

It works if i change it to to_char before rendering. But i want to display it as a number only.

Can someone tell me what I can do to get rid of this?

Title: Re: Cognos - Rounding (Round Up)
Post by: wyconian on 12 Oct 2012 09:12:31 AM
Hi

What are you using the 34 digit number for?  If it's just an attribute i.e. you don't want to aggregate it then there isn't an issue in displaying it as a char.

Why do you want to display it as a number?
Title: Re: Cognos - Rounding (Round Up)
Post by: LR on 12 Oct 2012 09:10:06 PM

Thanks for the reply.

I want to display it as number because we have customers who have integrated with us expecting number for this field.
It might break the integration if I change it to char.
this field is a bill number.

Is there a way to do it? oir its just char that we should be using.