Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Except
Avg
IIf
Lag
Max
Min
Mtd
Qtd
Sum
Var
Wtd
Ytd
Collapse the table of content
Expand the table of content

Except (MDX)

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

Evaluates two sets and removes those tuples in the first set that also exist in the second set, optionally retaining duplicates.

Except(Set_Expression1, Set_Expression2 [, ALL ] )

Set_Expression1

A valid Multidimensional Expressions (MDX) expression that returns a set.

Set_Expression2

A valid Multidimensional Expressions (MDX) expression that returns a set.

If ALL is specified, the function retains duplicates found in the first set; duplicates found in the second set will still be removed. The members are returned in the order they appear in the first set.

The following example demonstrates the use of this function.

   //This query shows the quantity of orders for all products,
   //with the exception of Components, which are not
   //sold.
SELECT 
   [Date].[Month of Year].Children  ON COLUMNS,
   Except
      ([Product].[Product Categories].[All].Children ,
         {[Product].[Product Categories].[Components]}
      ) ON ROWS
FROM
   [Adventure Works]
WHERE
   ([Measures].[Order Quantity])

Community Additions

ADD
Show:
© 2015 Microsoft