Crystal Reports for Eclipse Designer Guide

IIF (expression, truePart, falsePart)

Description
IIF returns one of two parts, depending on the evaluation of the expression.
Arguments
  • expression is a Boolean expression.
  • truePart is the value returned if expression is True. It can be any simple type (Number, Currency, String, Boolean, Date, Time or DateTime) or range type (Number Range, Currency Range, String Range, Date Range, Time Range or DateTime Range), but it may not be an array.
  • falsePart is the value returned if expression is False. It must be of the same type as truePart.
  • Returns
    truePart if expression is True and falsePart if expression is False. The type of the returned value is the same as the type of truePart and falsePart.
    Action
    IIF returns one of two parts, depending on the evaluation of the expression.
    Examples
    IIF ({Orders.Order Amount} > 10000, "large order", "standard order")
    Returns the String value "large order" if {Orders.Order Amount} is more than $10,000 and the String value "standard order" otherwise.
    You can insert a formula field that represents the order amount if the payment has been made already, and is 0 otherwise:
    IIF ({Orders.Payment Received}, {Orders.Order Amount}, 0)
    Comments
    Every argument of the IIF function is evaluated before the result is returned. Thus, you should watch out for undesirable side effects when using IIF. For example, if falsePart results in division by zero, an error will occur, even if expression is True and so truePart is returned.



    SAP BusinessObjects
    http://www.sap.com/sapbusinessobjects/
    Support services
    http://service.sap.com/bosap-support/
    Product Documentation on the Web
    http://help.sap.com/