Notatka
Dostęp do tej strony wymaga autoryzacji. Może spróbować zalogować się lub zmienić katalogi.
Dostęp do tej strony wymaga autoryzacji. Możesz spróbować zmienić katalogi.
Funkcja członkowa to funkcja wyrażeń wielowymiarowych (MDX), która zwraca element. Funkcje członkowskie, takie jak funkcje krotkowe i zbiorowe, są niezbędne do negocjowania wielowymiarowych struktur występujących w usługach analitycznych.
Spośród wielu funkcji członków w MDX najważniejsza jest funkcja CurrentMember , która służy do określenia aktualnego członka w hierarchii. Poniższe zapytanie ilustruje, jak go używać, wraz z funkcjami Rodzic,Przodek i Poprzednik :
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]