멤버 함수 사용Using Member Functions

이 항목은 다음에 적용됩니다.예SQL Server(2008부터)아니요Azure SQL Database아니요Azure SQL Data Warehouse 아니요병렬 데이터 웨어하우스 THIS TOPIC APPLIES TO:yesSQL Server (starting with 2008)noAzure SQL DatabasenoAzure SQL Data Warehouse noParallel Data Warehouse

멤버 함수는 멤버를 반환하는 MDX(Multidimensional Expressions) 함수입니다.A member function is an Multidimensional Expressions (MDX) function that returns a member. 멤버 함수는 튜플 함수 및 집합 함수와 마찬가지로 Analysis ServicesAnalysis Services에서 사용되는 다차원 구조를 처리하는 데 필수적입니다.Member functions, like tuple functions and set functions, are essential to negotiating the multidimensional structures found in Analysis ServicesAnalysis Services.

MDX의 많은 멤버 함수 중 가장 중요 한 것은 CurrentMember 현재 멤버는 계층 구조를 확인 하는 데 사용 되는 함수입니다.Of the many member functions in MDX, the most important is the CurrentMember function, which is used to determine the current member on a hierarchy. 다음 쿼리는와 함께 사용 하는 방법을 보여 줍니다는 부모, 상위, 및 Prevmember 함수:The following query illustrates how to use it, along with the Parent, Ancestor, and Prevmember functions:

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]

참고 항목See Also

함수 ( MDX 구문 ) Functions (MDX Syntax)
튜플 함수 사용 Using Tuple Functions
집합 함수를 사용 하 여Using Set Functions