OR

OR (MDX)

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

Performs a logical disjunction on two numeric expressions.

Expression1 OR Expression2 

Expression1

A valid Multidimensional Expressions (MDX) expression that returns a numeric value.

Expression2

A valid MDX expression that returns a numeric value.

A Boolean value that returns true if either or both arguments evaluate to true; otherwise, false.

The OR operator treats both arguments as Boolean values (zero, 0, as false; otherwise, true) before the operator performs the logical disjunction. The following table illustrates how the OR operator performs the logical disjunction.

Expression1

Expression2

Return Value

true

true

true

true

false

true

false

true

true

false

false

false

Example

The following query contains a calculated measure that returns the string “MARRIED OR MALE” if the current member on the Gender hierarchy of the Customer dimension is Male or the current member on the Marital Status hierarchy of the Customer dimension is Married; otherwise it returns the string “UNMARRIED OR FEMALE”.

WITH
MEMBER MEASURES.ORDEMO AS
IIF(
([Customer].[Gender].CURRENTMEMBER IS [Customer].[Gender].&[M])
OR
([Customer].[Marital Status].CURRENTMEMBER IS [Customer].[Marital Status].&[M]),
"MARRIED OR MALE",
"UNMARRIED OR FEMALE")
SELECT [Customer].[Gender].[Gender].MEMBERS ON 0,
[Customer].[Marital Status].[Marital Status].MEMBERS ON 1
FROM [Adventure Works]
WHERE(MEASURES.ORDEMO)

Community Additions

ADD
Show:
© 2016 Microsoft