Home Ask Login Register

Developers Planet

Your answer is one click away!

Anil February 2016

The 'Rank' dimension contains more than one hierarchy error

WITH 
  MEMBER [Rank] AS 
    Rank
    (
      [All Products].[Group 2].CurrentMember
     ,Order
      (
        [All Products].[Group 2].MEMBERS
       ,[Measures].[test]
      )
    ) 
SELECT 
  [Rank] ON COLUMNS
 ,[All Products].[Group 2].MEMBERS ON ROWS
FROM [cube];

error: The 'Rank' dimension contains more than one hierarchy, therefore the hierarchy must be explicitly specified. Execution complete

Answers


whytheq February 2016

The standard way to use rank is to order the set before hitting the rank function:

WITH 
  SET [OrderedGroup] AS
    Order
      (
        [All Products].[Group 2].MEMBERS
       ,[Measures].[test]
      )
  MEMBER [Rank] AS 
    Rank
    (
      [All Products].[Group 2].CurrentMember
     ,[OrderedGroup] 
    ) 
SELECT 
  [Rank] ON COLUMNS
 ,[All Products].[Group 2].MEMBERS ON ROWS
FROM [cube];

Here is a reference to a previous post I made concerning Rank:

Apply RANK function to a set according to alphabetical order

Post Status

Asked in February 2016
Viewed 2,333 times
Voted 10
Answered 1 times

Search




Leave an answer


Quote of the day: live life