COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: dougp on 19 Nov 2020 03:31:27 PM

Title: modulus function in DQM only allows integers
Post by: dougp on 19 Nov 2020 03:31:27 PM
I have an expression...
mod([a], [b])
...that has been working in CQM for years.  Now that I am trying to convert to DQM, I am having a problem.

[a] is a decimal.

I see in the docs that mod() only accepts integers.

Quotemod ( integer_expression1, integer_expression2 )
Returns the remainder (modulus) of "integer_expression1" divided by "integer_expression2". "Integer_expression2" must not be zero or an exception condition is raised.

But in SQL Server, MySQL, and PostgreSQL...
select 100.202 % 3.01
...and in Oracle...
select mod(100.202, 3.01) from dual;
...returns 0.872.

Here is the error I'm seeing from Cognos:
QuoteXQE-GEN-0005 Found an internal error:
com.cognos.xqe.runtree.relational.vectorization.expressions.generated.XVectorDecimalColumnModLongScalar

Is this real?  Does DQM arbitrarily deny use of decimals with mod()?