运行 MDX 中的总数
Running Total in MDX
大家好我需要帮助我想要这个结果我在 SSAS 中尝试使用 MDX 进行不同的查询但不起作用。
谢谢!
您希望结果中的总数为 运行。看看下面的例子
with
member
[Measures].[Internet Sales AmountRunningtotal]
as
case when [Measures].[Internet Sales Amount] = null then null
else
sum({[Product].[Subcategory].firstchild:[Product].[Subcategory].currentmember},[Measures].[Internet Sales Amount])
end
select {[Measures].[Internet Sales Amount],
[Measures].[Internet Sales AmountRunningtotal]
} on columns,
non empty
([Date].[Calendar Year].[Calendar Year],[Date].[Calendar Quarter of Year].[Calendar Quarter of Year],
[Product].[Category].[Category],[Product].[Subcategory].[Subcategory])
on
rows
from
[Adventure Works]
结果
谢谢 MoazRub 的回答我使用了这个查询并且它有效:
WITH MEMBER [Measures].[Running Total] AS
Aggregate (
{ [Date].[Calendar].CurrentMember.Parent.FirstChild : [Date].[Calendar].CurrentMember },
[Measures].[Internet Sales Amount]
)
SELECT
{ [Measures].[Internet Sales Amount], [Measures].[Running Total] } ON 0,
[Date].[Calendar].[Month].&[2011]&[1].Children ON 1
FROM [Adventure Works]
大家好我需要帮助我想要这个结果我在 SSAS 中尝试使用 MDX 进行不同的查询但不起作用。
谢谢!
您希望结果中的总数为 运行。看看下面的例子
with
member
[Measures].[Internet Sales AmountRunningtotal]
as
case when [Measures].[Internet Sales Amount] = null then null
else
sum({[Product].[Subcategory].firstchild:[Product].[Subcategory].currentmember},[Measures].[Internet Sales Amount])
end
select {[Measures].[Internet Sales Amount],
[Measures].[Internet Sales AmountRunningtotal]
} on columns,
non empty
([Date].[Calendar Year].[Calendar Year],[Date].[Calendar Quarter of Year].[Calendar Quarter of Year],
[Product].[Category].[Category],[Product].[Subcategory].[Subcategory])
on
rows
from
[Adventure Works]
结果
谢谢 MoazRub 的回答我使用了这个查询并且它有效:
WITH MEMBER [Measures].[Running Total] AS
Aggregate (
{ [Date].[Calendar].CurrentMember.Parent.FirstChild : [Date].[Calendar].CurrentMember },
[Measures].[Internet Sales Amount]
)
SELECT
{ [Measures].[Internet Sales Amount], [Measures].[Running Total] } ON 0,
[Date].[Calendar].[Month].&[2011]&[1].Children ON 1
FROM [Adventure Works]