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 attribute 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 ...

Get SQL Server Analysis Services 2012 Cube Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.