지정된 집합을 평가하고, 그 집합에서 중복된 튜플을 제거한 후 결과된 집합을 반환합니다.
Syntax
Distinct(Set_Expression)
Arguments
Set_Expression
집합을 반환하는 유효한 다차원 표현식(MDX) 표현식입니다.
Remarks
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]