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!!!!!
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 )
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!!!!
Are those columns numbers? It seems you could get that error if you are doing > operation with a non-numeric value.
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 )
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