我有一个OLAP多维数据集,其中包含每个数字的类型价格总和。
使用MDX,如何输出给定数字的等级?
结果应如下:
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
答案 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;