Using Actuate BIRT Viewers : Functions and operators : IF( )
 
IF( )
Returns one value if a specified condition evaluates to True, or another value if the condition evaluates to False.
Syntax
IF(condition, doIfTrue, doIfFalse)
Arguments
condition
The condition to test.
doIfTrue
The value to return if condition evaluates to True.
doIfFalse
The value to return if condition evaluates to False.
Returns
Returns the doIfTrue value if condition is True or the doIfFalse value if condition is False.
Example
The following example calculates and displays different discount amounts based on the value in the Total data field. If the Total value is greater than 5000, the discount is 15%. Otherwise, the discount is 10%.
IF([Total]>5000, [Total]*15%, [Total]*10%)
The following example uses IF( ) in conjunction with the BETWEEN( ) and ADD_DAY( ) functions to calculate a shipment date. If an orderDate value is in December 2007 (between 12/1/07 and 12/31/07), add 5 days to the orderDate value. If a orderDate value is in a month other than December, add 3 days to the orderDate value.
IF((BETWEEN([orderDate], "12/1/07 12:00 AM", "12/31/07 12:00 AM")), (ADD_DAY([orderDate], 5)), (ADD_DAY([orderDate], 3)))
The following example checks each value in the Office data field. If the value is Boston, San Francisco, or NYC, the computed column displays U.S. If the value is something other than Boston, San Francisco, or NYC, the computed column displays Europe and Asia Pacific.
IF([Office]="Boston" OR [Office]="San Francisco" OR [Office]="NYC", "U.S.", "Europe and Asia Pacific")