COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: lorenmario on 31 Jul 2014 09:57:12 AM

Title: Cognos does not consider comma in calculations! Help!
Post by: lorenmario on 31 Jul 2014 09:57:12 AM
Hello,

I have a question here, I migrated a report from version 7 to version 10.2 (with DQM), and the report in version 10 it presents some differences in values​​.

After much search, I discovered that Cognos is not considering the fractions when making the calculations. I did a simple test, I generated a new calculated item in report:

0.1 * 0.2

The result:

12

This is making the calculations using decimals are disregarded, if I have a number 375.30 Cognos considers the number 37530.

I tried to use commas, but also did not work.

Has anyone experienced this? Can you help me please?

Thank you!
Title: Re: Cognos does not consider comma in calculations! Help!
Post by: CognosPaul on 31 Jul 2014 01:55:39 PM
This is very odd. Can you confirm which content and product locales you're using?

Can you paste the SQL (native if any and Cognos) here?
Does this also happen with report expressions?
What happens if you try this calculation: (1/10)*(2/10)?
Title: Re: Cognos does not consider comma in calculations! Help!
Post by: lorenmario on 31 Jul 2014 02:28:52 PM
Hello, thanks for replying!!!

I tested here, I generated a report with two columns, the first calculating what you asked for, and the second column calculating
0.5 * 0.2
The result is this in SQL:


SELECT DISTINCT
     "Cli." "The" AS ""
     (1/100) * (2/100) The "Item1"
FROM
     "BDX". "BDTAB1" "Cli"
 
 
SELECT DISTINCT
     "Cli." "The" AS ""
     5.0 * 2.0 AS "Item1"
FROM
     "BDX". "BDTAB1" "Cli"
 
The result of the calculation you asked for is 0.002.
The result of the erroneous column is calculated 10.

I'm in Brazil, using the software in Portuguese.
Any suggestions?

Thankssss!!!
Title: Re: Cognos does not consider comma in calculations! Help!
Post by: CognosPaul on 31 Jul 2014 02:48:46 PM
Try: 0,5 / 0,2
Title: Re: Cognos does not consider comma in calculations! Help!
Post by: lorenmario on 31 Jul 2014 02:54:22 PM
I can not, because it is not an isolated case, there are many that are reporting this problem in many calculations.

I need to solve this problem because users create many calculations with fixed values​​, in this case was created an if calculation where the parameters are passed manually, and unfortunately Cognos is not identifying the commas of decimal numbers.
Title: Re: Cognos does not consider comma in calculations! Help!
Post by: CognosPaul on 31 Jul 2014 03:12:02 PM
I believe the issue can be traced to the locale you are using. All of the Portuguese locales use commas as the decimal separator.  Can you try setting the locale to English US and try again? While it's obviously not the correct solution, it will tell us if this is the problem.
Title: Re: Cognos does not consider comma in calculations! Help!
Post by: lorenmario on 01 Aug 2014 06:45:16 AM
Hi,
I've changed the configuration of Cognos to English, did this test yesterday but it did not work, the reports continue bringing incorrect results.

Does it have something to do with DQM?
Title: Re: Cognos does not consider comma in calculations! Help!
Post by: CognosPaul on 01 Aug 2014 09:48:24 AM
I haven't heard of DQM causing issues like this. What happens if you create a new framework model and test that calculation? Both in DQM mode and CQM?