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

Distinct (MDX)

Updated: 15 September 2007

Evaluates a specified set, removes duplicate tuples from the set, and returns the resulting set.


Distinct(Set_Expression)

Set_Expression

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

If the Distinct function finds duplicate tuples in the specified set, the function keeps only the first instance of the duplicate tuple while leaving the order of the set intact.

The following MDX query shows the usage of the Distinct function and the results that the function retrieves from the sample cube, AdventureWorks.

Select Distinct({[Geography].[Country].&[Australia],

[Geography].[Country].&[France],

[Geography].[Country].&[Canada],

[Geography].[Country].&[Australia],

[Geography].[Country].&[United States],

[Geography].[Country].&[United Kingdom],

[Geography].[Country].&[Canada]}) on 1,

[Measures].[Reseller Sales Amount] on 0

from [Adventure Works]

As shown in the following results, the order of the results in the set is the same as in the tuples in the query. However, duplicate tuples have been removed.

Reseller SalesAmount

Australia$1,594,335.38

France$4,607,537.94

Canada$14,377,925.60

United States$53,607,801.21

United Kingdom$4,279,008.83

Release History

15 September 2007

New content:
  • Added example.

17 July 2006

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

Community Additions

ADD
Show:
© 2014 Microsoft