Distinct(MDX)

지정된 집합을 계산하고 집합에서 중복 튜플을 제거하여 결과 집합을 반환합니다.

구문

Distinct(Set_Expression)

인수

  • Set_Expression
    집합을 반환하는 유효한 MDX 식입니다.

주의

Distinct 함수는 지정된 집합에서 중복 튜플을 찾을 경우 중복 튜플의 첫 번째 항목만 유지하고 집합 순서는 그대로 유지합니다.

다음 예제 쿼리에서는 Distinct 함수를 명명된 집합과 함께 사용하는 방법과 이 함수를 Count 함수와 함께 사용하여 집합에서 중복 제외 튜플 수를 찾는 방법을 보여 줍니다.

WITH SET MySet AS

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

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

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

MEMBER MEASURES.SETCOUNT AS

COUNT(MySet)

MEMBER MEASURES.SETDISTINCTCOUNT AS

COUNT(DISTINCT(MySet))

SELECT {MEASURES.SETCOUNT, MEASURES.SETDISTINCTCOUNT} ON 0,

DISTINCT(MySet) ON 1

FROM [Adventure Works]

참고 항목

참조