The ELSE command designates a conditional action to be performed in an IF statement. All actions placed after the ELSE in an IF statement are performed only if the test in the IF statement generates a value of FALSE.
Syntax
ELSE statement ; [ ...statement; ] ENDIF;
Parameter | Description |
---|---|
statement | Those operations that are to be performed in the event that the IF test including the ELSE command produces a FALSE, or 0, result. |
Notes
The ELSE command can only be used in conjunction with an IF command.
You do not need to end ELSE statements with ENDIF statements. Only IF statements should be ended with ENDIF statements.
Example
The following example is based on the Sample Basic database. This calculation script tests to see if the current member in the Market dimension is a descendant of West or East. If so, Essbase multiplies the value for Marketing by 1.5. If the current member is not a descendant of West or East, Essbase multiplies the value for Marketing by 1.1.
Marketing (IF (@ISMBR(@DESCENDANTS(West)) OR (@ISMBR(@DESCENDANTS(East))) Marketing = Marketing * 1.5; ELSE Marketing = Marketing * 1.1; ENDIF;
See Also