Dimensions are fundamental objects in a Microsoft SQL Server Analysis Services (SSAS) cube. They provide the context for analyzing data by representing business entities such as customers, products, or dates. This tutorial guides you through the process of creating and configuring dimensions within your Analysis Services project.
Before you begin, ensure you have the following:
There are several ways to create a dimension in Analysis Services:
For this tutorial, we will focus on using the Dimension Wizard to create a new dimension.
To launch the Dimension Wizard:
The Dimension Wizard will appear.
Click Next to proceed.
Select Use an existing table and click Next.
Choose the table from your data source view that will be the basis for your dimension. For example, select a DimCustomer
table.
Ensure the Key column(s) are correctly identified (usually a unique identifier for the dimension). Click Next.
Verify the key columns selected. If necessary, adjust them. Click Next.
Select the columns from the source table that you want to include as attributes in your dimension. These will be used for filtering, grouping, and labeling data in your reports. For a customer dimension, you might select FirstName
, LastName
, City
, and Country
.
Click Next.
Review your selections. You can change the name of the dimension if desired. Click Finish.
Once the dimension is created, it will appear in the Dimensions folder in Solution Explorer. Double-click the dimension to open it in the Dimension Designer.
The Dimension Designer displays the attributes that were created from the columns you selected.
Name
, AttributeHierarchyEnabled
, and IsKey
.Hierarchies represent parent-child relationships within a dimension, enabling drill-down analysis. For example, a Geography dimension might have a hierarchy of Country > State > City.
To create a hierarchy:
Country
, then State
, then City
into the Hierarchies pane.You can also create User-defined hierarchies and Parent-child hierarchies for more complex data structures.
Analysis Services dimensions offer advanced features:
City
and State
.Creating well-defined dimensions is a critical step in building an effective SSAS cube. By understanding how to use the Dimension Wizard and configure attributes and hierarchies, you lay the foundation for powerful data analysis and reporting.
Next: Creating Cubes