Set Functions: The DrillDownLevelTop() and DrillDownLevelBottom() Functions

About the Series …

This article is a member of the series, MDX Essentials.
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 for getting the most out of the member
lessons, please see Set Functions: The DRILLDOWNMEMBER() Function, where
important information is detailed regarding the applications, samples and other
components required to complete our practice exercises.


In this
article, we will continue the examination of "MDX for drilling up and
" that we began in Set Functions: The DrillDownMember() Function.
We have discussed the nature of drilling, in general, in previous
articles of our sub-series, stating that it comprises an analytical technique
through which means an information consumer can maneuver between summarized ("drilling
") and detailed ("drilling down") levels of data. We
noted that drilling up or down occurs along the lines of drilling paths
that are defined within the structure of our cubes, and which are often
specified by the cube’s dimensional hierarchies. We mentioned, too, that these
paths can be based upon alternative relationships that exist within or between

In our last article, Set Functions: The
DrillDownLevel() Function
, we introduced the "primary," level-directed
MDX drilldown function, DrillDownLevel(). We stated that it supports the
capability of Analysis Services to meet the common need for drilldown
from a given Set to members within the next lower level, or to a level
which we can specify using an optional Level Expression or,
alternatively, an optional Index. Through
our overview, discussion, examination of the syntax, and hands-on practice
session with the function, we discovered how DrillDownLevel() drills
down the members of a set to a lower level, and additionally offers us the
flexibility to specify which level below a given member in the set, as
well as providing a means whereby we can specify an index to further
control the behavior of the DrillDownLevel() function in targeting a
specific level. We focused on several ways to
leverage the function in our queries and, ultimately, in reporting and other
end applications, to meet the business needs of organizational information

In this article we will
examine two specialized set functions that are based upon the principles
underlying DrillDownLevel(). DrillDownLevelTop() and DrillDownLevelBottom()
are both similar to the DrillDownLevel() function. However, instead
of behaving like DrillDownLevel(), in its inclusion of all children
for each member within the specified Level Expression, DrillDownLevelTop()
returns the topmost (specified) number of child members for each
member, while the DrillDownLevelBottom() function returns the bottommost
(specified) number of child members for each member.

the DrillDownLevel() function, both DrillDownLevelTop()
and DrillDownLevelBottom() can be used in conjunction with tuples
within the sets, as well as members. In a manner similar to DrillDownMember(),
among numerous other functions that we have examined in the MDX
series, DrillDownLevelTop()
and DrillDownLevelBottom() can each be useful in a host
of different reporting and analysis applications. Like other "navigational"
functions of their feather (virtually all of which we examine in other articles
of this and other series’) each of these two drilldown functions allows us to exercise a great deal
of presentation sleight of hand, in working with MDX in Analysis Services,
as well as within Reporting Services and various other reporting
applications that can access an Analysis Services cube.

The DrillDownLevelTop()
and DrillDownLevelBottom() functions can be leveraged, within
and among the various "layers" of the Microsoft integrated Business
Intelligence solution, to support sophisticated presentations and features. We
will introduce the functions, commenting upon the operation of each and
touching upon examples of effects that we can employ each to deliver. As a
part of our discussion, we will:

  • Examine the syntax surrounding the functions;

  • Undertake illustrative examples of the uses of the functions in
    practice exercises;

  • Briefly discuss the results datasets we obtain in the practice
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.

Latest Articles