Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help - data type error in IF formula

Status
Not open for further replies.

encwgwg

Technical User
Mar 24, 2010
3
0
0
CA
The following is the formula I wrote for Business Objects report:
=If <Variable1> = 0 Then "NA" Else <Variable 2)/<Variable 3>

It returns error message "Incorrect Data Type DMB0003".

It looks like the formula syntax doesn't like the character string "NA" to be used together with numeric result of <Variable 2>/<Variable 3>.

How should I handle this?

Thanks a lot.
Kevin. W.
 
The "NA" sets the output type to string. To still use it you would need to change the second part to a string or the first part to a number.

=If <Variable1> = 0 Then "NA" Else <Variable 2)/<Variable 3>
becomes either {stringver}
=If <Variable1> = 0 Then 0 Else <Variable 2)/<Variable 3>
//if you use this case I would suppress 0
or
{numberver}
=If <Variable1> = 0 Then "NA" Else ToText((<Variable 2)/<Variable 3>),0,"")

Scotto the Unwise
and yes I do know this one from my own burned fingers
 
Thanks guys,
my formula is for Business Objects Desktop Intelligence.
Thanks.
Kevin.W.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top