About the Series ...
This is the eighth article of the
series, MDX Essentials. The primary focus of this series is an
introduction to MDX. The series is designed to provide hands-on application of
the fundamentals of the Multidimensional Expressions (MDX) language,
with each tutorial progressively adding features designed to meet specific
For more information about the series in general, as well as
the software and systems requirements needed for getting the most out of the
lessons included, please see the first article, MDX at
First Glance: Introduction to MDX Essentials.
Note: Service Pack 3 updates are assumed for MSSQL
Server 2000, MSSQL Server 2000 Analysis Services, and the related Books
Online and Samples.
Accomplished in our Last Article
In the seventh article of the series, MDX
Member Functions: The Cousin () Function, we explored the Cousin()
function, concluding a set of articles where we examined what I call the "family"
set of functions. We discussed the Cousin() function in detail, illustrated
the syntax that is appropriate for its effective use, and then tested our
understanding of how to leverage this remaining "family" function by
undertaking relevant practice exercises. Finally, for each practice exercise,
we commented on the results we obtained using the Cousin() function, and
discussed some of the limitations that are inherent in its use.
In this lesson, we will begin an overview of additional "relative"
member functions, expanding upon our earlier exposure to the powerful member functions,
and then extending our exploration to the .CurrentMember, .PrevMember
and .NextMember functions. As a part of our examination of these
functions, we will introduce calculated members briefly as an avenue to
demonstrating the use of the "relative" member functions. We will
take up calculated members in far more detail as the series progresses, but,
for now, we will preview their characteristics and dive right into using them.
In the last group of
articles, we have worked with members, which we now know to be generally defined
as any attribute that belongs to a dimension. In the Time dimensions we
have examined in the last three articles specifically, for example, as a basis
for our examination of several "family" functions, we recall that Year
and Quarter existed as levels. We could, in our example, say that 1998
and Q3 are, therefore, members of the Time dimension. We
used our examples to demonstrate the workings and characteristics of member
functions, which, as we discovered, return another dimension member or a zero
(an example of a scenario with a zero result would be the use of the .Parent
function with a top level member -- who is parentless, as was the case in one of
our examples). The "family" member functions allowed us to travel the
dimensional hierarchy, as we witnessed in numerous examples, based upon the
relative position of a given "family" member to the member matching
the hierarchical relationship specified in the function.
We will next examine
other, far more common "relative" member functions. Our lesson will include an introduction to the .CurrentMember, .PrevMember
and .NextMember functions, with:
- an examination of the syntax surrounding the use of each;
- an illustrative example of the use of each in a practice
- a brief discussion of the MDX results we obtain in each
- a preliminary overview of calculated members, primarily to
bring them "into the fold" of our growing MDX knowledgebase, and
to initially make them available as a means of exploring the relative
member functions of this lesson, as well as many MDX components in future
Let's introduce calculated members now, and begin our
examination of the "relative" member functions shortly after.