MDX作为SSAS多维数据集中的计算成员

时间:2015-09-16 14:01:53

标签: ssas mdx cube-script

我的每个销售区域都有一个FactBudget,其中包含字段[Budget SalesRegion][Sales Region]。在维度DimCustomer中,我有字段[Sales Region][Customer Type]

FactBudgetDimCustomer之间的关系仅在[Sales Region]上定义。

我有一个相当简单的mdx语句,用于过滤某个[Sales Region] DimCustomer的{​​{1}}。使用返回的[Sales Region],我选择通讯员[Budget SalesRegion]:

[Customer Type]

如何将此语句转换为SELECT ( FILTER( [Kunde].[Sales Region].members ,[Kunde].[Customer Type].CURRENTMEMBER =[Kunde].[Customer Type].[All].[Direct Sales] ) ,[Measures].[Budget SalesRegion] ) ON 0, [Kunde].[Customer Type].[All].[Direct Sales] ON 1 FROM [BI_DWH]; 中的计算成员,以便切片器中选定的[客户类型]相应地过滤语句?

1 个答案:

答案 0 :(得分:0)

此:

SELECT 
   (
   FILTER(
      [Kunde].[Sales Region].members
     ,[Kunde].[Customer Type].CURRENTMEMBER
          =[Kunde].[Customer Type].[All].[Direct Sales]
    )
   ,[Measures].[Budget SalesRegion]
   ) ON 0,
   [Kunde].[Customer Type].[All].[Direct Sales] ON 1
FROM [BI_DWH];

与此相同:

SELECT 
   [Measures].[Budget SalesRegion] ON 0,
   [Kunde].[Customer Type].[All].[Direct Sales] ON 1
FROM [BI_DWH];

或者如果你想使用切片轴:

SELECT 
   [Measures].[Budget SalesRegion] ON 0
FROM [BI_DWH]
WHERE [Kunde].[Customer Type].[All].[Direct Sales];

现在简化了我不明白你的问题是什么?