title | description | author | ms.author | ms.reviewer | ms.date | ms.service | ms.subservice | ms.topic | ms.custom |
---|---|---|---|---|---|---|---|---|---|
AND (MDX) |
AND (MDX) |
kfollis |
kfollis |
kfollis |
02/17/2022 |
sql |
analysis-services |
reference |
mdx |
Performs a logical conjunction on two numeric expressions.
Expression1 AND 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 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.
Expression1 | Expression2 | Return Value |
---|---|---|
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])