1

現在、2 つの別々のキューブ (管理している) から情報を取得し、合計行 (両方のデータを使用) を追加しようとしています。

コメントアウトされた行は、「異次元」エラーを生成します。なんとなくは理解できますが、完全ではありません。MDX を最後に見てから数年が経ちました。

ポインタはありますか?

WITH 
  MEMBER [Computer Department].[Parent Department Key].[Total]
    AS ([Computer Department].[Parent Department Key].[All], [Measures].[Fact Computer Specification Count])

  MEMBER [User Department].[Parent Department Key].[Total]
    AS 
      LOOKUPCUBE
        (
          "Directory"
          , "
            (
              [Measures].[Directory Object Count]
              , [Department].[Parent Department Key].&[" + [Measures].[Department Key] + "]
             )"
        )


  MEMBER [Measures].[Department Key]
    AS [Computer Department].[Parent Department Key].CurrentMember.Properties("Key")
  MEMBER [Measures].[Department Name]
    AS [Computer Department].[Parent Department Key].CurrentMember.Properties("Caption")
  MEMBER [Measures].[Red Users]
    AS 
      LOOKUPCUBE
        (
          "Directory"
          , "
            (
              [Measures].[Directory Object Count]
              , [Directory Object].[Object Type].&[User]
              , [Directory Object].[Migration RAG].&[Red]
              , [Department].[Source].&[2]
              , [Directory Object].[Directory Name].[All]
              , [Directory Object].[Parent Object Key].[All]
              , [Location].[Location].[All]
              , [Department].[Parent Department Key].&[" + [Measures].[Department Key] + "]
             )"
        )
   MEMBER [Measures].[Amber Users]
    AS 
      LOOKUPCUBE
        (
          "Directory"
          , "
            (
              [Measures].[Directory Object Count]
              , [Directory Object].[Object Type].&[User]
              , [Directory Object].[Migration RAG].&[Amber]
              , [Department].[Source].&[2]
              , [Directory Object].[Directory Name].[All]
              , [Directory Object].[Parent Object Key].[All]
              , [Location].[Location].[All]
              , [Department].[Parent Department Key].&[" + [Measures].[Department Key] + "]
             )"
        )
  MEMBER [Measures].[Green Users]
    AS 
      LOOKUPCUBE
        (
          "Directory"
          , "
            (
              [Measures].[Directory Object Count]
              , [Directory Object].[Object Type].&[User]
              , [Directory Object].[Migration RAG].&[Green]
              , [Department].[Source].&[2]
              , [Directory Object].[Directory Name].[All]
              , [Directory Object].[Parent Object Key].[All]
              , [Location].[Location].[All]
              , [Department].[Parent Department Key].&[" + [Measures].[Department Key] + "]
             )"
        )
  MEMBER [Measures].[Unknown Users]
    AS 
      LOOKUPCUBE
        (
          "Directory"
          , "
            (
              [Measures].[Directory Object Count]
              , [Directory Object].[Object Type].&[User]
              , [Directory Object].[Migration RAG].&[Unknown]
              , [Department].[Source].&[2]
              , [Directory Object].[Directory Name].[All]
              , [Directory Object].[Parent Object Key].[All]
              , [Location].[Location].[All]
              , [Department].[Parent Department Key].&[" + [Measures].[Department Key] + "]
             )"
        )
   MEMBER [Measures].[Total RAGU Users]
    AS
      LOOKUPCUBE
        (
          "Directory"
          , "
            AGGREGATE
            (
              ([Measures].[Directory Object Count]
              , [Directory Object].[Object Type].&[User]
              , [Department].[Source].&[2]
              , [Directory Object].[Directory Name].[All]
              , [Directory Object].[Parent Object Key].[All]
              , [Location].[Location].[All]
              , [Department].[Parent Department Key].&[" + [Measures].[Department Key] + "]
              , EXCEPT([Directory Object].[Migration RAG].Children, [Directory Object].[Migration RAG].&[Unknown])
             )
           )
             "
        )    

  MEMBER [Measures].[Red Computers]
    AS ([Measures].[Fact Computer Specification Count], [Computer].[Migration RAG].&[Red])
  MEMBER [Measures].[Amber Computers]
    AS ([Measures].[Fact Computer Specification Count], [Computer].[Migration RAG].&[Amber])
  MEMBER [Measures].[Green Computers]
    AS ([Measures].[Fact Computer Specification Count], [Computer].[Migration RAG].&[Green])
  MEMBER [Measures].[Unknown Computers]
    AS ([Measures].[Fact Computer Specification Count], [Computer].[Migration RAG].&[Unknown])
  MEMBER [Measures].[Total RAGU Computers]
    AS 
      AGGREGATE
        (  
          (
            EXCEPT([Computer].[Migration RAG].Children, [Computer].[Migration RAG].&[Unknown])
          )
          , [Measures].[Fact Computer Specification Count]       
        ) 
SELECT
  {
    [Measures].[Department Name]
    , [Measures].[Red Users]
    , [Measures].[Amber Users]
    , [Measures].[Green Users]
    , [Measures].[Unknown Users]
    , [Measures].[Total RAGU Users]
    , [Measures].[Red Computers]
    , [Measures].[Amber Computers]
    , [Measures].[Green Computers]
    , [Measures].[Unknown Computers]
    , [Measures].[Total RAGU Computers]

  } ON COLUMNS,
  {
    {
      ORDER
        (             
          EXCEPT
            (
              DESCENDANTS([Computer Department].[Parent Department Key].[All], 1, SELF)
              , [Computer Department].[Parent Department Key].[All].DataMember
            )
          , [Measures].[Department Name]
          , BASC
        )
        , [Computer Department].[Parent Department Key].[Total]
       -- , [User Department].[Parent Department Key].[Total]    

    }
  } ON ROWS
FROM [Hardware Inventory]
WHERE 
  (
    [Computer Department].[Source].&[2]
    , [Computer Directory Object].[Directory Name].[All]
    , DESCENDANTS([Computer Directory Object].[Parent Object Key].[All], 0, SELF)
    , [Computer Location].[Location].[All]
  )
4

0 に答える 0