멤버 함수 사용

멤버 함수는 멤버를 반환하는 MDX(다차원 식) 함수입니다. 튜플 함수 및 집합 함수와 같은 멤버 함수는 Analysis Services에 있는 다차원 구조를 협상하는 데 필수적입니다.

MDX의 많은 멤버 함수 중 가장 중요한 것은 계층에서 현재 멤버를 확인하는 데 사용되는 CurrentMember 함수입니다. 다음 쿼리는 부모, 상위 항목 및 Prevmember 함수와 함께 사용하는 방법을 보여 줍니다.

WITH

//Returns the name of the currentmember on the Calendar hierarchy

MEMBER MEASURES.[CurrentMemberDemo] AS [Date].[Calendar].CurrentMember.Name

//Returns the name of the parent of the currentmember on the Calendar hierarchy

MEMBER MEASURES.[ParentDemo] AS [Date].[Calendar].CurrentMember.Parent.Name

//Returns the name of the ancestor of the currentmember on the Calendar hierarchy at the Year level

MEMBER MEASURES.[AncestorDemo] AS ANCESTOR([Date].[Calendar].CurrentMember, [Date].[Calendar].[Calendar Year]).Name

//Returns the name of the member before the currentmember on the Calendar hierarchy

MEMBER MEASURES.[PrevMemberDemo] AS [Date].[Calendar].CurrentMember.Prevmember.Name

SELECT{MEASURES.[CurrentMemberDemo],MEASURES.[ParentDemo],MEASURES.[AncestorDemo],MEASURES.[PrevMemberDemo] } ON 0,

[Date].[Calendar].MEMBERS ON 1

FROM [Adventure Works]

참고 항목

함수(MDX 구문)
튜플 함수 사용
집합 함수 사용