Database Reference
In-Depth Information
MEMBER [Measures].[QTD] AS
SUM(QTD([Date].[Calendar].CurrentMember),
[Measures].[Internet Sales Amount])
3. Next you specify the measures you wish to retrieve on columns and the
month level of the calendar hierarchy on rows to define the whole query. Let's
limit the output to the 2007 calendar year:
WITH MEMBER [Measures].[YTD] AS
SUM(PERIODSTODATE([Date].[Calendar].[Calendar
Year], [Date].[Calendar].CurrentMember),
[Measures].[Internet Sales Amount])
MEMBER [Measures].[QTD] AS
SUM(QTD([Date].[Calendar].CurrentMember),
[Measures].[Internet Sales Amount])
SELECT {[Measures].[Internet Sales
Amount], [Measures].[YTD],
measures.[QTD]} ON 0,
[Date].calendar.[Month].members ON 1
FROM [Adventure Works]
WHERE [date].[calendar year].[cy 2007]
The query output should be similar to the following table. Note how quarter-
to-date values are reset for each quarter whereas year-to-date values con-
tinue to grow throughout the year:
Internet Sales Amount
YTD
QTD
Jan-07 $438,865.17
$438,865.17
$438,865.17
Feb-07 $489,090.34
$927,955.51
$927,955.51
Search WWH ::




Custom Search