仅对维度内容进行MDX查询

仅对维度内容进行MDX查询,mdx,Mdx,是否可以编写一个MDX查询,只查询并返回维度上的数据 例如,假设我有一个具有“Customer”维度的“Sales”多维数据集,而Customer维度有三个属性:“Customer Name”、“Customer ID”和“Customer Business Sector”。我需要一个查询,返回“客户业务部门”值为“银行业务”的所有客户的“客户名称”和“客户ID”属性。您可以使用,例如: with member xName as dim.currentMember.NAME mem

是否可以编写一个MDX查询,只查询并返回维度上的数据

例如,假设我有一个具有“Customer”维度的“Sales”多维数据集,而Customer维度有三个属性:“Customer Name”、“Customer ID”和“Customer Business Sector”。我需要一个查询,返回“客户业务部门”值为“银行业务”的所有客户的“客户名称”和“客户ID”属性。

您可以使用,例如:

with 
   member xName as dim.currentMember.NAME
   member XProp as dim.currentMember.properties('prop')

select 
  { [xName], [xProp] } on 0, 
  dim.allMembers       on 1

from [cube]
你可以使用,比如:

with 
   member xName as dim.currentMember.NAME
   member XProp as dim.currentMember.properties('prop')

select 
  { [xName], [xProp] } on 0, 
  dim.allMembers       on 1

from [cube]
当然

SELECT
NonEmpty
    (
      Customer.CustomerID.CustomerID.MEMBERS * Customer.CustomerName.CustomerName.MEMBERS, 
      (Customer.[Customer Business Sector].&[Banking], Mesures.SomeMeasure)
    )
            ON 1,
{} ON 0
FROM [Sales]
当然

SELECT
NonEmpty
    (
      Customer.CustomerID.CustomerID.MEMBERS * Customer.CustomerName.CustomerName.MEMBERS, 
      (Customer.[Customer Business Sector].&[Banking], Mesures.SomeMeasure)
    )
            ON 1,
{} ON 0
FROM [Sales]
如果你说的是“属性”,那么可能是以下模式:

WITH
   MEMBER [Measures].[CustName] AS
        [Customer].CURRENTMEMBER.properties('Customer Name')
   MEMBER [Measures].[CustID] AS
        [Customer].CURRENTMEMBER.properties('Customer ID')
   MEMBER [Measures].[CustSector] AS
        [Customer].CURRENTMEMBER.properties('Customer Business Sector')
   SET [CustBankers] AS
       FILTER(
          [Customer].[Customer].MEMBERS AS C
         ,[Measures].[CustSector] = 'Banking'
       ) 
SELECT
  { 
    [Measures].[CustName]
   ,[Measures].[CustID] 
  } ON 0, 
  [CustBankers]  ON 1
FROM [YourCube];
我猜想当你提到“属性”时,你指的是客户维度中的三个属性层次结构。如果是这种情况,则更类似于以下内容:

WITH
   MEMBER [Measures].[CustName] AS
        [Customer].[Customer Name].CURRENTMEMBER.member_caption
   MEMBER [Measures].[CustID] AS
        [Customer].[Customer ID].CURRENTMEMBER.member_caption
   MEMBER [Measures].[CustSector] AS
        [Customer].CURRENTMEMBER.properties('Customer Business Sector')
   SET [CustBankers] AS
       EXISTS(
          [Customer].[Customer].MEMBERS
         ,[Customer].[Customer Business Sector].[Banking]
       ) 
SELECT
  { 
    [Measures].[CustName]
   ,[Measures].[CustID] 
  } ON 0, 
  [CustBankers]  ON 1
FROM [YourCube]; 
如果你说的是“属性”,那么可能是以下模式:

WITH
   MEMBER [Measures].[CustName] AS
        [Customer].CURRENTMEMBER.properties('Customer Name')
   MEMBER [Measures].[CustID] AS
        [Customer].CURRENTMEMBER.properties('Customer ID')
   MEMBER [Measures].[CustSector] AS
        [Customer].CURRENTMEMBER.properties('Customer Business Sector')
   SET [CustBankers] AS
       FILTER(
          [Customer].[Customer].MEMBERS AS C
         ,[Measures].[CustSector] = 'Banking'
       ) 
SELECT
  { 
    [Measures].[CustName]
   ,[Measures].[CustID] 
  } ON 0, 
  [CustBankers]  ON 1
FROM [YourCube];
我猜想当你提到“属性”时,你指的是客户维度中的三个属性层次结构。如果是这种情况,则更类似于以下内容:

WITH
   MEMBER [Measures].[CustName] AS
        [Customer].[Customer Name].CURRENTMEMBER.member_caption
   MEMBER [Measures].[CustID] AS
        [Customer].[Customer ID].CURRENTMEMBER.member_caption
   MEMBER [Measures].[CustSector] AS
        [Customer].CURRENTMEMBER.properties('Customer Business Sector')
   SET [CustBankers] AS
       EXISTS(
          [Customer].[Customer].MEMBERS
         ,[Customer].[Customer Business Sector].[Banking]
       ) 
SELECT
  { 
    [Measures].[CustName]
   ,[Measures].[CustID] 
  } ON 0, 
  [CustBankers]  ON 1
FROM [YourCube]; 
你提到“三个属性”。。。但你真的是指客户维度中的三个层次结构吗?你提到了“三个属性”。。。但是,您实际上是指客户维度中的三个层次结构吗?