【问题标题】:How to use multi level hierarchy names in MDX query如何在 MDX 查询中使用多级层次结构名称
【发布时间】:2022-06-27 21:53:43
【问题描述】:

我需要使用 2 个层次结构下的维度字段,即 MDX 查询中另一个层次结构下的一个层次结构。

我的多维数据集中有以下层次结构/数据:

我需要在 MDX 查询中使用突出显示的 [Country] 字段。

请找到我尝试过的查询。

WITH MEMBER [Measures].[Expression1] AS [Geography].[Geography].[Country].currentmember.membervalue
select [Measures].[Expression1] on Columns from [Adventure Works]

出现以下错误:

但是当我对单个层次结构使用相同的语法时,它可以工作。

请找出查询及其结果

WITH MEMBER 
[Measures].[Expression1] AS [Geography].[Country].currentmember.membervalue
select [Measures].[Expression1] on Columns from [Adventure Works]

我期望使用字段的两个层次结构名称得到相同的结果。

谁能指导我获得所需的价值?

【问题讨论】:

    标签: ssas mdx ssas-tabular ssas-2012 mdx-query


    【解决方案1】:

    我认为你根本不需要 WITHcurrentmember 或 membervalue`。

    这两个查询应该列出每个层次结构中的项目...

    select {[Geography].[Country].members} on Columns from [Adventure Works]
    
    select {[Geography].[Geography].[Country].members} on Columns from [Adventure Works]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-03
      • 2011-04-27
      • 1970-01-01
      • 1970-01-01
      • 2016-08-16
      • 2012-11-14
      相关资源
      最近更新 更多