MDX Essentials: MDX Member Functions: “Relative” Member Functions

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 real-world needs.

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.

What We 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.

Introduction

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 exercise;
  • a brief discussion of the MDX results we obtain in each practice example;
  • 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 articles.

Let’s introduce calculated members now, and begin our examination of the “relative” member functions shortly after.

William Pearson
William Pearson
Bill has been working with computers since before becoming a "big eight" CPA, after which he carried his growing information systems knowledge into management accounting, internal auditing, and various capacities of controllership. Bill entered the world of databases and financial systems when he became a consultant for CODA-Financials, a U.K. - based software company that hired only CPA's as application consultants to implement and maintain its integrated financial database - one of the most conceptually powerful, even in his current assessment, to have emerged. At CODA Bill deployed financial databases and business intelligence systems for many global clients. Working with SQL Server, Oracle, Sybase and Informix, and focusing on MSSQL Server, Bill created Island Technologies Inc. in 1997, and has developed a large and diverse customer base over the years since. Bill's background as a CPA, Internal Auditor and Management Accountant enable him to provide value to clients as a liaison between Accounting / Finance and Information Services. Moreover, as a Certified Information Technology Professional (CITP) - a Certified Public Accountant recognized for his or her unique ability to provide business insight by leveraging knowledge of information relationships and supporting technologies - Bill offers his clients the CPA's perspective and ability to understand the complicated business implications and risks associated with technology. From this perspective, he helps them to effectively manage information while ensuring the data's reliability, security, accessibility and relevance. Bill has implemented enterprise business intelligence systems over the years for many Fortune 500 companies, focusing his practice (since the advent of MSSQL Server 2000) upon the integrated Microsoft business intelligence solution. He leverages his years of experience with other enterprise OLAP and reporting applications (Cognos, Business Objects, Crystal, and others) in regular conversions of these once-dominant applications to the Microsoft BI stack. Bill believes it is easier to teach technical skills to people with non-technical training than vice-versa, and he constantly seeks ways to graft new technology into the Accounting and Finance arenas. Bill was awarded Microsoft SQL Server MVP in 2009. Hobbies include advanced literature studies and occasional lectures, with recent concentration upon the works of William Faulkner, Henry James, Marcel Proust, James Joyce, Honoré de Balzac, and Charles Dickens. Other long-time interests have included the exploration of generative music sourced from database architecture.

Get the Free Newsletter!

Subscribe to Cloud Insider for top news, trends & analysis

Latest Articles