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

To

Do this

Retrieve the periods-to-date for any specified period

Use the PeriodsToDate function to return a set of sibling members from the same level as a given member, starting with the first sibling and ending with the given member, as constrained by a specified level of a calendar hierarchy. For example, the following query retrieves the periods-to-date over the calendar year for each of the Month members along the ROWS axis to calculate a year-to-date total for reseller sales:

WITH MEMBER [Measures].[Year to Date Reseller Sales] AS Aggregate( PeriodsToDate( [Date].[Calendar].[Calendar Year], [Date].[Calendar].CurrentMember ), ([Measures].[Reseller Sales Amount]) ) SELECT { ([Measures].[Reseller Sales Amount]), ([Measures].[Year ...

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