Modifying the Product Dimension
In the tasks in this topic, you use a named calculation to provide more descriptive names for the product lines, define a hierarchy in the Product dimension, and specify the (All) member name for the hierarchy. You also group attributes into display folders.
Adding a Named Calculation
You can add a named calculation to a table in a data source view. In the following task, you create a named calculation that will display the full product line name.
To add a named calculation
Open the Adventure Works DW data source view by double-clicking it in the Data Source Views folder in Solution Explorer.
In the diagram pane, right-click the Product table, and then click New Named Calculation.
In the Create Named Calculation dialog box, type ProductLineName in the Column name box.
In the Expression box, type the following CASE statement:
CASE ProductLine WHEN 'M' THEN 'Mountain' WHEN 'R' THEN 'Road' WHEN 'S' THEN 'Accessory' WHEN 'T' THEN 'Touring' ELSE 'Components' END
This CASE statement creates user-friendly names for each product line in the cube.
Click OK to create the ProductLineName named calculation.
On the File menu, click Save All.
Modifying the NameColumn Property of an Attribute
To modify the NameColumn property value of an attribute
Switch to Dimension Designer for the Product dimension. To do this, double-click the Product dimension in the Dimensions node of Solution Explorer.
In the Attributes pane of the Dimension Structure tab, select Product Line.
In the Properties window, click in the NameColumn property field and then click the browse (…) button to open the Name Column dialog box.
Select ProductLineName in the Source column list and then click OK.
The NameColumn field now contains the text Product.ProductLineName (WChar). The members of the Product Line attribute hierarchy will now display the full name of the product line instead of an abbreviated product line name.
In the Attributes pane of the Dimension Structure tab, select Product Key.
In the Properties window, click in the NameColumn property field and then click the ellipsis (…) button to open the Name Column dialog box.
Select EnglishProductName in the Source column list and then click OK.
The NameColumn field now contains the text Product.EnglishProductName (WChar).
In the Properties window, change the value of the Name property for the Product Key attribute to Product Name.
Creating a Hierarchy
To create a hierarchy
Drag the Product Line attribute from the Attributes pane into the Hierarchies pane.
Drag the Model Name attribute from the Attributes pane into the <new level> cell in the Hierarchies pane, underneath the Product Line level.
Drag the Product Name attribute from the Attributes pane into the <new level> cell in the Hierarchies pane, underneath the Model Name level.
In the Hierarchies pane of the Dimension Structure tab, right-click the title bar of the Hierarchy hierarchy, select Rename and type Product Model Lines.
The name of the hierarchy is now Product Model Lines.
On the File menu, click Save All.
Specifying Folder Names and All Member Names
To specify the folder and member names
In the Attributes pane, select the following attributes by holding down the CTRL key while clicking each of them:
Class
Color
Days To Manufacture
Reorder Point
Safety Stock Level
Size
Size Range
Style
Weight
In the AttributeHierarchyDisplayFolder property field in the Properties window, type Stocking.
You have now grouped these attributes into a single display folder.
In the Attributes pane, select the following attributes:
Dealer Price
List Price
Standard Cost
In the AttributeHierarchyDisplayFolder property cell in the Properties window, type Financial.
You have now grouped these attributes into a second display folder.
In the Attributes pane, select the following attributes:
End Date
Start Date
Status
In the AttributeHierarchyDisplayFolder property cell in the Properties window, type History.
You have now grouped these attributes into a third display folder.
Select the Product Model Lines hierarchy in the Hierarchies pane, and then change the AllMemberName property in the Properties window to All Products.
Click an open area of the Hierarchies pane, and then change the AttributeAllMemberName property to All Products.
Clicking an open area lets you modify properties of the Product dimension itself. You could also click the Product dimension icon at the top of the attributes list in the Attributes pane.
On the File menu, click Save All.
Defining Attribute Relationships
If the underlying data supports it, you should define attribute relationships between attributes. Defining attribute relationships speeds up dimension, partition, and query processing. For more information, see Defining Attribute Relationships and Attribute Relationships.
To define attribute relationships
In the Dimension Designer for the Product dimension, click the Attribute Relationships tab.
In the diagram, right-click the Model Name attribute and then select New Attribute Relationship.
In the Create Attribute Relationship dialog box, the Source Attribute is Model Name. Set the Related Attribute to Product Line.
In the Relationship type list, leave the relationship type set to Flexible because relationships between the members might change over time. For example, a product model might eventually be moved to a different product line.
Click OK.
On the File menu, click Save All.
Reviewing Product Dimension Changes
To review the Product dimension changes
On the Build menu of Business Intelligence Development Studio, click Deploy Analysis Services Tutorial.
After you have received the Deployment Completed Successfully message, click the Browser tab of Dimension Designer for the Product dimension and then click the reconnect icon on the toolbar of the designer.
Verify that Product Model Lines is selected in the Hierarchy list, and then expand All Products.
Notice that the name of the All member appears as All Products. This is because you changed the AllMemberName property for the hierarchy to All Products earlier in the lesson. Also, the members of the Product Line level now have user-friendly names, instead of single letter abbreviations.