Database Reference
In-Depth Information
Sorting the attributes
By default, each dimension attribute is sorted according to its key column values, but
this may or may not fit your requirements. Additional options include sorting the attrib-
ute by its name or by another attribute's name or key. For example, ordering a month
attribute within the date dimension based on an attribute name will clearly not work;
this is because we would see February prior to January since the letter "F" precedes
"J" in alphabetical order. More than likely we want to see data sorted based on the
occurrence of months in a calendar, rather than alphabetically. We can manage the
sorting of an attribute using the
OrderBy
and
OrderByAttribute
properties. In this
recipe we will sort the
English Promotion Type
attribute based on
English Promo-
tion Category
.
How to do it...
Let's get started with sorting the attributes:
1. Click on the
English Promotion Type
attribute on the
Dimension Structure
tab to list the properties of this attribute.
2. Within the
Properties
window, change the
OrderBy
property to
AttributeKey
and
OrderByAttribute
to
English Promotion Category
. To sort an attribute
by another attribute's key or name, you must first define attribute relationships
between the source attribute and the sorting attribute. In this case you have
already defined the relationship between
English Promotion Type
and
Eng-
lish Promotion Category
. Therefore, you can pick
English Promotion Cat-
egory
from the
OrderByAttribute
drop-down list.
3. Save and deploy your changes, reprocess the Promotion dimension, and
browse its
English Promotion Type
attribute hierarchy again. This time you'll
see that instead of being sorted alphabetically, promotion types appear in the
order of their corresponding categories:
Search WWH ::
Custom Search