📚 Chapter 10 – Configuring Dimensions with SSAS
1️⃣ The Dimension Designer Environment
Once a dimension is initialized via the Dimension Wizard, it is refined inside Visual Studio’s Dimension Designer. The designer interface is organized into four main tabs:
-
Dimension Structure: Used to manage dimensional attributes, build drill-down hierarchies, and review underlying data source view mappings.
-
Attribute Relationships: Maps structural and functional dependencies between attributes (e.g., child-to-parent hierarchies or sibling pairs) to optimize engine storage and query paths.
-
Translations: Provides localized captions and labels for dimensions and attributes across multiple natural languages without modifying warehouse data.
-
Browser: Connects directly to the active SSAS engine to query and preview processed member hierarchies and data levels.
2️⃣ Core Attribute Configuration: Keys, Names, and Uniqueness
Key Columns vs. Name Columns
-
KeyColumns: Specifies the underlying column(s) that uniquely identify each member instance at an internal level (typically an integer surrogate primary key like
TitleKeyorDateKey). -
NameColumn: Specifies the friendly, human-readable column displayed to end users in client tools such as Excel and Power BI (e.g.,
TitleNameorDateName). -
Pitfall: If
NameColumnis left unconfigured, SSAS defaults to displaying the raw integer key fromKeyColumns, causing reports to show technical surrogate numbers rather than descriptive names.
Preventing Duplicate Key Errors via Composite Keys
When grouping cyclical or repeating time intervals into a parent-child hierarchy (such as months within quarters or years), identical member names (e.g., Month = 1 or Quarter = 1) repeat across different years.
If an attribute’s key is not globally unique across the dimension, processing fails with an OLAP storage error:
"A duplicate attribute key has been found when processing".
The Solution: Multi-Column Composite Keys
To resolve duplication in cyclical attributes without altering base tables, configure the KeyColumns property as a collection that includes the parent levels in descending hierarchical order:
-
QuarterKeyColumns:DimDates.Year$\rightarrow$DimDates.Quarter -
MonthKeyColumns:DimDates.Year$\rightarrow$DimDates.Quarter$\rightarrow$DimDates.Month -
Pair these composite keys with their descriptive label (
MonthName,QuarterName) under theNameColumnproperty.
3️⃣ Attribute Hierarchies vs. User-Defined Hierarchies
The Default All-Level Hierarchy
-
By default, SSAS creates an implicit two-level hierarchy for every individual attribute added to a dimension.
-
The top level is an aggregate
Alllevel, and the lower level consists of individual leaf members.
User-Defined Hierarchies & Visibility Management
-
User Hierarchies: Multi-level navigation paths created by dragging and dropping parent and child attributes (e.g.,
Year$\rightarrow$Quarter$\rightarrow$Month$\rightarrow$Date) to allow end users to drill down naturally across reports. -
AttributeHierarchyVisible: When an attribute is included in a user-defined hierarchy, Microsoft recommends setting
AttributeHierarchyVisible = Falseon the standalone member if analysts should not browse it outside of the hierarchy.- Example: In
DimAuthors, settingAuthor.AttributeHierarchyVisible = Falsehides individual authors from standalone field lists, forcing browsing through theAuthorsByStateuser hierarchy.
- Example: In
4️⃣ Attribute Relationships: Rigid vs. Flexible
Attribute relationships inform the Analysis Services indexing engine how dimension members relate to one another, enabling efficient storage and query execution. Properly defined relationships can significantly improve cube processing times and query performance:
-
Sibling Relationships: Attributes share a 1-to-1 relationship with the dimensional key (e.g.,
Title$\rightarrow$TitleId,TitlePrice). -
Parent-Child Relationships: Attributes represent multi-level groupings where one parent holds many child members (e.g.,
Date$\rightarrow$Month$\rightarrow$Quarter$\rightarrow$Year). -
Relationship Types:
-
Rigid: The association between child and parent never changes over time. SSAS skips re-indexing these branches during incremental updates, significantly speeding up cube processing and query plan execution.
-
Flexible: The association between child and parent can change over time (e.g., a customer moving to a new region or a salesperson changing territories). Requires SSAS to evaluate and recalculate aggregation indexes during updates.
-
5️⃣ Walkthrough of Hands-On Exercises
Exercise 10-1: Property Configuration & User Hierarchies
Open PublicationsIndustries.sln as Administrator in Visual Studio. Open each .dim file and apply key, name, and hierarchy settings as outlined in the following table:
| Dimension | Attribute | NameColumn Binding | AttributeHierarchyVisible | User-Defined Hierarchy Levels |
|---|---|---|---|---|
DimAuthors |
Author (AuthorKey)AuthorIdAuthorState |
DimAuthors.AuthorNameDimAuthors.AuthorIdDimAuthors.AuthorState |
FalseTrueTrue |
AuthorsByState:1. AuthorState2. Author |
DimStores |
Store (StoreKey)StoreId |
DimStores.StoreNameDimStores.StoreId |
TrueTrue |
(None — Standalone attributes) |
DimOrders |
OrderNumber |
FactSales.OrderNumber |
True |
(None — Fact/Degenerate dimension) |
DimDates |
Date (DateKey)FullDateMonthQuarterYear |
DimDates.DateNameDimDates.FullDateDimDates.MonthNameDimDates.QuarterNameDimDates.YearName |
TrueTrueTrueTrueTrue |
Year-Qtr-Month-Day:1. Year 2. Quarter 3. Month 4. Date |
DimTitles |
Title (TitleKey)TitleTypePublisherPublishedDatePublishedMonthPublishedQuarterPublishedYear |
Mapped to corresponding descriptive string columns in DimTitles, DimPublishers, and DimDates |
True for all |
• TitlesByType: TitleType $\rightarrow$ Title • TitlesByPublisher: Publisher $\rightarrow$ Title • TitlesByPublishedDate: PublishedYear $\rightarrow$ PublishedQuarter) $\rightarrow$ PublishedMonth) $\rightarrow$ PublishedDate) $\rightarrow$ Title |
Exercise 10-2: Defining Attribute Relationships
In each dimension’s Attribute Relationships tab, remove default incorrect chains and build clean dependencies:
DimAuthors:Author$\rightarrow$AuthorId(Sibling, Rigid)Author$\rightarrow$AuthorState(Parent-Child, Flexible)
DimStores:Store$\rightarrow$StoreId(Sibling, Rigid)
DimDates:Date$\rightarrow$FullDate(Sibling, Rigid)Date$\rightarrow$Month$\rightarrow$Quarter$\rightarrow$Year(Parent-Child chain, all Rigid)
DimTitles:Title$\rightarrow$TitleId,TitlePrice(Siblings, Rigid)Title$\rightarrow$TitleType(Parent-Child, Rigid)Title$\rightarrow$Publisher$\rightarrow$PublisherId-
Title$\rightarrow$PublishedDate$\rightarrow$PublishedMonth$\rightarrow$PublishedQuarter$\rightarrow$PublishedYear
Exercise 10-3: Project Deployment, Processing, and Verification
- Deployment Properties:
- Right-click
PubsBICubes> Properties > Deployment. - Set Processing Option to
Do Not Process(ensures build and schema deployment decouple from data processing). - Set Deployment Mode to
Deploy All(forces a full metadata refresh). - Verify the Server target points to
localhostor your named SSAS instance.
- Right-click
- Build and Deploy:
- Select Build > Deploy PubsBICubes.
- Confirm that the Deployment Progress window finishes with
Deployment Completed Successfully.
- Full Processing:
- In Solution Explorer, right-click
PubsBICubes> Process… - Ensure Process Options is set to
Process Fulland click Run. - Confirm that execution completes with
Process succeeded.
- In Solution Explorer, right-click
- Dimension Browsing:
- Open
DimAuthors.dim, navigate to the Browser tab, and click the Reconnect icon. - Test expanding
AuthorsByStateto verify authors group cleanly under their respective states.
- Open
References & Further Reading
-
Primary Course Text:
Root, R., & Mason, C. (2012). Chapter 10: Configuring Dimensions with SSAS. In Pro SQL Server 2012 BI Solutions (pp. 389–434). -
Multidimensional Design & Relationships:
Ferrari, A., Russo, M., & Webb, C. (2009). Expert Cube Development with Microsoft SQL Server 2008 Analysis Services. Packt Publishing. -
Dimensional Modeling Methodology:
Kimball, R., & Ross, M. (2013). The Data Warehouse Toolkit: The Definitive Guide to Dimensional Modeling (3rd ed.). John Wiley & Sons.