MDX in Analysis Services: Create a Cube-Based Hierarchical Picklist

About the Series …

This article is a member of the series MDX in
Analysis Services
. The series is designed to provide hands-on
application of the fundamentals of MDX from the perspective of MS SQL Server
2000 Analysis Services
; our primary focus is the manipulation of
multidimensional data sources, using MDX expressions, in a variety of scenarios
designed to meet real-world business intelligence needs.

For more
information on the series, as well as the hardware / software requirements to
prepare for the tutorials we will undertake, please see the first lesson of
this series: MDX
Concepts and Navigation
.

Note: At the time of writing, Service Pack 3 updates are assumed for MSSQL Server 2000, MSSQL Server
2000 Analysis Services
, and the related Books Online and Samples.
Images are from a Windows 2003 Server environment, upon which I have also
implemented MS Office 2003, but the steps performed in the articles,
together with the views that result, will be quite similar within any
environment that supports MSSQL Server 2000 and MSSQL Server 2000
Analysis Services ("Analysis Services"
or "MSAS").
The same is generally true, except where differences are specifically noted,
when MS Office 2000 and above are used in the environment, with respect
to any MS Office components presented in a given article.

Along with MSAS, of which we have made repeated use
in the previous articles of the series, additional application considerations
apply for this article, because it introduces another Microsoft application, MSSQL
Server 2000 Reporting Services
("Reporting Services").

For those joining the series at this point because of a
desire to work with Reporting Services and its components from the
perspective of authoring or managing reports, it is assumed that, along with
Reporting Services (with Service Pack 1), MSSQL Server 2000, Visual Studio.NET
and any other appropriate support applications are accessible to / installed on
your PC, with the appropriate access rights to the associated environments, to
parallel the steps of the article. If this is the first time Reporting Services
is being accessed on your machine, you may need to consult the Reporting
Services ReadMe files, and any associated online documentation, for
installation and configuration instructions. In addition, my Reporting
Services
series at Database
Journal
offers a growing body of guidance in various aspects of using
Reporting Services, which may be of assistance.

Overview

As most of us who work in the Business Intelligence
community are aware, parameters (sometimes known as "prompts" or "parameter
prompts") are a staple of enterprise reporting, because they enable
information consumers to quickly
find the information they need from a report. These filters can be put in place "on the fly,"
and are typically enacted when the consumer types or selects a value, or a
series of values, at run time.

There are two primary types of parameters, type-in
and picklist, which can be mechanized through various means. Type-in
parameters accept directly typed user input for the value upon which the report
is based. Alternatively, the picklist presents a selection of choices to a
consumer based upon a static file, a dataset from a larger data source, or
through other means. The picklist is often the tool of choice, because of its
inherent elimination of typing errors. A well-constructed picklist makes
selection easy for the consumer, who is not often pleased with a long scrolling
process, or other cumbersome method, as the initial step in generating a
commonly requested report.

Every
enterprise level reporting system of which I am aware allows parameterization,
most in various forms. The mechanics behind parameters differ between them, at
least to some degree, but all provide the capability for prompting the consumer
for filter information at runtime. The skill and forethought with which
parameterization is built into a report is a critical matter, and deficiencies
in this arena can ruin the user experience, no matter how capable the underlying
system with which we are creating business intelligence applications.

Because
it is important to always anticipate consumer desires, I maintain an "inventory"
of successful approaches to meeting the "need for user friendliness."
I come across such nuances frequently as a BI architect and consultant. In
working with MSAS, I have found countless opportunities to "embed"
support for such instrumentality at the MSAS level.

In
this article, I will provide an option for the support of a picklist that we
leverage within the parameters of the reporting environment. After constructing
its foundation within the components of the cube, I will show the use of the
picklist in Reporting Services, primarily because it is free and readily
available to anyone with an MSSQL Server license. (A 120-day evaluation of both
Reporting Services and MSSQL Server / Analysis Services can also be downloaded
free by anyone with access to the Microsoft site, at the time of writing). It
has also been my reporting tool of choice since I began beta-testing it last
year. The concepts involved, however, extend to any enterprise reporting
package designed to report from common OLAP data sources, and even some of the
more proprietary ones, like Cognos, Business Objects, and others that provide "one-way"
connectivity to MSAS cubes. It is especially applicable in the cases of tools like
Crystal Analysis Pro, ProClarity and other advanced, yet relatively "open,"
OLAP reporting applications.

If you
can successfully designate an MSAS cube as a data source, regardless of the
reporting application you have, you can probably use the concepts we will be
discussing here. In this article, we will:

  • Create calculated
    members
    to support a hierarchical pick list for the reporting environment;

  • Explain the MDX
    that we use to create the calculated members;

  • House the calculated
    members
    in a named set for easy re-use in the report authoring
    process;

  • Create a very
    basic report in Reporting Services with our MSAS cube as a data
    source
    ;

  • Add a parameter
    to the report, based upon the structures we have created in the cube;

  • Generate the
    report with run-time parameter to verify its operation.
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.
Previous article
Next article

Get the Free Newsletter!

Subscribe to Cloud Insider for top news, trends & analysis

Latest Articles