Export (0) Print
Expand All
Avg
IIf
Lag
Max
Min
Mtd
Qtd
Sum
Var
Wtd
Ytd
Expand Minimize

Exists (MDX)

Updated: 12 December 2006

Returns the set of tuples of the first set specified that exist with one or more tuples of the second set specified. This function performs manually what auto exists performs automatically. For more information about auto exists, see Key Concepts in MDX (MDX).

If the optional <Measure Group Name> is provided, the function returns tuples that exist with one or more tuples from the second set and those tuples have non NULL data in the specified measure group.


Exists( Set_Expression1 , Set_Expression2 [, MeasureGroupName] )

Set_Expression1

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

Set_Expression2

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

MeasureGroupName

A valid string expression specifying a measure group name.

Measure group rows with measures containing null values contribute to Exists.

Customers who live in California:

Exists(Customers.byName.members, {Customers.State.CA})

Customers who live in California with sales:

Exists(Customers.byName.members, {Customers.State.CA}, 'Sales')

Customers with sales:

Exists(Customers.byName.members, , 'Sales')

Customers with Xbox sales:

Exists(Customers.byName.members, {Product.[Product Name].[Xbox]} , 'Sales')

Customers with sales in the states of Washington, California, or England (where the value for England is improperly placed within the United States):

SELECT 
 Exists(
   [Customer].[Customer Geography].[State-Province].Members * 
    [Sales Channel].[Sales Channel].&[Internet]
   ,
   {[Customer].[Customer Geography].[State-Province].&[WA]&[US], 
    [Customer].[Customer Geography].[State-Province].&[CA]&[US],
    [Customer].[Customer Geography].[State-Province].&[ENG]&[US]}
  )
ON 0
FROM [Adventure Works]
WHERE [Measures].[Internet Sales Amount]

Release History

12 December 2006

Changed content:
  • Added another example.

17 July 2006

Changed content:
  • Updated syntax and arguments to improve clarity.
  • Added updated examples.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft