AND (MDX)

 

Updated: March 2, 2016

Performs a logical conjunction on two numeric expressions.

  
Expression1 AND Expression2  

Parameters

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 both parameters evaluate to true; otherwise, false.

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

Expression1Expression2Return Value
truetruetrue
truefalsefalse
falsetruefalse
falsefalsefalse
-- 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 Operator Reference (MDX)

Community Additions

ADD
Show: