IF

Command

The IF() command performs conditional tests within a formula. Using the IF statement, you can define a Boolean test, as well as formulas to be calculated if the test returns either a TRUE or FALSE value.

Syntax

IF( condition ) statement ; [ ...statement ; ] [ ELSEIF...statement | ELSE...statement]
ENDIF;

conditionFormula or function that returns a Boolean value of TRUE (a nonzero value) or FALSE (a zero value).
statementOperations to be performed depending on the results of the test.

Notes

Example

IF(
	@ISMBR(@DESCENDANTS(Europe))
OR	@ISMBR(@DESCENDANTS(Asia))
  )
   Taxes = "Gross Margin" * "Foreign Tax Rate";
ELSE
   Taxes = "Gross Margin" * "Domestic Tax Rate";
ENDIF;

This test checks to see if the current cell includes a member that is a descendant of either the Europe or Asia members. If it does, the formula calculates the taxes for the member based on the foreign tax rate. If the current cell does not include a member from one of those groups, then the domestic tax rate is used for the tax calculation.

The next three commands are included here for convenience. These commands can be used only with the IF command.

See Also

ELSE
ELSEIF
ENDIF


Copyright (c)1991-2000 Hyperion Solutions Corporation. All rights reserved.