0

是否可以创建一个根据字母顺序生成集合排名的度量,即 Aleen 应该是 1 .... Zebedie 应该排名 101(集合有 101 个项目)

这不起作用:

MEMBER [Measures].[Alphabetic_Rank] AS 
    RANK(
        [CustomerName].CurrentMember,
        ORDER(
            [CustomerName],
            [CustomerName],
            ASC
            )
        )

编辑

尝试应用此功能的另一个示例如下,它也不起作用:

WITH 
SET [orderedSet] AS
    ORDER(
    [Operator].members,
    [Operator].currentmember.name,
    BASC
    )
MEMBER [Measures].[newMeasure] AS
    RANK(
    [orderedSet].currentmember, 
    [orderedSet].members
    )
SELECT
   {} ON COLUMNS,
   [orderedSet] 
   * 
   [Measures].[newMeasure] ON ROWS
FROM [ourCube]
4

1 回答 1

1

如何使用名称作为订单的数值:

MEMBER [Measures].[Alphabetic_Rank] AS 
    RANK(
        [CustomerName].CurrentMember,
        ORDER(
            [CustomerName].members,
            [CustomerName].currentMember.NAME,
            BASC
            )
        )

编辑第二部分:

WITH 
SET [orderedSet] AS
    ORDER(
    [Operator].members,
    [Operator].currentmember.name,
    BASC
    )
MEMBER [Measures].[newMeasure] AS
    RANK(
    [Operator].currentmember, 
    [orderedSet]
    )
SELECT
   [Measures].[newMeasure] ON COLUMNS,
   [orderedSet] ON ROWS
FROM [ourCube]
于 2013-11-12T14:24:09.647 回答