0

我需要按降序订购 Dimension。不使用 HIERARCHIZE 关键字一切正常。在这里,我需要 HIERARCHIZE 才能订购层次结构级别的数据。

Select NON EMPTY({[Measures].[Internet Sales Amount]}) dimension properties MEMBER_TYPE,CHILDREN_CARDINALITY, PARENT_UNIQUE_NAME ON COLUMNS ,NON EMPTY(HIERARCHIZE({{ORDER(drilldownlevel([Customer].[Customer Geography]),[Customer].[Customer Geography].CurrentMember.MEMBER_CAPTION,desc)}})) dimension properties MEMBER_TYPE,CHILDREN_CARDINALITY, PARENT_UNIQUE_NAME ON ROWS

在此处输入图像描述 在此处输入图像描述

4

2 回答 2

0

解决了以下查询的问题

SELECT 
NON EMPTY [Measures].[Internet Sales Amount] ON 0,
NON EMPTY
    Order(
        Hierarchize(
           [Customer].[Customer Geography].[Country].&[Germany].Children
        )
      ,[Customer].[Customer Geography].CurrentMember.MEMBER_CAPTION
      ,DESC
    )
ON 1
FROM [Adventure works];
于 2016-05-07T04:24:43.690 回答
0

不幸的是,我没有 AdvWrks 多维数据集来测试以下内容:

SELECT 
  NON EMPTY
     [Measures].[Internet Sales Amount] ON 0
 ,NON EMPTY
      ORDER(
         {
           HIERARCHIZE([Customer].[Customer Geography].[COUNTRY].MEMBERS)
          ,[Customer].[Customer Geography].[COUNTRY].&[GERMANY].CHILDREN
         }
        ,[Customer].[Customer Geography].CurrentMember.MEMBER_CAPTION
        ,BDESC
      )
    )  ON 1
FROM [Adventure Works];

看起来我在这里有一个类似问题的经过测试的解决方案:
MDX 中的 Order function 和 Crossoins 问题

看起来将上述内容应用于您的上下文是这样的:

SELECT 
  NON EMPTY 
    [Measures].[Internet Sales Amount] ON 0
 ,NON EMPTY 
    {
      Order
      (
        {
            [Customer].[Customer Geography].[COUNTRY].MEMBERS
         ,  [Customer].[Customer Geography].[COUNTRY].&[GERMANY].CHILDREN
        }
       ,(
          [Measures].[Internet Sales Amount]
         ,[Customer].[Customer Geography].[COUNTRY]
        )
       ,BDESC
      )
    } ON 1
FROM [Adventure Works];
于 2016-05-05T11:58:51.433 回答