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 8 Quick Reference

To

Do this

Return a member’s parent member

Use the Parent function. For example, the following query uses the Parent function to identify the parent of the current member of the Product Categories hierarchy to calculate a percent-of-parent value:

WITH
MEMBER [Measures].[Percent of Parent] AS
  ([Measures].[Reseller Sales Amount])/
    (
      [Product].[Product Categories].CurrentMember.Parent,
      [Measures].[Reseller Sales Amount]
      )
    ,FORMAT="Percent"
SELECT
  {
    ([Measures].[Reseller Sales Amount]),
    ([Measures].[Percent of Parent])
    } ON COLUMNS,
  {[Product].[Product Categories].Members} ON ROWS
FROM [Step-by-Step]

Return a set of the member’s child members

Use the Children function. For example, the following query uses the Children function ...

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