Search code examples
ssasmdxssas-2008

How to get the name of invisible attributes and user defined Hierarchies using MDX?


I have a cube with some dimensions. There I have a dimension 'Product' which has some attributes and user defined hierarchies hidden. I do not know which attributes are hidden. Is there a way to write an MDX to get the invisible attributes and user defined hierarchies? I can get the name by other ways. But I want to know the way to get using MDX.


Solution

  • http://msdn.microsoft.com/en-us/library/ms145613.aspx gives an example query that reveals a member property:

    WITH MEMBER [Measures].[Product List Price] AS
    [Product].[Product].CurrentMember.Properties("List Price")
    SELECT 
       [Measures].[Product List Price] on COLUMNS,
       [Product].[Product].MEMBERS  ON Rows
    FROM [Adventure Works]
    

    I cannot test it myself right now, but I assume that you could also write .Properties(0) or .Properties(1) to refer to properties by index, since you don't know the names. I'm not sure if there is a way to then discover the property name from the resulting cellset or not, sorry.