请考虑以下情况:
我有一个带有一个Fact
表和一个称为SalesAmount
的度量的多维数据集。现在,我要基于这2个Select
创建度量:
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数据工具-在“计算”选项卡中创建这些成员: