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]