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 lessons
included, please see my first article, MDX at First Glance: Introduction to MDX Essentials.
Note: Current updates are assumed for MSSQL
Server, MSSQL Server Analysis Services, and the related Books
Online and Samples.
In this lesson, we will examine another intrinsic member
property, MEMBER_VALUE. As many of us are aware, and as we
have confirmed in various other articles within this
series, the intrinsic member
properties supported by SQL Server 2005 Analysis Services are of two
types: context sensitive member properties and non-context sensitive member
properties. MEMBER_VALUE belongs to the second group of properties.
As a general group, intrinsic member properties provide
additional information that can be used by applications to enhance the ultimate
user experience. Support for the non-context sensitive member properties is
the same for all members, regardless of individual context.
purpose of the MEMBER_VALUE property is to support the return of a value
for the member with which it is associated. MEMBER_VALUE can be useful in a host of different applications. Moreover, as I have noted to be the case
for other functions and properties within the MDX Essentials series,
MEMBER_VALUE 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 MEMBER_VALUE property can be leveraged in
activities that range from generating simple lists to supporting sophisticated
presentations. It is a particularly effective tool when we need to provide parameter
picklist support and the like, as we shall see. We shall introduce the
function, commenting upon its operation and touching upon examples of effects
that we can employ it to deliver. As a part of our discussion, we shall:
Examine the syntax surrounding the function;
Undertake illustrative examples of the uses of the function in
Briefly discuss the results datasets we obtain in the practice
The MEMBER_VALUE Property
According to the Analysis Services
Books Online, the MEMBER_VALUE property specifies the value of the
member in the original type. The MEMBER_VALUE property is set within the ValueColumn
element of the Source properties group for a given dimension
attribute, as we shall see.
As we shall see in the initial Preparation
steps of our Practice session below, the ValueColumn property
allows us to specify the column within the underlying data source from which Analysis
Services derives the value of the attribute. Within this
setting, we may find either the None or the New option (a
third option, representing a preselected column, will exist if a column has
already been selected not the case in our current example, but possibly
As we noted in Dimension Attributes: Introduction and Overview, Part
V, if we have specified a value in the NameColumn
property, then the same value is used as the default in ValueColumn.
If we did not specify a value in the NameColumn property, and the KeyColumns
collection of the attribute contains a single KeyColumn element
representing a key column with a string data type, the same
values are used as default values for the ValueColumn element.
MEMBER_VALUE has many applications, including the rather obvious
uses with Analysis Services members that are included in the definition, as
well as its pairing with other MDX functions to leverage its power even
further. For example, as we have seen is the case with the .Name
function (among many other functions), in earlier articles of this series, MEMBER_VALUE
can also be synergistically
combined with the .CurrentMember
function; we will see an example of this specific combination within the
practice exercises below.
We will examine the syntax involved in
leveraging the MEMBER_VALUE property
after our customary overview in the Discussion section that follows.
After that, we will conduct practice examples within a couple of scenarios,
constructed to support hypothetical business needs that illustrate uses for the
property. This will afford us an opportunity to explore some of the
presentation options that MEMBER_VALUE can
offer the knowledgeable user. Hands-on practice with MEMBER_VALUE, where we will create expressions that leverage the function, will
help us to activate what we learn in the Discussion and Syntax
sections that follow.
To restate our initial explanation of its operation, the MEMBER_VALUE
property, when acting upon a member, returns the assigned value of
the object to which it is appended with the period (.) delimiter. MEMBER_VALUE
can be used for a great deal more than the support of simple lists of unique
object names, as we have intimated. When we couple it with other functions, we
can leverage MEMBER_VALUE to deliver a wide range of analysis and
reporting utility. As in so many cases with the Microsoft integrated business
intelligence solution, consisting of MSSQL Server, Analysis Services
and Reporting Services, this function, residing within the Analysis
Services layer, can be extended to support capabilities and attributes in
the Reporting Services layer. Knowing where to put the intelligence
among the various layers is critical to optimization, in many cases. For more
of my observations on this subject, see Multi-Layered
Business Intelligence Solutions ... Require Multi-Layered Architects.
The MEMBER_VALUE property returns, as we have noted, the
value contained within the column of the underlying data source from which Analysis
Services derives the value of the attribute, and can be used
for querying and display, among other, purposes. Lets look at some syntax
illustrations to further clarify the operation of MEMBER_VALUE.
Syntactically, anytime we
employ the MEMBER_VALUE property to return the associated value,
the member for which we seek to return the value is specified to
the left of MEMBER_VALUE. The property takes the object to which
it is appended as its argument, and returns, within its original data type, the
value of the object specified. The general syntax is shown in the
In short, putting MEMBER_VALUE to
work couldnt be easier. When specifying the property to return the value
of a member or members, we simply append it to the right of the member(s)
As is typically the case with
MDX functions, operators and properties, the MEMBER_VALUE property can
often be best leveraged by combining it with other functions, operators or
properties, particularly relative functions, to generate lists of names, and
so forth, as we shall see in short order.
We will practice some uses of the MEMBER_VALUE property
in the section that follows.