COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: cognosun on 12 Nov 2012 02:46:55 AM

Title: Decimal point - additon issue
Post by: cognosun on 12 Nov 2012 02:46:55 AM
Hi Gurus,

I have decimal values like :

1.4678
4.7789
---------
6.2467  ( total)

In the report we are displaying only one value after decimal point ( i.e. 1.4, 4.7), using data format option.

But when we add these values, instead of showing total of 1.4 + 4.7 = 6.1, it's still showing above original total i.e.(6.2, which it's picking from 6.2467)

What it's doing is correct...but is there any way to tell cognos , not to use original total, instead add values after formatting is done.

Many Thanks.
Title: Re: Decimal point - additon issue
Post by: blom0344 on 12 Nov 2012 08:14:06 AM
You will actively need to round figures to the right precision and then perform the addition against those rounded figures. Cognos has standard functions for this!!
Title: Re: Decimal point - additon issue
Post by: cognosun on 13 Nov 2012 03:36:15 AM
Can you tell me more about Right precision...
Title: Re: Decimal point - additon issue
Post by: blom0344 on 13 Nov 2012 03:50:16 AM
Well, you want a certain number of values after the decimal point, don't you?  Check the Cognos _round function. It is well documented within Report Studio..
Title: Re: Decimal point - additon issue
Post by: cognosun on 13 Nov 2012 09:53:50 AM
Everything is in place..except totals are not related to displayed values.

I've observed this thing in Cognos sample packages as well...there if you observer 'Revenue' fact column is in decimal and if you add those values manually you get wrong values ( logically it's correct, because it's adding original values, but as per my requirements it's wrong).

Also...round function will roundup values, here we don't need any roundup (floor or celing), we need a plane addition.

Title: Re: Decimal point - additon issue
Post by: blom0344 on 13 Nov 2012 09:59:28 AM
 ::)  In your original post you wanted to add a list of rounded figures instead of adding figures that where merely formatted but internally still with highest precision.

If you totalize the ROUNDED figures you should get the desired result

I'm getting a bit exasperated here, but could also simply miss where you are after   ???
Title: Re: Decimal point - additon issue
Post by: cognosun on 15 Nov 2012 04:38:09 AM
let me post it as a new topic...as simple as possible.