MSSQL Server Reporting Services: Mastering OLAP Reporting: Extending Conditional Formatting: SWITCH and Drilldown Defaults

About the Series …

article is a member of the series MSSQL Server Reporting Services.
The series is designed to introduce MSSQL Server Reporting Services ("Reporting
Services"), with the objective of presenting an overview of its features,
together with many tips and techniques for real-world use. For more
information on the series, as well as the hardware / software requirements
to prepare for the exercises
we will undertake, please see my initial Database Journal article, A New
Paradigm for Enterprise Reporting

As I
have stated since the charter article of the series, published about the time
Reporting Services was first publicly released, my conviction is that Reporting
Services will commoditize business intelligence, particularly in its role as a
component in an integrated Microsoft BI solution. Having been impressed from
my first exposure to this exciting application, when it was in early beta, my
certainty in its destiny grows stronger by the day, as I convert formerly
dominant enterprise Business Intelligence systems, such as Cognos, Business
Objects, Crystal, and others, to the Reporting Services architecture. I receive
constant requests to conduct strategy sessions about these conversions with
large organizations in a diverse range of industries – the interest grows daily
as awareness of the solution becomes pervasive. Indeed, the five- to six-plus
figures that many can shave from their annual IT budgets represent a compelling
sweetener to examining this incredible toolset.

assumptions underlying the series are that you have correctly installed
Reporting Services, including current service packs, along with the
applications upon which Reporting Services relies, and that you have access and
the other rights / privileges required to complete the steps we undertake in my
articles. For details on the specifics of the adjustments necessary to quickly
allow full freedom to complete the exercises in this and subsequent articles,
as well as important assumptions regarding rights and privileges in general,
please see earlier articles in the series, as well as the Reporting Services Books

About the Mastering OLAP Reporting Articles…

As I
have noted in many articles and presentations, one of the first things that
becomes clear to "early adopters" of Reporting Services is that the "knowledgebase"
for OLAP reporting with this tool is, to say the least, sparse. (I
recently heard an internal "reporting guru" say, during a BI strategy
session with a major soft drink manufacturer in Atlanta, that "we didn’t
evaluate Reporting Services because it doesn’t do cubes …") As most of us
are aware, minimal, if any, attention is given to using Analysis Services cubes
as data sources for reports in the handful of books that have been published on
Reporting Services to date. All are written from the perspective of relational
reporting, as if with existing popular tools for that purpose. One Reporting
Services book discusses OLAP reporting with Reporting Services, and then
performs illustrative exercises with Office Web Components (OWC), instead. Another
depicts an MDX snippet at the end of the book, as if as an afterthought. All of
the early books focus entirely on relational reporting, and most make heavy
use, typically enough, of the Books Online and other scraps of documentation
that we already have anyway. (I could go on, but my overall opinion of the
technical book industry is already well known.)

As I
stated in my article, Mastering
OLAP Reporting: Cascading Prompts
, the
purpose of the Mastering OLAP Reporting subset of my Reporting
series is
to focus on techniques for using Reporting Services for OLAP reporting. In many cases, which I try to
outline in my articles at appropriate junctures, the functionality of the
reporting solutions of well-established, but expensive, solutions, such as Cognos
, can be met in most respects by Reporting Services – at a tiny
fraction of the cost. The vacuum of documentation in this arena, to date,
represents a serious "undersell" of Reporting Services from an OLAP
reporting perspective. I hope to contribute to making this arena more
accessible to everyone, and to share my implementation and conversion experiences
as the series evolves. In the meantime, rest assured that the OLAP potential
in Reporting Services will be yet another reason that the application "commoditizes"
Business Intelligence.

more information about the Mastering OLAP Reporting articles, see
the section entitled "About the Mastering OLAP Reporting
in my
article Ad Hoc
TopCount and BottomCount Parameters


In an
earlier article, Black
Belt Components: Ad Hoc Conditional Formatting for OLAP Reports
, as well as within other articles
of the Reporting Services series, we have discussed conditional
formatting in general, and have set out to examine approaches to meeting
specific business requirements based upon conditions. While the Immediate
or IIF() – function is a popular means of mechanizing
conditional formatting, we will introduce a somewhat more powerful function in
this session, the SWITCH() function. We will perform a practice
exercise where we leverage SWITCH() to achieve a desired conditional
result that is a part of a business requirement of a group of hypothetical
information consumers.

We will
use SWITCH() to enact conditional formatting in a couple of different
ways. First, we will use it to drive formatting of a value to meet
requirements that are based upon the magnitude of the value itself. As a part
of our practice with SWITCH() to achieve our ends, we will delve into a
popular formatting convention for negative (and other "outlier")
numbers. Next, we will extend our examination of SWITCH() to include
its use to enforce the default drilldown states of members of a given group
level within a sample matrix report, to achieve another presentation objective.

all major OLAP reporting solutions on the market provide for capabilities to
meet simple conditional formatting needs. Many, including Cognos
, make selection and application of these presentation attributes
easy for even novice users. Our focus in this article, as it is within many of
the articles of this series, will be to demonstrate that these features, and
far more, are easily replicated within Reporting Services.

this article we will:

  • Discuss presentation
    nuances to meet a common business need within the reporting environment, the
    requirement to present one of multiple possible formats (or to "conditionally
    "), based upon the value of a given report measure;

  • Discuss briefly
    the SWITCH() function, and how it can be leveraged to meet the
    presentation needs of a hypothetical group of information consumers to meet a conditional

  • Prepare for
    our practice session by creating a project within Reporting Services,
    and by creating a "clone" report (based upon an existing sample OLAP
    report to save time), within which we will perform our exercises;

  • Present, as a
    part of our examination of conditional formatting, a technique for formatting
    negative values
    as enclosed within parentheses, using red characters to
    draw attention;

  • Present an
    approach for conditionally controlling the presentation of the default
    drilldown state
    of a given line item within a matrix report region;

  • Preview the
    report in Report Designer, to verify the operation of the calculations
    that form the scope of our practice exercise.
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