在 SSAS 中创建计算度量
Create Calculate Measures in SSAS
请考虑以下场景:
我有一个立方体,其中包含一个 Fact
table 和一个名为 SalesAmount
的度量。现在我想根据这 2 Select
s:
创建一个度量
Select 1
:
Select [Measures].[SalesAmount]
From MyCube
Where [Product].[Color].[Gray]
和Select 2
:
Select [Measures].[SalesAmount]
From MyCube
Where [Dates].[Calendar Year].&[2015]
问题出在 Add Calculate Member
中有一个用于简单公式的框。如何为 Select 1
+ Select 2
创建度量?
谢谢
我不确定您在哪里查看此添加计算成员选项,但您可以尝试这样的操作(Adventure Works 数据库)。
with member measures.[MyMeasure1]
as
([Measures].[Internet Sales Amount], [Date].[Calendar].[Calendar Year].&[2006])
member measures.[MyMeasure2]
as
([Measures].[Internet Sales Amount], [Product].[Color].&[Grey])
member measures.[MyMeasure12]
as
measures.[MyMeasure1] + measures.[MyMeasure2]
select {[Measures].[Internet Sales Amount], measures.[MyMeasure1], measures.[MyMeasure2] , measures.[MyMeasure12]} on 0
from [Adventure Works]
您还可以从 Visual Studio 数据工具 - 在“计算”选项卡中创建这些成员:
请考虑以下场景:
我有一个立方体,其中包含一个 Fact
table 和一个名为 SalesAmount
的度量。现在我想根据这 2 Select
s:
Select 1
:
Select [Measures].[SalesAmount]
From MyCube
Where [Product].[Color].[Gray]
和Select 2
:
Select [Measures].[SalesAmount]
From MyCube
Where [Dates].[Calendar Year].&[2015]
问题出在 Add Calculate Member
中有一个用于简单公式的框。如何为 Select 1
+ Select 2
创建度量?
谢谢
我不确定您在哪里查看此添加计算成员选项,但您可以尝试这样的操作(Adventure Works 数据库)。
with member measures.[MyMeasure1]
as
([Measures].[Internet Sales Amount], [Date].[Calendar].[Calendar Year].&[2006])
member measures.[MyMeasure2]
as
([Measures].[Internet Sales Amount], [Product].[Color].&[Grey])
member measures.[MyMeasure12]
as
measures.[MyMeasure1] + measures.[MyMeasure2]
select {[Measures].[Internet Sales Amount], measures.[MyMeasure1], measures.[MyMeasure2] , measures.[MyMeasure12]} on 0
from [Adventure Works]
您还可以从 Visual Studio 数据工具 - 在“计算”选项卡中创建这些成员: