跨用户定义的层次结构的MDX交叉联接

跨用户定义的层次结构的MDX交叉联接,mdx,cross-join,Mdx,Cross Join,我有一个MDX查询,比如 with set [IcPiyasaCC] as { [DimCostCenterView].[CostCenterKey].&[S_EDT], [DimCostCenterView].[CostCenterKey].&[S_END.MRG], [DimCostCenterView].[CostCenterKey].&[S_GM_YRD], [DimCostCenter

我有一个MDX查询,比如

with
set [IcPiyasaCC] as 
      {
        [DimCostCenterView].[CostCenterKey].&[S_EDT],
        [DimCostCenterView].[CostCenterKey].&[S_END.MRG],
        [DimCostCenterView].[CostCenterKey].&[S_GM_YRD],
        [DimCostCenterView].[CostCenterKey].&[S_PER.RAF],
        [DimCostCenterView].[CostCenterKey].&[S_ULUSAL],
        [DimCostCenterView].[CostCenterKey].&[S_PAS_MARG]
      }
member [DimCostCenterView].[CostCenterKey].[IcPiyasa] as 
     aggregate([IcPiyasaCC])
SELECT 
  NON EMPTY 
   { 
    [Measures].[Fiili_TutarTonaj] 
   } ON COLUMNS, 
NON EMPTY 
   { 
     (
       [DimCostCenterView].[CostCenterKey].[IcPiyasa]
    --*[DimCostCenterView].[CostCenterKey].[CostCenterKey].ALLMEMBERS
     ) 
   }
ON ROWS
我可以得到想要的输出,比如

-            Fiili_TutarTonaj
IcPiyasa           6
但是,当我尝试与位于同一层次结构上的所有成员进行交叉联接时,若要获取任何相关的“CostCenterKey”,我会得到“CostCenterKey层次结构在交叉联接函数中被多次使用”错误消息。我如何交叉连接它们以获得这样的结果

-           -             Fiili_TutarTonaj
IcPiyasa    S_EDT              1
IcPiyasa    S_END.MRG          2
IcPiyasa    S_ULUSAL           3

谢谢。

您可以在不同的层次结构中托管新的聚合成员。然后可以进行交叉连接:

WITH
SET [IcPiyasaCC] AS 
      {
        [DimCostCenterView].[CostCenterKey].&[S_EDT],
        [DimCostCenterView].[CostCenterKey].&[S_END.MRG],
        [DimCostCenterView].[CostCenterKey].&[S_GM_YRD],
        [DimCostCenterView].[CostCenterKey].&[S_PER.RAF],
        [DimCostCenterView].[CostCenterKey].&[S_ULUSAL],
        [DimCostCenterView].[CostCenterKey].&[S_PAS_MARG]
      }
MEMBER [Geography].[Geography].[All].[IcPiyasa] AS 
     AGGREGATE(
       [IcPiyasaCC],
       ([Geography].[Geography].[All])
     )
SELECT 
  NON EMPTY  
    [Measures].[Fiili_TutarTonaj]  ON 0, 
NON EMPTY 
       [Geography].[Geography].[All].[IcPiyasa]
      *[DimCostCenterView].[CostCenterKey].[CostCenterKey].ALLMEMBERS
    ON 1
...
...
或者这个:

WITH
SET [IcPiyasaCC] AS 
      {
        [DimCostCenterView].[CostCenterKey].&[S_EDT],
        [DimCostCenterView].[CostCenterKey].&[S_END.MRG],
        [DimCostCenterView].[CostCenterKey].&[S_GM_YRD],
        [DimCostCenterView].[CostCenterKey].&[S_PER.RAF],
        [DimCostCenterView].[CostCenterKey].&[S_ULUSAL],
        [DimCostCenterView].[CostCenterKey].&[S_PAS_MARG]
      }
MEMBER [Measures].[ForceName] AS 'IcPiyasaCC'
MEMBER [Geography].[Geography].[All].[IcPiyasa] AS 
     (
        [Geography].[Geography].[All]
       ,[Measures].[ForceName]
     )
SELECT 
  NON EMPTY  
    [Measures].[Fiili_TutarTonaj]  ON 0, 
NON EMPTY 
       [Geography].[Geography].[All].[IcPiyasa]
      *[DimCostCenterView].[CostCenterKey].[CostCenterKey].ALLMEMBERS
    ON 1

谢谢,但是当我使用[DimCostCenterView].[IcPiyasa].[IcPiyasa]时,它会给我一种在解析时找不到“[IcPiyasa]”层次结构的感觉(我无法准确地翻译错误消息,它是我的母语)。我应该如何定义“成员”您可以添加多维数据集结构的照片吗?我们在哪里可以找到
IcPiyasa
?没有IcPiyasa,我正在动态定义它:成员[DimCostCenterView].[CostCenterKey].[IcPiyasa]作为聚合([IcPiyasaCC])。IcPiyasaCC是一个命名集,您可以在我的问题中看到它是如何定义的。@bsaglamtimur我编辑了我的贡献:您可以尝试在单独的层次结构中托管聚合成员