O'Reilly logo

Microsoft® SQL Server® 2008 MDX Step by Step by C Ryan Clay Bryan C Smith and Hitachi Consulting

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5 Quick Reference

To

Do this

Construct a calculated member within a query

Add a MEMBER sub-statement to the SELECT statement’s WITH clause. Employ constants, tuples, operators, and functions in an expression to determine the calculated member’s value. For example, the following statement assembles a calculated member named Bikes & Accessories:

WITH
MEMBER [Product].[Category].[All Products].[Bikes & Accessories] AS
    ([Product].[Category].[Bikes]) +
        ([Product].[Category].[Accessories])
SELECT
    {
        ([Date].[Calendar Year].[CY 2003]),
        ([Date].[Calendar Year].[CY 2004])
        } ON COLUMNS,
    {
        ([Product].[Category].[Accessories]) ,
        ([Product].[Category].[Bikes]),
        ([Product].[Category].[Bikes & Accessories])
        } ON ROWS
FROM [Step-by-Step]

Return all members ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required