📚 Chapter 9 – Beginning the SSAS Project
1️⃣ Fundamentals: Relational Engines vs. Analysis Services (SSAS)
SQL Server Analysis Services (SSAS) hosts multidimensional OLAP cubes to accelerate complex reporting workloads beyond standard relational engine capabilities. SSAS is a separate service that runs alongside the SQL Server Database Engine, and it is optimized for analytical queries rather than transactional operations.
Architectural & Physical Differences
-
Storage Footprint:
-
SQL Server: Relies on data (
.mdf) and transaction log (.ldf) files to support concurrent transactional activity (ACID compliance). -
SSAS Database: Physically structured as a directory holding collections of metadata definitions, index binaries, and pre-calculated aggregations. Transaction logging is absent because SSAS serves read-intensive reporting rather than OLTP modifications.
-
-
Data Ingestion via “Processing”:
- SSAS does not hold the master transactional state; it copies and compiles structures from relational data warehouse tables during an administrative step called Processing.
- Unlike standard SQL views (which re-run queries on demand), processed cubes store persistent multidimensional arrays and pre-calculated aggregates directly on disk.
Relational Tables vs. Multidimensional Cubes
- Relational Reporting Tables: Require complex SQL joins and runtime aggregations (
GROUP BY), which scale poorly across multi-million-row fact tables. - OLAP Cubes: Pre-aggregate numeric metrics across dimensional intersections. Data access bypasses relational joins, allowing query tools (Excel PivotTables, Power BI, SSRS) to retrieve summarized metrics via MDX or DAX.
2️⃣ Project Hierarchy in Visual Studio
An SSAS solution is constructed as an Analysis Services Multidimensional Project (.dwproj) containing modular design folders and metadata definitions:
-
Data Sources (
.ds): XML connection definitions targeting the source relational warehouse. -
Data Source Views (
.dsv): An abstraction schema isolating the cube from physical database tables. -
Dimensions (
.dim): Independent business axes (e.g., Titles, Stores, Dates) containing key-name pairings and hierarchies. -
Cubes (
.cube): Multidimensional structures binding numeric measures to dimensional attributes.
3️⃣ Data Sources & Service Account Security
When establishing an SSAS Data Source, developers must configure Impersonation Information to control the security context under which SSAS connects to the relational warehouse during cube processing:
-
Use a specific Windows user name and password: The recommended setting for local and lab configurations. Requires domain/machine credentials (
ComputerName\User) that hold administrative and read permissions across both the database engine and the Analysis Services instance. -
Use the service account: Inherits the security token assigned to the SSAS Windows service in SQL Server Configuration Manager. Viable if the service principal has database read privileges, but often yields permission errors in student labs.
-
Use the credentials of the current user / Inherit: Uses the active interactive user during development, but frequently fails when automated or scheduled background processing jobs run on the server.
4️⃣ The Abstraction Layer: Data Source Views (DSVs)
SSAS prohibits connecting multidimensional objects directly to raw database tables. A Data Source View (DSV) provides an intermediate logical abstraction layer that sits between the physical warehouse and the OLAP cube.
Capabilities of a DSV
-
Insulation from DDL Changes: If the underlying physical data warehouse tables are renamed, split, or partitioned across multiple storage drives, the DSV can be adjusted internally using SQL SELECT statements to preserve the expected schema without breaking deployed cubes.
-
Friendly Names: Allows developers to assign clean, user-facing aliases to technical column headers without modifying the physical table schema.
-
Named Queries: Acts as an embedded virtual view within SSAS to join snowflake tables (e.g., combining
DimTitlesandDimPublishers) into a single logical entity. -
Named Calculations: Injects a custom SQL expression as a virtual column within a DSV table (e.g., concatenating calendar fields into a display string) without executing DDL on the relational database.
-
Logical Relationships: Allows developers to draw foreign-key relationships between tables in the visual designer when referential constraints do not exist in the underlying warehouse.
5️⃣ Designing Dimensions: Key & Name Bindings
A dimension translates relational attributes into structured axes for slicing metrics.
-
Key Column vs. Name Column:
-
Key Column (
KeyColumns): The unique identifier (typically the integer surrogate key) that SSAS uses internally to join and index records. -
Name Column (
NameColumn): The user-friendly label that end-user reporting tools display on report axes. -
Example: In
DimTitles, the Key Column isTitleKey(integer), but the Name Column is set toTitleName(string). If the name column is omitted, queries display technical surrogate keys instead of human-readable labels.
-
-
Attribute Types:
-
Dimensional attributes default to the Regular type.
-
Attributes representing temporal cycles must be classified under specific Date types (
Calendar Year,Calendar Quarter,Calendar Month,Calendar Date) to enable specialized time-series aggregations and MDX date functions. -
Transactional tracking keys can be assigned specialized types (e.g.,
Slowly Changing Dimension - Original ID) to represent natural business identifiers.
-
6️⃣ Hands-On Lab: Scaffolding PubsBICubes & Dimensions
Exercise 9-1: Data Source & DSV Creation
-
Open Solution & Add SSAS Project:
-
Open
PublicationsIndustries.slnin Visual Studio (Run as Administrator). -
Right-click the solution > Add > New Project…
-
Select Analysis Services Multidimensional Project and name it
PubsBICubes.
-
-
Configure Data Source:
-
In Solution Explorer, right-click Data Sources > New Data Source…
-
Create an OLE DB connection targeting the local relational warehouse
DWPubsSales. -
Set Impersonation to Use a specific Windows user name and password using administrative credentials[cite: 394, 413].
-
Name the data source
DWPubsSales.
-
-
Configure Data Source View (DSV):
-
Right-click Data Source Views > New Data Source View…
- Select
DWPubsSalesas the relational data source . - Include all warehouse tables:
DimAuthors,DimDates,DimPublishers,DimStores,DimTitles,FactSales, andFactTitlesAuthors. -
Name the view
DWPubsSalesTables. - In the DSV designer, right-click
DimDates.Date> Properties > set FriendlyName toFullDate.
-
Exercise 9-2: Creating the Five Core Dimensions
Launch the Dimension Wizard for each entity by right-clicking the Dimensions folder > New Dimension…. Use the following table to configure each dimension:
| Dimension Name | Source DSV Table | Key Column (KeyColumns) |
Name Column (NameColumn) |
Additional Attributes & Types |
|---|---|---|---|---|
DimTitles |
DimTitles (Main)Snowflake Includes: DimDates, DimPublishers |
TitleKey |
TitleName |
• TitleId (SCD - Original ID)• TitleType, TitlePrice (Regular)• PublisherId (SCD - Original ID)• FullDate, DateKey (Calendar Date)• Month, Quarter, Year (Calendar Month/Quarter/Year) |
DimAuthors |
DimAuthors |
AuthorKey |
AuthorName |
• AuthorId (SCD - Original ID)• AuthorState (Regular) |
DimStores |
DimStores |
StoreKey |
StoreName |
• StoreId (SCD - Original ID) |
DimDates |
DimDates |
DateKey |
DateName |
• FullDate (Calendar Date)• Month (Calendar Month)• Quarter (Calendar Quarter)• Year (Calendar Year) |
DimOrders(Fact Dimension) |
FactSales |
OrderNumber |
OrderNumber |
• Uncheck related dimension tables (DimStores, DimDates, etc.); retain only OrderNumber (Regular); uncheck numeric measures like SalesQuantity |
Verification Step: After defining each dimension, select Build > Build PubsBICubes. Confirm that the build finishes with Build succeeded and no key errors in the Error List.
References & Further Reading
-
Primary Course Text:
Root, R., & Mason, C. (2012). Chapter 9: Beginning the SSAS Project. In Pro SQL Server 2012 BI Solutions (pp. 335–388). -
Multidimensional Modeling:
Ferrari, A., & Russo, M. (2009). Expert Cube Development with Microsoft SQL Server 2008 Analysis Services. Packt Publishing. -
Dimensional Abstraction Patterns:
Kimball, R., & Ross, M. (2013). The Data Warehouse Toolkit: The Definitive Guide to Dimensional Modeling (3rd ed.). John Wiley & Sons.