Share via


AND (MDX)

在兩個數值運算式上執行邏輯結合。

語法

  
Expression1 AND Expression2  

參數

Expression1
傳回數值的有效多維度運算式 (MDX) 運算式。

Expression2
傳回數值的有效 MDX 運算式。

傳回值

布林值,如果兩個參數都評估為 true,則傳回 true ;否則為 false

備註

AND 運算子會將 這兩個運算式視為布林值(零、0、 false ,否則為 true ),然後運算子會執行邏輯結合。 下表說明 AND 運算子如何 執行邏輯結合。

Expression1 Expression2 傳回值
true true true
true false false
false true false
false false false

範例

-- 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])  

另請參閱

MDX 運算子參考 (MDX)