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

Mtd (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.


Mtd( [ Member_Expression ] )

Member_Expression

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

If a member expression is not specified, the default is Time.CurrentMember.

The Mtd function is a shortcut function for the PeriodsToDate function at the month level. That is, Mtd(Member_Expression) is equivalent to PeriodsToDate(Month,Member_Expression).

Example

The following example returns the sum of the month to date freight costs for Internet sales for the month of July, 2002 through the 20th day of July.

WITH MEMBER Measures.x AS SUM 
   (
      MTD([Date].[Calendar].[Date].[July 20, 2002])
     , [Measures].[Internet Freight Cost]
     )
SELECT Measures.x ON 0
FROM [Adventure Works]

Release History

17 July 2006

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