Our SSAS cube has a date dimension, which for the DayName string member displays alphabetically instead chronologically. I added a DayOfWeek integer 1-7 to use for ordering. I have two options to accomplish this, not sure of the advantages/disadvantages of either.
- Make DayName attribute visible, and use DayOfWeek as OrderBYAttribute
- Make DayOfWeek attribute visible, and use DayName as NameColumn
The attributes are both functionally the same when setup like this. I'm leaning towards #2, since it's an int.
Best Answer
You have your terminology a bit wrong which makes it hard to tell what exactly you mean by your 2 options but you should use the
OrderByAttribute
(which is what I think you mean by option 1). TheOrderByAttribute
is meant to be used for exactly that, ordering the attributes by something else than their Key or Value.If by option 2 you mean you create the attribute using the
DayOfWeek
column (essentially creating an attribute with aKeyColumn
ofDayOfWeek
) and then set theNameColumn
toDayName
you would in this case essentially have the same end user experience but that is not what those attributes are meant to do.The
KeyAttribute
should be used to define which members are unique and theNameColumn
should be used to define what you want to be shown to the users. Each of these properties have their own purpose and you should use them as such.Abusing
KeyColumn
to define an order will get you in trouble when you will actually need that property to resolve issues with duplicates and so on.Some excerpts from the documentation: