1

I have two different XML/A providers, Mondrian and icCube. The tuples for a time dimension contain the unique name for the member, but the format of the member name is different:

Mondrian:

<UName>[Time].[2004].[QTR2].[Apr]</UName>
<Caption>Apr</Caption>
  • [Time] is the name of the hierarchy
  • [2004] is the name of the ancestor at the Year level
  • [QTR2] is the name of the ancestor at the Quarter level
  • [Apr] is the local name of the member at the Month level

icCube:

<UName>[Time].[Calendar].[Month].&amp;[Jun 2010]</UName>
<Caption>Jun 2010</Caption>
  • [Time] is the name of the dimension
  • [Calendar] is the the name of the hierarchy
  • [Month] is the name of the level
  • [Jun 2010] is the name of the month member.

(I don't know why the ampersands are there)

My question is, is there any recommended, preferably standard way to figure out how the member names are formatted?

The reason I want to know this is when I render the result in a Pivot table, the captions for the members will usually end up as labels on the headers of the pivot table. But since the captions may not be unique, it is desirable to also produce labels of the "ancestor" members, because together they do identify the member uniquely.

In my example, I could use the parts of the member unique name to do this, but in ic cube not,since the member u name is structured differently.

I have 2 questions:

1) How can I tell beforehand what format the XML/A provider will use to identify the members?

2) What would be the recommended way in ic cube to produce the labels for the ancestor members?

UPDATE:

Luc Boudreau informed me that the ampersand indicates "key notation" - it designates the member key rather than its name. Thanks Luc!

Roland Bouman
  • 31,125
  • 6
  • 66
  • 67

1 Answers1

4

The meaning of unique names in MDX is a string that guarantees that it defines a unique MDX entity when parsed. There is no possible collision with another MDX entity. The way to write it depends on the XMLA provider. Even though it's 'unique' there are multiple ways creating it, each server chooses its way.

Never mind, a query written in one server will work in another as both 'unique' names are correctly parsed.

& amp; stands for &

Our advise, the client code should not rely on the format of the unique names.

That being said, if you need parent "names", you should retrieve them explicitly using the "Parent" function and/or as a calculated measure retrieving the name/caption property.

Hope that helps.

Marc Polizzi
  • 9,275
  • 3
  • 36
  • 61
  • thanks! I think I understand, and I agree I should not rely on the names containing the path. I do not see how I could use the Parent function though, for 2 reasons: 1) That would only give me the parent, not the entire path up to the lowest level 2) I would need it as a property of the member - I do not want to have it pop up as a separate member of its own. So how to do that in MDX? I know that the & is XML entity for "&" I was just wondering what that meant inside a XML/A identifier. Turns out it is the MDX syntax for the Member "key" rather than it's name or caption. – Roland Bouman Mar 16 '15 at 11:11
  • 1) if you want the full path of "name", perhaps a recursive function like : function uName(m) as iif( m.parent is null, "", uName( m.parent ) + "/" + m.name ) would do the trick 2) depending on the control of the client code you coud create a dedicated calc-member that is not displayed in the pivot table 3) perhaps the DIMENSION PROPERTIES LEVEL_UNIQUE_NAME might be enough in your usecase 4) a new question in stackoverflow with more contextual information and expected result ;-) – Marc Polizzi Mar 16 '15 at 23:26
  • I found a way to get the full member name. I can create a single Calculated Member (using WITH MEMBER) that generates a string that represents the full path for all members on all query axes. An expression like: Generate( Ancestors( Time.CurrentMember, CInt(Time.CurrentMember.Properties("LEVEL_NUMBER")) ) , Time.CurrentMember.Caption , "," ) Will generate the path of ancestors for the Time hierarchy. Such an expression can be generated for each hierarchy in the query, and these can be concatenated to deliver the full path over all members. – Roland Bouman Apr 05 '15 at 23:24