OR(MDX)

对两个数值表达式进行逻辑析取。

Syntax

  
Expression1 OR Expression2   

参数

Expression1
一个有效的多维表达式(MDX)表达式,返回一个数值。

Expression2
一个有效的MDX表达式,返回一个数值。

返回值

一个布尔值,如果其中一个或两个参数都值为,则返回;否则,就是假的。

Remarks

OR算符在执行逻辑析取前,将两个参数分别视为布尔值(0、0为;否则为)。 下表展示了 OR 算符如何执行逻辑析取。

Expression1 Expression2 返回值
true true true
true false true
false true true
false false false

示例

以下查询包含一个计算过的度量,如果当前客户维度性别层级成员是男性,或当前婚姻状态层级成员已婚,则返回字符串“MARRIED OR MALE”;否则返回字符串“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)