COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Framework Manager => Topic started by: gosoccer on 12 Feb 2017 07:14:39 AM

Title: ERROR In an Aritmatic Expression in Framework Manager (Relational)
Post by: gosoccer on 12 Feb 2017 07:14:39 AM
Hi, Good Morning,

I'm getting error for the following expression in the Calculation within a Subject Query.
If ([Physical View].[TYPE] ='1' and [Physical View].[K_CD] in ('1','8') and [Physical View].[H_CD] = '1') THEN
([Physical View].[TOT_NEW_CAR] + [Physical View].[TOT_NEW_CAR_MONTH]/[Physical View].[TOT_CAR_COUNT] )
else
(0)

ERROR is attached.

Please help!! Thanks in advance for your time.
Title: Re: ERROR In an Aritmatic Expression in Framework Manager (Relational)
Post by: bus_pass_man on 12 Feb 2017 10:30:26 AM
I don't see the attachment so I don't know what the error message is.  Could you attach it please.

Title: Re: ERROR In an Aritmatic Expression in Framework Manager (Relational)
Post by: gosoccer on 12 Feb 2017 05:47:39 PM
Sorry about that.
Here it is,
Thanks so much.  :)
Title: Re: ERROR In an Aritmatic Expression in Framework Manager (Relational)
Post by: bus_pass_man on 13 Feb 2017 05:56:53 AM
That error is coming from DB2.   It looks like it thinks that one or more of these query items are not numeric data types.  Are they all numeric?  Were any cast into that type? 
([Physical View].[TOT_NEW_CAR] + [Physical View].[TOT_NEW_CAR_MONTH]/[Physical View].[TOT_CAR_COUNT] )

http://www-01.ibm.com/support/docview.wss?uid=swg21448700
https://www.ibm.com/support/knowledgecenter/SSEPGG_11.1.0/com.ibm.db2.luw.messages.sql.doc/doc/msql00420n.html


Just as an aside, you might want to make the order of operations in that expression explicit by putting brackets around whichever you want to be executed first. Other wise you'll be dependent on how the database and the Cognos query engine decide what to do.

([Physical View].[TOT_NEW_CAR] + [Physical View].[TOT_NEW_CAR_MONTH] )/[Physical View].[TOT_CAR_COUNT]
or
[Physical View].[TOT_NEW_CAR] + ( [Physical View].[TOT_NEW_CAR_MONTH]/[Physical View].[TOT_CAR_COUNT] )


Title: Re: ERROR In an Aritmatic Expression in Framework Manager (Relational)
Post by: gosoccer on 13 Feb 2017 07:47:32 AM
Thank you for your time. I'll review the notes and see what needs to be changed in my FM Model. :) :)