MDX 1

with member [measures].[aaa] as
[Measures].[Dollar Sales] - ([Measures].[Dollar Sales], ParallelPeriod([Time].[YQMD].[Year], 1, [Time].[YQMD].currentmember))
member [measures].[Previous Dollar Sales] as
([Measures].[Dollar Sales], ParallelPeriod([Time].[YQMD].[Year], 1, [Time].[YQMD].currentmember)),
format_string = '0.00'
member [measures].[Previous Dollar Sales 2] as
([Measures].[Dollar Sales], ParallelPeriod([Time].[YQMD].[Quarter], 1, [Time].[YQMD].currentmember)),
format_string = '0.00'
member [measures].[Total Year Dollar Sales]as
sum(PeriodsToDate([Time].[YQMD].[Year], [Time].[YQMD].currentmember), [Measures].[Dollar Sales])
member [measures].[Total 2] as
sum(([Time].[YQMD].currentmember.parent.firstsibling.firstchild:[Time].[YQMD].currentmember), [Measures].[Dollar Sales])
member [measures].[Lag 3 month] as
sum(([Time].[YQMD].currentmember.lag(2) : [Time].[YQMD].currentmember), [measures].[Dollar Sales])
SELECT
{ [measures].[aaa],[measures].[Previous Dollar Sales],
[measures].[Previous Dollar Sales 2],
[Measures].[Dollar Sales],
[measures].[Total Year Dollar Sales],
[measures].[Total 2],
[measures].[Lag 3 month]} ON COLUMNS,
{
Descendants (
{[Time].[2004],[Time].[2005]},
[Time].[YQMD].[Month],
SELF
) }
ON ROWS
FROM Sales

你可能感兴趣的:(MDX 1)