TechNet
Expand All
Avg
IIf
Lag
Max
Min
Mtd
Qtd
Sum
Var
Wtd
Ytd
Collapse the table of content
Expand the table of content
Expand Minimize
The document is archived and information here might be outdated

Ytd (MDX)

Updated: 17 July 2006

Returns 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 the Year level in the Time dimension.


Ytd( [ Member_Expression ] )

Member_Expression

A valid Multidimensional Expressions (MDX) expression that returns a member.

If a member expression is not specified, the default is the current member of the dimension of type Time (Time.CurrentMember).

The Ytd function is a shortcut function for the PeriodsToDate function where the level is set Year. That is, Ytd(Member_Expression) is equivalent to PeriodsToDate(Year,Member_Expression).

Example

The following example returns the sum of the Measures.[Order Quantity] member, aggregated over the first eight months of calendar year 2003 that are contained in the Date dimension, from the Adventure Works cube.

WITH MEMBER [Date].[Calendar].[First8MonthsCY2003] AS
    Aggregate(
        YTD([Date].[Calendar].[Month].[August 2003])
    )
SELECT 
    [Date].[Calendar].[First8MonthsCY2003] ON COLUMNS,
    [Product].[Category].Children ON ROWS
FROM
    [Adventure Works]
WHERE
    [Measures].[Order Quantity]

Release History

17 July 2006

Changed content:
  • Updated syntax and arguments to improve clarity.
  • Added updated examples.
Show:
© 2016 Microsoft