SSAS FAQ MDX FAQ MDX-Query example that returns list of months from start of year up to specified month
MDX-Query example that returns list of months from start of year up to specified month
User Rating: / 0
PoorBest 
Written by Vidas Matelis   
Tuesday, 03 April 2007 19:48

Q: Need a MDX query that returns list of months from start of year up to specified month.

A: You can use YTD function. Following example returns 2003 year members from January to March:

SELECT YTD([Date].[Calendar].[Month].&[2003]&[8])
ON 0
FROM [Sales Summary]

Result:

January 2003 February 2003 March 2003
$1,756,407.01 $2,873,936.93 $2,049,529.87

 

 
Strategy Companion