SSAS: There is no such thing as an Attribute in MDX!

In MDX in SSAS the term "attribute" occasionally gets used interchangeably with "hierarchy" and "level", but it's not technically accurate.

In SSAS, MDX has concepts of Dimensions, Hierarchies and Levels, but not Attributes. Attributes and Attribute Relationships are design time concepts that are understood by the storage engine, but they are not directly exposed in the MDX language. Attributes actually map to levels (or properties) in MDX. I think the confusion comes about because, by default, an attribute generates a hierarchy with a single level in it that both have the same name as the underlying attribute. (I also think that some of this confusion comes about because of the way that SSAS coalesces different objects, but that is a topic for another time.)

So if you create a Month attribute in the Date dimension, when you process it will generate a Month Hierarchy and a Month Level so in the form <Dimension>.<Hierarchy>.<Level> you end up with [Date].[Month].[Month].

I think that understanding the different types of objects and how they interrelate if fundamental to being able to understand MDX.

In MDX terms:

  • a dimension contains a collection of 1 or more hierarchies,

  • a hierarchy contains a collection of 1 or more levels

  • and a level contains a collection of 1 or more members

...and there is no such thing as an attribute. :)

 

Update [17 Mar 09] - As Mosha has pointed out in the comments, MDX does not have a concept of dimensions either, just hierarchies. There are some references to dimensions, things like the .Dimension function (which actually returns a hierarchy and I think is just a hang over from AS 2000) and member unique names can be expressed in terms of [<dimension>].[<hierarchy>].[<level>].[<member>]. So I think that the dimension concept does "leak" into MDX a little bit.

Print | posted on Sunday, March 15, 2009 11:04 PM

Comments on this post

# re: SSAS: There is no such thing as an Attribute in MDX!

Requesting Gravatar...
> MDX has concepts of Dimensions, Hierarchies and Levels

Not accurate. MDX doesn't have concept of Dimensions, just Hierarchies and Levels. Dimensions are like Attribute - they are fundamental to the model, but don't get exposed in MDX.
Left by Mosha on Mar 16, 2009 5:51 PM

# re: SSAS: There is no such thing as an Attribute in MDX!

Requesting Gravatar...
Hi Mosha, But what about things like the .Dimension function and Root(<dimension>)? I would agree that dimensions are not really key objects in MDX, but I would have said that it was still possible to pass a reference to a dimension.
Left by Darren Gosbell on Mar 16, 2009 10:13 PM

# re: SSAS: There is no such thing as an Attribute in MDX!

Requesting Gravatar...
Here are this and some other articles on Dimensional Attributes:

http://ssas-wiki.com/w/Articles#Dimensional_Attributes
Left by Sam Kane on Mar 18, 2011 3:17 AM

Your comment:

 (will show your gravatar)