If you are unable to create a new account, please email support@bspsoftware.com

 

ERROR In an Aritmatic Expression in Framework Manager (Relational)

Started by gosoccer, 12 Feb 2017 07:14:39 AM

Previous topic - Next topic

gosoccer

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.

bus_pass_man

I don't see the attachment so I don't know what the error message is.  Could you attach it please.


gosoccer


bus_pass_man

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] )



gosoccer

Thank you for your time. I'll review the notes and see what needs to be changed in my FM Model. :) :)