对两个数值表达式进行逻辑合取。
Syntax
Expression1 AND Expression2
参数
Expression1
一个有效的多维表达式(MDX)表达式,返回一个数值。
Expression2
一个有效的MDX表达式,返回一个数值。
返回值
一个布尔值,如果两个参数都为 真,则返回真;否则, 就是假的。
Remarks
AND算子在执行逻辑合取前,将这两个表达式都视为布尔值(0,0为假;否则为真)。 下表展示了 与算 符如何执行逻辑合取。
| Expression1 | Expression2 | 返回值 |
|---|---|---|
| true | true | true |
| true | false | false |
| false | true | false |
| false | false | false |
Example
-- This query returns the gross profit margin (GPM)
-- for clothing sales where the GPM is between 20% and 30%.
With Member [Measures].[LowGPM] as
IIF(
[Measures].[Gross Profit Margin] <= .3 AND
[Measures].[Gross Profit Margin] >= .2,
[Measures].[Gross Profit Margin],
null)
SELECT NON EMPTY
[Sales Territory].[Sales Territory Country].Members ON 0,
[Product].[Category].[Clothing] ON 1
FROM
[Adventure Works]
WHERE
([Measures].[LowGPM])