在MDX中,给定数字的价格等级为0

时间:2016-03-22 12:01:30

标签: mdx pivot-table olap-cube

我有一个OLAP多维数据集,其中包含每个数字的类型价格总和。

使用MDX,如何输出给定数字的等级?

结果应如下:

enter image description here

Heare是MDX查询,但是所有等级值都是0.查询中有什么问题?

WITH MEMBER [Measures].[Rank Sum of price] AS
   RANK([NUM_1].[All Numbers].CURRENTMEMBER
   ,[NUM_1].[All Numbers]
   ,[Measures].[Sum of price])

SELECT 
 {
  [Measures].[Sum of price] 
, [Measures].[Rank Sum of price]
 }
 ON COLUMNS,

  [NUM_1].[All Numbers]
 ON ROWS 
 FROM schema1

1 个答案:

答案 0 :(得分:0)

也许在点击排名功能之前在自定义集中进行排序:

WITH 
  SET OrderedNums AS 
    Order
    (
      [NUM_1].[All Numbers].[All Numbers].MEMBERS
     ,[Measures].[Sum of price]
     ,BDESC
    ) 
  MEMBER [Measures].[Rank Sum of price] AS 
    Rank
    (
      [NUM_1].[All Numbers].CurrentMember
     ,OrderedNums
    ) 
SELECT 
  {
    [Measures].[Sum of price]
   ,[Measures].[Rank Sum of price]
  } ON 0
 ,[NUM_1].[All Numbers].[All Numbers].MEMBERS ON 1
FROM schema1;