IIf

Return to: Calculated Member Builder Function List

Returns one of two values determined by a logical test.

Syntax

IIf(«Logical Expression», «Value Expression1», «Value Expression2»)

Remarks

Returns «Value Expression1» if «Logical Expression» evaluates to TRUE, otherwise returns «Value Expression2».

«Value Expression1» and «Value Expression2» must evaluate to the same type, either numeric or string.

Example

To string:

IIf(IsEmpty(Measures.CurrentMember), "Yes", "No")

Returns "Yes" if Measures.CurrentMember is an empty cell, "No" otherwise.

To number:

IIf(IsEmpty(Measures.CurrentMember), 0, 1)

Returns 0 if Measures.CurrentMember is an empty cell, 1 otherwise.

(c) 1988-1998 Microsoft Corporation. All Rights Reserved.