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

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

writing an expression

Started by katdbc, 23 Sep 2010 09:51:09 AM

Previous topic - Next topic

katdbc

i am getting an error when i write a calculation like thi

IF (([Units].[Contract Code Dim].[Physical Damage Insurance] >0 )  or ([Units].[Contract Fact (Units)].[Non-DTF Physycial Damage Insurance] >0)) THEN ('Y') else NULL

what is wrong or is there better way to do it!!!!!

technomorph

Try:

IF ([Units].[Contract Code Dim].[Physical Damage Insurance] > 0 Or [Units].[Contract Fact (Units)].[Non-DTF Physycial Damage Insurance] > 0) THEN ('Y')
ELSE
( NULL )

katdbc

I tried that and it is throwing me an error!!!!!
I donno y !!!!!

error is
a genral exception has occured during the operation"prepare",
the data types of the operands ">" are not compatible

and many more errors!!!!

Lynn

Are those columns numbers? It seems you could get that error if you are doing > operation with a non-numeric value.

technomorph

First try the following. I'm not entirely sure it will work with string data-types, but worth a go:

IF ([Units].[Contract Code Dim].[Physical Damage Insurance] > '0' Or [Units].[Contract Fact (Units)].[Non-DTF Physycial Damage Insurance] > '0') THEN ('Y')
ELSE
( NULL )


Otherwise, check the data-types of the data items:

Right mouse click the data item in the Insertable Objects pane > select Properties > Data Type

Then make sure you're comparing like data-types in the If Statement. You may need to use a Cast function:

cast ( exp, datatype_specification )

katdbc

awesum pppl!!!!!!

i reali had the datatype problem,i took the wrong column which was char!!!!!!!

thank you so much!!!!!!!

btw im a noob in cognos  and i have just started!
plz bare me