MDX in Analysis Services: Mastering Time: Moving Averages – Another Approach

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 / 3a 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.

Overview

In this
article, we return to the subject of the previous article in the series, Mastering
Time: Introduction to Moving Averages
, and examine another approach for
achieving "rolling
average
" aggregations. As we learned in our last article, "rolling,"
or "moving," averages
, form a common business requirement, and involve
a the aggregation of an average over a progressively moving window of time
periods. While the functions that define the "window" involve the Time
dimension in the vast majority of cases, we should be aware that we can apply
these functions to members of other dimensional levels, as well.

We
stated, in the previous session, that rolling averages are popular in the
business community because they have the effect of smoothing values that fluctuate
over time; we gave examples of useful applications of moving averages (such as
cases where seasonal variations and other volatility factors come into play for
a given measure), and then discussed some of their uses. We noted that the
assistance moving averages offer in spotting trends (especially helpful in volatile markets, but
in many other environments, as well), make moving averages a popular tool among
technical analysts, as well as a commonly used contributor to many other
technical indicators and overlays.

We broke
down the concept of a rolling average, and explained that it is generated
simply by calculating the average of the current value, together with
the specified number of previous values, typically identified by their
placement at time intersects. We noted that MDX affords multiple approaches to generating rolling
averages, and we explored one of these through a multi-step practice example.

In this
article, we will present a different approach, but will attempt to activate the
underlying concept in a similar set of procedural steps. With each step, we
will discuss our objectives, as well as the results we obtain. We will:

  • Discuss
    considerations applicable to our alternative approach, commenting upon the
    general steps of the practice example;

  • Examine the
    hypothetical business requirement from our last article, in which a group of
    information consumers have requested a particular moving average capability for
    analysis purposes;

  • Construct and
    test, within the Sample Application, the MDX required to support a rolling
    average calculated member;

  • Refer to the
    relevant section in our previous article for guidance in creating a calculated
    member in Analysis Manager, to provide a basis for verifying accuracy of
    operation, as well as for "permanent" structural rolling average
    support in the cube.
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