0

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

FactBudget和之间的关系DimCustomer仅在 上定义[Sales Region]

我有一个相当简单的mdx语句,用于过滤特定[Sales Region]的. 使用返回的 [Sales Region] 我选择对应的 [Budget SalesRegion]:DimCustomer[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];

如何将此语句转换为计算成员中的计算成员,SSAS cube以便切片器中选择的 [客户类型] 相应地过滤语句?

4

1 回答 1

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];

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

于 2015-09-16T15:00:40.693 回答