You are on page 1of 52

O F F I C I A L M I CRO S O F T L EA RN I N G PRO DU C T

2791A
Implementing and Maintaining Microsoft
SQL Server 2005 Analysis Services
Companion Content
Information in this document, including URL and other Internet Web site references, is subject to change
without notice. Unless otherwise noted, the example companies, organizations, products, domain names,
e-mail addresses, logos, people, places, and events depicted herein are fictitious, and no association with
any real company, organization, product, domain name, e-mail address, logo, person, place or event is
intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the
user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in
or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical,
photocopying, recording, or otherwise), or for any purpose, without the express written permission of
Microsoft Corporation.

Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property
rights covering subject matter in this document. Except as expressly provided in any written license
agreement from Microsoft, the furnishing of this document does not give you any license to these
patents, trademarks, copyrights, or other intellectual property.
The names of manufacturers, products, or URLs are provided for informational purposes only and
Microsoft makes no representations and warranties, either expressed, implied, or statutory, regarding
these manufacturers or the use of the products with any Microsoft technologies. The inclusion of a
manufacturer or product does not imply endorsement of Microsoft of the manufacturer or product. Links
may be provided to third party sites. Such sites are not under the control of Microsoft and Microsoft is not
responsible for the contents of any linked site or any link contained in a linked site, or any changes or
updates to such sites. Microsoft is not responsible for webcasting or any other form of transmission
received from any linked site. Microsoft is providing these links to you only as a convenience, and the
inclusion of any link does not imply endorsement of Microsoft of the site or the products contained
therein.
2007 Microsoft Corporation. All rights reserved.
Microsoft and the trademarks listed at
http://www.microsoft.com/about/legal/en/us/IntellectualProperty/Trademarks/EN-US.aspxare trademarks
of the Microsoft group of companies. All other marks are property oftheir respective owners.

Product Number: 2791A


Released: 04/2007
Creating Multidimensional Analysis Solutions 2-1

Module 2
Creating Multidimensional Analysis Solutions
Contents:
Lab Answer Keys 2
2-2 Implementing and Maintaining Microsoft SQL Server 2005 Analysis Services

Lab Answer Keys


Lab: Creating a Multidimensional Analysis Solution
Exercise 1: Creating a Data Source
Task 1: Create a new Analysis Services project
1. Click Start, point to All Programs, point to Microsoft SQL Server 2005, and then click SQL
Server Business Intelligence Development Studio.
2. On the File menu, point to New, and click Project.

3. In the Templates pane, click Analysis Services Project.


4. Click Browse, browse to the D:\Labfiles\Starter folder, and then click Open.
5. Change the value in the Name box to Adventure Works OLAP, and then click OK.
Task 2: Create a data source for the AdventureWorksDW relational database
1. In Solution Explorer, right-click the Data Sources folder, and then click New Data Source.
2. On the Welcome to the Data Source Wizard page, click Next.

3. On the Select how to define the connection page, click New.


4. In the Connection Manager dialog box, in the Server name box, click MIAMI.
5. In the Log on to the server area, ensure that Use Windows Authentication is selected.
6. In the Connect to a database area, click AdventureWorksDW in the Select or enter a
database name box, and then click OK.
7. On the Select how to define the connection page, click Next.
8. On the Impersonation Information page, select Default, and then click Next.
9. On the Completing the Wizard page, change the data source name to Adventure Works
Data Warehouse, and then click Finish.

Exercise 2: Creating and Modifying a Data Source View


Task 1: Create a data source view
1. In the Solution Explorer, right-click the Data Source Views folder, and then click New
Data Source View.
2. On the Welcome to the Data Source View Wizard page, click Next.
3. On the Select a Data Source page, verify that the Adventure Works Data Warehouse data
source is selected, and then click Next.

4. In the Available objects list, click dbo.DimCustomer, and then hold down the CTRL key
and click dbo.DimGeography, dbo.DimProduct, dbo.DimTime, and
dbo.FactInternetSales.
5. On the Select Tables and Views page, click the >button to add the selected tables to the
Included objects list, and then click Next.
6. On the Completing the Wizard page, change the name of the data source view to
Adventure Works DSV, and then click Finish. Note that the Data Source View Designer
opens automatically after you click Finish.
Creating Multidimensional Analysis Solutions 2-3

Task 2: Modify the data source view


1. In the Data Source View Designer, use the Zoom icon to change the zoom level to50%.
2. In the Diagram pane, click the FactInternetSales table.
3. In the Properties pane, in the FriendlyName box, type InternetSales.
4. In the Diagram Pane, click the DimCustomer table.
5. In the Properties pane, in the FriendlyName box, type Customer.
6. Change the FriendlyName of the remaining tables to remove the dim prefix.
7. In the Diagram pane, right-click the Customer table, and then click New Named
Calculation.
8. In the Create Named Calculation dialog box, type Full Name in the Column name box.
9. In the Expression box, type the following:

CASE
WHEN MiddleName IS NULL THEN
FirstName + ' ' + LastName
ELSE
FirstName + ' ' + MiddleName + ' ' + LastName
END

10. In the New Named Calculation dialog box, click OK.

Exercise 3: Creating and Modifying a Cube


Task 1: Create a cube
1. In the Solution Explorer, right-click the Cubes folder, and then click New Cube.
2. On the Welcome to the Cube Wizard page, click Next.
3. On the Select Build Method page, verify that the Build the cube using a data source,
Auto build, and Create attributes and hierarchies options are selected, and then click
Next.
4. On the Select Data Source View page, verify that the Adventure Works DSV data source
view is selected, and then click Next.
5. On the Detecting Fact and Dimension Tables page, wait for the wizard to finish analyzing
the relationships, and then click Next.
6. On the Identify Fact and Dimension Tables page, in the Time dimension table box, click
Time, and then click Next.
7. On the Select Time Periods page, select the following values, then click Next.

Time Property Name Time Table Columns

Year CalendarYear

Half Year CalendarSemester

Quarter CalendarQuarter

Month EnglishMonthName
2-4 Implementing and Maintaining Microsoft SQL Server 2005 Analysis Services

Date FullDateAlternateKey

8. On the Select Measures page, clear the Promotion Key, Currency Key, Sales Territory
Key, and Revision Number checkboxes, and then click Next.
9. On the Detecting Hierarchies page, wait for the wizard to finish analyzing the relationships,
and then click Next.
10. On the Review New Dimensions page, click Next.
11. On the Completing the Wizard page, change the Cube name to Adventure Works Cube,
and then click Finish. Notice that the Cube Designer opens automatically after you click
Finish.
Task 2: Modify the cube
1. In the Measures pane of the Cube Designer, expand the Internet Sales measure group,
and then click the Unit Price Discount Pct measure.
2. In the Properties pane, change the Name to Unit Price Discount Percent.
3. In the Measures pane, click Tax Amt.
4. In the Properties pane, change the Name to Tax Amount.
5. On the Cube Structure tab of the Cube Designer, click the Show Measures Grid icon.
6. In the Measures pane, click Unit Price, and then hold the CTRL key and click the Extended
Amount, Discount Amount, Product Standard Cost, Total Product Cost, Sales Amount,
and Tax Amount measures.
7. In the Properties pane, click Currency in the FormatString box.
8. In the Measures grid, click Unit Price Discount Percent.
9. In the Properties pane, click Percent in the FormatString box.
Task 3: Browse the cube
1. In Solution Explorer, right-click the Adventure Works OLAP project, and then click
Deploy.
2. When deployment has completed successfully, click the Browser tab in the Cube Designer.

Tip: Click the Auto Hide icon on the various panes in Business Intelligence Development
Studio to make it easier to see the entire Cube Browser window.

3. In the Metadata pane, expand Measures, expand Internet Sales, and then drag the Sales
Amount measure to the Drop Totals or Detail Fields Here area of the Data pane.
4. In the Metadata pane, drag Internet Sales Count and drop it next to the Sales Amount
column.
5. In the Metadata pane, drag Unit Price Discount Percent and drop it next to the Internet
Sales Count column.
6. Verify that the format strings for the measures are correct.
7. In the Metadata pane, expand the Order Date dimension. Drag the Order Date.Calendar
Year hierarchy to the Drop Row Fields Here area of the Data pane.
Creating Multidimensional Analysis Solutions 2-5

8. In the Metadata pane, expand the Customer dimension, expand the Full Name attribute,
expand the Members node, expand the All node, and verify that the named calculation
created in Exercise 2 is functioning.

9. On the File menu, click Save All to save your project.


Working with Dimensions 3-1

Module 3
Working with Dimensions
Contents:
Lab Answer Keys 2
3-2 Implementing and Maintaining Microsoft SQL Server 2005 Analysis Services

Lab Answer Keys


Lab: Defining Dimensions
Exercise 1: Configuring Dimensions
Task 1: Open the Adventure Works OLAP solution
1. Click Start, point to All Programs, point to Microsoft SQL Server 2005, and then click SQL
Server Business Intelligence Development Studio.
2. On the File menu, point to Open, click Project/Solution, browse to the
D:\Labfiles\Starter\Adventure Works OLAP folder, click Adventure Works OLAP.sln, and
then click Open.
Task 2: Remove attributes from the Customer dimension
1. In Solution Explorer, right-click the Customer.dim dimension, and then click View Designer.
2. In the Attributes pane, press the CTRL key and click the French Country Region Name,
French Education, French Occupation, Spanish Country Region Name, Spanish
Education, and Spanish Occupation attributes, right-click any of the highlighted attributes,
and then click Delete.
3. In the Delete Objects dialog box, click OK.
4. On the File menu, click Save All.
5. In the Customer Dimension Designer, click the Close icon.
Task 3: Remove an attribute from the Product dimension
1. In Solution Explorer, right-click the Product.dim dimension, and then click View Designer.
2. In the Attributes pane, right-click the Large Photo attribute, and then click Delete.
3. In the Delete Objects dialog box, click OK.
4. On the File menu, click Save All.
5. In the Product Dimension Designer, click the Close icon.
Task 4: Modify the hierarchy in the Time dimension
1. In Solution Explorer, right-click the Time.dim dimension, and then click View Designer.
2. In the Attributes pane, click the Month Name attribute.
3. In the Properties pane, change Month Name to Month in the Name box.
4. Change the name of the Simple Date attribute to Date.
5. Change the name of the Calendar Quarter Name attribute to Calendar Quarter.
6. Change the name of the Calendar Semester Name attribute to Calendar Semester.

7. In the Hierarchies and Levels pane, click the title row of the Calendar Year - Calendar
Semester Name - Calendar Quarter Name - Month Name Simple Date hierarchy.
8. In the Name box in the Properties pane, remove the existing text and type Calendar Time.
9. In the Hierarchies and Levels pane, click the Calendar Semester Name level.
Working with Dimensions 3-3

10. In the Properties pane, change Calendar Semester Name to Calendar Semester in the
Name box.
11. Change the name of the Calendar Quarter Name level to Calendar Quarter.

12. Change the name of the Month Name level to Month.


13. Change the name of the Simple Date level to Date.
14. On the File menu, click Save All.
Task 5: Modify the Time dimension
1. In Solution Explorer, right-click the Adventure Works OLAP solution, and then click Deploy.
Wait for the Deploy Succeeded message in the status bar.
2. Click the Browser tab of the Time.dim Dimension Designer, and then click the Reconnect
icon.
3. In the Hierarchy box, click Calendar Quarter, and then expand the All level of the
hierarchy. Notice that the quarters are sorted alphabetically rather than in order from oldest
to most recent.
4. Click the Dimension Structure tab.
5. In the Attributes pane, click Calendar Quarter.
6. If necessary, click the Properties tab.
7. In the Properties pane, click the ellipsis () in the KeyColumns box.
8. In the Data Item Collection Editor, click Add.
9. In the New Binding (WChar) properties area, click the ellipsis () in the Source box.
10. In the Object Binding window, click Column binding in the Binding type box, verify that
the Source Table is Time, click Calendar Year in the Source column box, and then click
OK.
11. In the Members area, verify that DimTime.CalendarYear (WChar) is highlighted, and then
click the up arrow to move it above DimTime.CalendarQuarterName(WChar).
12. Click OK to close the DataItem Collection Editor.
13. Repeat steps 5 to 12 to create composite keys for the Calendar Semester and Month
attributes.
14. In Solution Explorer, right-click the Adventure Works OLAP solution, and then click Deploy.
Wait for the Deploy Succeeded message in the status bar.
15. Click the Browser tab of the Time.dim Dimension Designer, and then click the Reconnect
icon.
16. If necessary, in the Hierarchy box, click Calendar Quarter, and then expand the levels.
Notice that the quarters are now in date order.
17. Close the Time.dim Dimension Designer.

Exercise 2: Defining Relationships and Hierarchies


Task 1: Modify the natural hierarchy in the Customer dimension
1. In Solution Explorer, right-click the Customer.dim dimension, and then click View Designer.
3-4 Implementing and Maintaining Microsoft SQL Server 2005 Analysis Services

2. In the Attributes pane, right-click English Country Region Name, and then click Rename.
Rename the attribute to Country-Region.
3. Rename the State Province Name attribute to State-Province.

4. In the Hierarchies and Levels pane of the Dimension Structure tab, click the title row of
the State Province Name Geography hierarchy.
5. In the Properties pane, replace State Province Name Geography with Customer
Geography in the Name property box.
6. Drag the Country-Region attribute from the Attributes pane, to just above the State
Province Name level in the Customer Geography hierarchy in the Hierarchies and Levels
pane.
7. Drag the City attribute from the Attributes pane into the Customer Geography hierarchy
just above the Customer level.
8. In the Hierarchies and Levels pane, right-click Geography, and then click Delete.
9. In the Hierarchies and Levels pane, right-click State Province Name level, and then click
Rename.
10. Rename the State Province Name level to State-Province.
11. In the Attributes pane, click Customer.
12. In the Properties pane, expand NameColumn, expand Source, and then click FullName in
the ColumnID box.
13. In the Attributes pane, expand Geography. Notice the attribute relationships that are listed.
You will move some of these attributes to the appropriate locations to support the
Customer Geography natural hierarchy.
14. In the Attributes pane, expand Full Name, and then drag the Postal Code attribute
relationship from the Geography attribute to the<new attribute relationship>tag under
the Full Name attribute.
15. In the Attributes Pane, expand the Postal Code attribute, and then drag the City attribute
relationship from the Geography attribute to the<new attribute relationship>tag under
the Postal Code attribute.
16. In the Attributes Pane, expand the City attribute, and then drag the State Province Name
attribute relationship from the Geography attribute to the<new attribute
relationship>tag under the City attribute.
17. In the Attributes Pane, expand the State-Province attribute, and then drag the English
Country Region Name attribute relationship from the Geography attribute to the<new
attribute relationship>tag under the State-Province attribute.
18. In Solution Explorer, right-click the Adventure Works OLAP solution, and then click
Deploy. Wait for the Deploy Succeeded message in the status bar.
19. On the Customer.dim Dimension Designer, click the Browser tab.
20. On the Browser tab, click the Reconnect icon, ensure that the Customer Geography
hierarchy is selected in the Hierarchy box, and then expand the levels of the hierarchy to
view the data.
21. Close the Customer.dim Dimension Designer.
Working with Dimensions 3-5

Task 2: Modify the parent-child hierarchy in the Employee dimension


1. In Solution Explorer, right-click the Employee.dim dimension, and then click View Designer.
2. In the Attributes pane, click the Parent Employee Key parent-child attribute. Notice that
the icon for this attribute is different from the others. This is because a parent-child
relationship exists for this attribute.
3. If necessary, click the Properties tab.
4. In the Properties pane, in the Name box, replace Parent Employee Key with Employees.
5. In the Properties pane, in the NameColumn drop-down list, click (new).
6. In the Object Binding window, ensure that Column binding is selected in the Binding type
box, verify that Employee is selected in the Source table box, click FullName in the Source
column box, and then click OK.
7. In the Attributes pane, click the Employee attribute (be sure to click Employee and not
Employees).
8. In the Properties pane, in the NameColumn drop-down list, click (new).
9. In the Object Binding window, ensure that Column binding is selected in the Binding type
box, verify that Employee is selected in the Source table box, click FullName in the Source
column box, and then click OK.
10. In the Attributes pane, click the Employees attribute (be sure to click Employees and not
Employee).
11. In the Properties pane, click the ellipsis () in the NamingTemplate box.
12. In the Level Naming Template window, in the second row, type Senior Management in
the Name column, and then press ENTER.
13. In the third row, type Middle Management in the Name column, and then press ENTER.
14. In the fourth row, type Employee Level * in the Name column, and then click OK.
15. In the Properties pane for Employees, click NonLeafDataHidden in the
MembersWithData box. This will hide data related to non-leaf level members.
16. In Solution Explorer, right-click the Adventure Works OLAP solution, and then click Deploy.
17. After deployment has successfully completed, click the Browser tab on theEmployee.dim
Dimension Designer.
18. Click the Reconnect icon.
19. In the Hierarchy box, ensure that Employees is selected.
20. Expand the All level, click Ken J Snchez, and notice that the level name is Senior
Management.

21. Expand Ken J Snchez, expand Peter J Krebs, expand JoLynn M Dobney, click Simon D
Rapier, and notice that the level name is Employee Level 05.
22. Close the Employee.dim Dimension Designer.

Exercise 3: Sorting and Grouping Dimension Attributes


Task 1: Modify the sort order of the Month attribute
3-6 Implementing and Maintaining Microsoft SQL Server 2005 Analysis Services

1. In Solution Explorer, right-click the Time.dim dimension, and then click View Designer.
2. In Solution Explorer, right-click the Adventure Works OLAP solution, and then click Deploy.
Wait for the Deploy Succeeded message in the status bar.

3. Click the Browser tab of the Time.dim Dimension Designer, and then click the Reconnect
icon.
4. In the Hierarchy box, click Calendar Time, and then expand the levels. Notice that the
months are listed under the correct quarter, semester, and year, but that they are sorted in
alphabetical order instead of chronological order.
5. Click the Dimension Structure tab.

6. In the Data Source View pane, right-click MonthNumberofYear, and then click New
Attribute from Column.
7. In the Attributes column, click Month Number of Year.
8. If necessary, click the Properties tab.
9. In the Properties pane, set the following values:

Property Value

AttributeHierarchyEnabled False

AttributeHierarchyOptimizedState NotOptimized

AttributeHierarchyOrdered False

10. In the Attributes pane, expand TimeKey. Notice that all attributes are related directly to the
TimeKey attribute.
11. In the Attributes pane, expand the Month attribute, and then drag the Month Number of
Year attribute to the <new attribute relationship>tag under the Month attribute.
12. In the Attributes pane, click Month.
13. In the Properties pane, click AttributeKey in the OrderBy box, and then in the
OrderByAttribute box, click Month Number Of Year.
14. In Solution Explorer, right-click the Adventure Works OLAP solution, and then click Deploy.
Wait for the Deploy Succeeded message in the status bar.
15. On the Browser tab of the Time.dim Dimension Designer, click the Reconnect icon.
16. If necessary, in the Hierarchy box, click Calendar Time. Expand the hierarchy to the month
level and notice that the months are now in date order rather than alphabetical order.
17. Close the Time.dim Dimension Designer.
Task 2: Group the Yearly Income attribute hierarchy members in the Customer
dimension
1. In Solution Explorer, right-click the Customer.dim dimension, and then click View Designer.
2. In the Data Source View pane, right-click the Customer table, and then click Explore Data.
Notice the range of values for the Yearly Income column.
3. On the Explore DimCustomer Table tab, click the Close icon.
Working with Dimensions 3-7

4. In the Attributes pane, click Yearly Income.


5. If necessary, click the Properties tab.
6. In the Properties pane, click Automatic in the DiscretizationMethod box, and then type 5
in the DiscretizationBucketCount box.
7. In Solution Explorer, right-click the Adventure Works OLAP solution, and then click
Deploy. Wait for the Deploy Succeeded message in the status bar.
8. On the Browser tab of the Customer.dim Dimension Designer, click the Reconnect icon.
9. In the Hierarchy box, click Yearly Income.
10. Expand the All level and view the salary ranges created.

11. Click File, and then click Save All.


12. Click File, and then click Exit.
Working with Measures and Measure Groups 4-1

Module 4
Working with Measures and Measure Groups
Contents:
Lab Answer Keys 2
4-2 Implementing and Maintaining Microsoft SQL Server 2005 Analysis Services

Lab Answer Keys


Lab: Configuring Measures and Measure Groups
Exercise 1: Configuring Measures
Task 1: Open the Adventure Works OLAP solution
1. Click Start, point to All Programs, point to Microsoft SQL Server 2005, and then click SQL
Server Business Intelligence Development Studio.
2. On the File menu, point to Open, click Project/Solution.

3. Browse to the D:\Labfiles\Starter folder, click Adventure Works OLAP.sln, and then click
Open.
Task 2: Modify the format of the Internet Sales Count and Reseller Sales Count
measures
1. In Solution Explorer, under the Cubes folder, right-click Adventure Works Cube.cube, and
then click View Designer.

2. On the Cube Structure tab, click the Show Measures Grid button.
3. In the Measures pane, click the Internet Sales Count, then press the CTRL key and click
Reseller Sales Count.
4. In the Properties pane, in the FormatString box, click #,#.
Task 3: Organize measures into display folders
1. In the Measures pane, use the CTRL key to select the Internet Sales SalesAmount,
Internet Sales Tax Amount, and Internet Sales Freight measures.
2. In the Properties pane, in the DisplayFolder box, type Sales.
3. In the Measures pane, use the CTRL key to select the Internet Sales Unit Price, Internet
Sales-Product Standard Cost, and the Internet Sales Unit PriceDiscounted Percentage
measures.
4. In the Properties pane, type Products in the DisplayFolder box.

5. In the Measures pane, use the CTRL key to select the Internet Sales-Order Quantity,
Internet Sales-Extended Amount, Internet Sales-Discount Amount,Internet Sales-Total
Product Cost, and Internet Sales Count measures.
6. In the Properties pane, type Other in the DisplayFolder box.
7. In Solution Explorer, right-click the Adventure Works OLAP project, and then click Deploy.
8. When deployment has completed successfully, click the Browser tab in the Cube Designer.

9. On the Browser page, click the Reconnect button.


10. If necessary, expand Measures, and then expand Internet Sales to see the new display
folders.
11. Expand Other, and then drag the Internet Sales Count measure to the Drop Totals or
Detail Fields Here area. Verify that the measure is formatted correctly.
12. Leave the Cube Designer open.
Working with Measures and Measure Groups 4-3

Exercise 2: Defining Dimension Usage and Relationships


Task 1: Create a referenced relationship
1. In the Adventure Works Cube.cube Designer, click the Browser tab.
2. On the Browser page, click anywhere in the Data pane, and then click the Clear Results
button.

3. In the Metadata pane, expand Measures, expand Reseller Sales, and then drag the
Reseller Sales-Sales Amount measure to the Drop Totals or Detail Fields Here area.
4. In the Metadata pane, expand the Geography dimension, right-click the Geographies
hierarchy, and then click Add to Row Area. Notice that the sales amount value is the same
for all members.
5. In the Solution Explorer, right-click the Reseller.dim dimension, and then click View
Designer.
6. In the Data Source View area of the Reseller.dim Dimension Designer tab, right click the
GeographyKey column, and then click New Attribute from Column.
7. Click the Cube Designer tab, and then click Dimension Usage tab. Notice that there is no
relationship between the Geography dimension and the Reseller Sales measure group.
8. On the Dimension Usage tab, click the box at the intersection of the Geography dimension
and the Reseller Sales measure group, and then click the ellipsis ()button in that box.
9. In the Define Relationship window, click Referenced in the Select relationship type box,
click Reseller in the Intermediate dimension box, click Geography Key in the Reference
dimension attribute box, click Geography Key in the Intermediate dimension attribute
box, and then click OK.
10. In Solution Explorer, right-click the Adventure Works OLAP solution, and then click Deploy.
11. When deployment has completed successfully, click the Browser tab of the Cube Designer,
and then click the Reconnect icon. Notice that the Reseller Sales SalesAmount measure
values are now displayed correctly for the Geographies hierarchy.
Task 2: Create a fact relationship
1. On the Adventure Works Cube.cube Designer tab, click the Cube Structure tab.
2. In the Dimensions pane, right-click anywhere, and then click Add Cube Dimension.

3. In the Add Cube Dimension window, click New dimension.


4. On the Welcome to the Dimension Wizard page, click Next.
5. On the Select Data Source View page, ensure that Adventure Works DSV is selected, and
then click Next.
6. On the Select the Dimension Type page, select Standard dimension, and then click Next.
7. On the Select the Main Dimension Table page, click dbo.FactInternetSales in the Main
table box, and then click Next.
8. On the Select Related Tables page, verify that no tables are selected, and then click Next.
9. On the Select Dimension Attributes page, clear the checkbox to the left of the Attribute
Name title to clear all selected attributes.
4-4 Implementing and Maintaining Microsoft SQL Server 2005 Analysis Services

10. Select the Customer PO Number dimension attribute, and then click Finish.
11. On the Completing the Wizard page, type Internet Sales Order Details in the Name box,
and then click Finish.

12. In the Add Cube Dimension window, click OK.


13. In Solution Explorer, right-click the Internet Sales Order Details.dim dimension and then
click View Designer.
14. In the Attributes pane, right-click Internet Sales and click Properties.
15. In the Properties pane, change the Name property to Item Description.
16. In the Properties pane, in the NameColumn list, click (new).

17. In the Object Binding window, click Column binding in the Binding type list, click Product
in the Source table list, click EnglishProductName in the Source column list, and then click
OK.
18. On the Dimension Structure tab, drag the SalesOrderNumber column from the Data
Source View pane to the Attributes pane to create a new attribute for the Sales Order
Number.
19. Drag the Sales Order Number attribute from the Attributes pane to the Hierarchies and
Levels pane.
20. Drag the Item Description attribute to just below the Sales Order Number level in the
Hierarchies and Levels pane.
21. In the Hierarchies and Levels pane, right-click Hierarchy, click Rename, and then type
Internet Sales Orders as the new hierarchy name.
22. Click the Adventure Works Cube.cube Designer tab.
23. In the Cube Designer, click the Dimension Usage tab. Notice that a fact relationship was
automatically created at the intersection of the Internet Sales OrderDetails dimension and
the Internet Sales measure group.
24. In Solution Explorer, right-click the Adventure Works OLAP solution, and then click
Deploy.

25. Wait for the Deployment Completed Successfully message.


26. Click the Browser tab of the Cube Designer, and then click the Reconnect icon.
27. On the Browser page, click anywhere in the Data pane, and then click the ClearResults
button.
28. In the Metadata pane, expand Measures, expand Internet Sales, expand Sales, and then
drag Internet Sales Sales Amount to the Drop Totals or Detail Fields Here area.

29. In the Metadata pane, expand Customer, Location, Customer Geography,Members, All
Customers, Australia, New South Wales, Goulburn, and 2580, right-click Alexandra H
Watson, and then click Add to Subcube Area.
30. In the Metadata pane, expand Internet Sales Order Details, and then drag the Internet
Sales Orders hierarchies to the Drop Row Fields Here area to view the two sales orders for
this customer.
Working with Measures and Measure Groups 4-5

Exercise 3: Configuring Measure Group Storage


Task 1: Reconfigure the Internet Sales measure group to use the HOLAP storage
mode
1. In the Cube Designer, click the Partitions tab.
2. In the Partition Name column, right-click the Internet Sales partition, and then click
Storage Settings.
3. In the Partition Storage Settings window, move the slider to the left to Real-time HOLAP,
and then click OK. Notice that the settings for the Internet Sales partition have changed to
Holap 0%.
Task 2: Design aggregations for the Internet Sales measure group
1. In the Partition Name column, right-click the Internet Sales partition, and then click
Design Aggregations.
2. On the Welcome to the Aggregation Design Wizard page, click Next.
3. On the Specify Storage and Caching Options page, click Next.
4. On the Specify Object Counts page, click Count.
5. After the counts have completed, expand the dimensions. Candidates to be aggregated are
note with a bold font. Notice that the relationships that were created earlier in the lab are
aggregate candidates.
6. On the Specify Object Counts page, click Next.
7. On the Set Aggregation Options page, select Performance gain reaches, notice the
default value of 30%, and then click Start. When the process is complete, note the number
of aggregations designed and the amount of disk space the aggregations will take.
8. On the Set Aggregation Options page, click Reset, change the Performance gain reaches
value to 50%, and then click Start.

Note: This process can take up to 4 minutes.

9. When the process is complete, note the number of aggregations designed and the amount
of disk space the aggregations will take, and then click Next.
10. On the Completing the Wizard page, verify that Save the aggregations but do not
process them is selected, and then click Finish.
Querying Multidimensional Analysis Solutions 5-1

Module 5
Querying Multidimensional Analysis Solutions
Contents:
Lab Answer Keys 2
5-2 Implementing and Maintaining Microsoft SQL Server 2005 Analysis Services

Lab Answer Keys


Lab: Querying a Cube
Exercise 1: Querying a Cube by Using MDX
Task 1: Write an MDX query to show Internet sales amounts across Customer
countries
1. Click Start, point to All Programs, point to Microsoft SQL Server 2005, and then click SQL
Server Management Studio.
2. In the Connect to Server window, click Analysis Services in the Server type box, verify that
MIAMI is selected in the Server name box, and then click Connect.
3. In SQL Server Management Studio, click the Analysis Services MDX Query button, and on
the Connect to Analysis Services window, click Connect.

Tip: You can hide Solution Explorer and Object Explorer by clicking their Auto Hide buttons.
Hiding these windows makes it easier to work in the MDX query editor.

4. In the MDX query editor, type the following code, and then click Execute.

SELECT
[Date].[Calendar Time].[Calendar Year].members ON COLUMNS,
[Customer].[Customer Geography].[Country-Region].members ON ROWS

FROM
[Adventure Works UDM]
WHERE
[Measures].[Internet Sales-Sales Amount]

5. View the results. Then click File, click Save MDXQuery1.mdx As, browse to the
D:\Labfiles\Starter folder, type Internet Sales-Country.mdx in the File name box, and then
click Save.
Task 2: Write an MDX query to show reseller sales amounts for 2003 and 2004
across countries
1. In SQL Server Management Studio, click the Analysis Services MDX Query button, and on
the Connect to Analysis Services window, click Connect.

2. In the MDX query editor, type the following code, and then click Execute.

SELECT
{
([Measures].[Reseller Sales-Sales Amount],
[Date].[Calendar Year].[CY 2003]),
([Measures].[Reseller Sales-Sales Amount],
[Date].[Calendar Year].[CY 2004])
} ON COLUMNS,
[Reseller Geography].[Geographies].[Country-Region].members
ON ROWS
FROM [Adventure Works UDM]

3. View the results. Then click File, click Save MDXQuery2.mdx As, browse to the
D:\Labfiles\Starter folder, type ResellerSales-Country-Year.mdx in the File name box, and
then click Save.
Querying Multidimensional Analysis Solutions 5-3

Task 3: Write an MDX query to show reseller sales amounts by country for
accessories, clothing, and components product categories
1. In SQL Server Management Studio, click the Analysis Services MDX Query button, and on
the Connect to Analysis Services window, click Connect.
2. In the MDX query editor, type the following code, and then click Execute.

SELECT
{
([Measures].[Reseller Sales-Sales Amount],
[Product].[Product Categories].[Category].&[4]),
([Measures].[Reseller Sales-Sales Amount],
[Product].[Product Categories].[Category].&[3]),
([Measures].[Reseller Sales-Sales Amount],
[Product].[Product Categories].[Category].&[2])
}
ON COLUMNS,
[Reseller Geography].[Geographies].[Country-Region]
ON ROWS
FROM [Adventure Works UDM]

3. View the results. Then click File, click Save MDXQuery3.mdx As, browse to the
D:\Labfiles\Starter folder, type Reseller Sales-Country-Category.mdx in the File name box,
and then click Save.
4. Close SQL Server Management Studio.

Exercise 2: Creating a Calculated Member


Task 1: Open the Adventure Works UDM solution
1. Click Start, point to All Programs, point to Microsoft SQL Server 2005, and then click SQL
Server Business Intelligence Development Studio.
2. On the File menu, point to Open, and then click Project/Solution.
3. On the Open Project window, click SourceSafe (LAN), click VSS, and then click Open.
4. On the Log On to Visual SourceSafe Database window, ensure that the User name is
Student and that the Password is empty, and then click OK.
5. In the Open Project window, double-click Adventure Works UDM.root, double click
Adventure Works UDM, click Adventure Works UDM.sln, and then click Open.
6. In Solution Explorer, right-click Adventure Works UDM.cube, and then click View
Designer.
Task 2: Create a calculated member in the Geographies hierarchy
1. In the Cube Designer, click the Calculations tab.
2. On the Calculations tab, click the New Calculated Member button.
3. In the Name box, type [European Reseller Totals].
4. In the Parent hierarchy list, expand Reseller Geography, click Geographies, and then click
OK.
5. Next to the Parent member box, click Change. Then click All Geographies, and then click
OK.
6. In the Expression box, type the following code:
5-4 Implementing and Maintaining Microsoft SQL Server 2005 Analysis Services

[Reseller Geography].[Geographies].[Country-Region].&[France] +
[Reseller Geography].[Geographies].[Country-Region].&[Germany] +
[Reseller Geography].[Geographies].[Country-Region].&[United Kingdom]

7. On the File menu, click Save All.


Task 3: Create a calculated member to determine the difference between sales
quotas and actual sales
1. On the Calculations tab, click the New Calculated Member button.

2. In the Calculations Expressions pane, type [Quota Difference] in the Name box, and then
verify that MEASURES is selected in the Parent hierarchy box.
3. In the Expression box, type the following code.

[Measures].[Sales Amount Quota] - [Measures].[Reseller Sales-Sales Amount]

4. Click Currency in the Format string box.


5. On the File menu, click Save All.
Task 4: Browse the new calculated members
1. In Solution Explorer, right-click the Adventure Works UDM project, and then click Deploy.
If you are prompted to overwrite the existing database, click Yes.
2. After deployment has completed successfully, click the Browser tab in the Cube Designer.
3. On the Browser page, click the Reconnect button.
4. Expand Measures, expand Reseller Sales, right-click Reseller Sales Sales Amount, and
then click Add to Data Area.
5. Expand Reseller Geography, and then drag the Geographies hierarchy to the Drop Row
Fields Here area. Verify that the European Reseller Totals value is the sum of the sales
amounts for France, Germany, and the United Kingdom.
6. Click the Clear Results button.
7. In the Metadata pane, expand Measures, expand Sales Quota, right-click Sales Amount
Quota, and then click Add to Data Area.
8. In the Metadata pane, under Measures, right-click Quota Difference, and then click Add to
Data Area.
9. In the Metadata pane, under Measures, expand Reseller Sales, right-click Reseller Sales
Sales Amount, and then click Add to Data Area.
10. In the Metadata pane, expand the Employee dimension, and then drag the Employee
Department hierarchy to the Drop Row Fields Here area. Verify that the Quota Difference
value is the amount of sales an employee or department needs to meet their quota.

Exercise 3: Defining a Named Set


Task 1: Define a named set for North American Customers in the Adventure
Works UDM cube
1. In Business Intelligence Development Studio, click the Calculations tab for the Adventure
Works UDM cube.
Querying Multidimensional Analysis Solutions 5-5

2. In the Script Organizer, highlight the line immediately before the SCOPE (ROOT()) line, and
then click the New Named Set button.
3. In the Expression pane, in the Name box type, [North American Customers].

4. In the Expression box, type the following code.

{[Customer].[Customer Geography].[Country-Region].&[Canada],[Customer].[Customer
Geography].[Country-Region].&[United States]}

5. On the File menu, click Save All.


6. In Solution Explorer, right-click the Adventure Works UDM project, and then click Deploy.
7. After deployment has completed successfully, click the Browser tab in the Cube Designer.
8. On the Browser page, click the Reconnect button.

9. In the Data pane, click anywhere, and then click the Clear Results button.
10. In the Metadata pane, expand Measures, expand Internet Sales, right-click Internet Sales
Sales Amount, and then click Add to Data Area.
11. In the Metadata pane, expand Customer, expand Location, and drag the Customer
Geography hierarchy to the Drop Row Fields Here area.
12. In the Metadata pane, under Customer, right-click North American Customers, and then
click Add to Subcube Area. Notice that the query results now only include data for Canada
and the United States.
13. Close Business Intelligence Development Studio.
Task 2: Define a query-scoped named set
1. Click Start, point to All Programs, point to Microsoft SQL Server 2005, and then click SQL
Server Management Studio.

2. In the Connect to Server window, click Analysis Services in the Server type box, verify that
MIAMI is selected in the Server name box, and then click Connect.
3. In the SQL Server Management Studio, click the Analysis Services MDX Query button,
and on the Connect to Analysis Services window, click Connect.
4. In the MDX query editor, type the following code, and then click Execute.

WITH SET [SportHelmets] AS


{
[Product].[Product Categories].[Product Name].&[214],
[Product].[Product Categories].[Product Name].&[217],
[Product].[Product Categories].[Product Name].&[222]
}
SELECT
[SportHelmets] ON COLUMNS,
{[Measures].[Internet Sales-Sales Amount]} ON ROWS
FROM [Adventure Works UDM]

5. View the results. Then click File, click Save MDXQuery1.mdx As, browse to the
D:\Labfiles\Starter folder, type Named Set Query.mdx in the File name box, and then click
Save.
Customizing Cube Functionality 6-1

Module 6
Customizing Cube Functionality
Contents:
Lab Answer Keys 2
6-2 Implementing and Maintaining Microsoft SQL Server 2005 Analysis Services

Lab Answer Keys


Lab: Customizing a Cube
Exercise 1: Implement a KPI
Task 1: Open and deploy the Adventure Works OLAP solution
1. Click Start, point to All Programs, point to Microsoft SQL Server 2005, and then click SQL
Server Business Intelligence Development Studio.
2. On the File menu, point to Open, and then click Project/Solution. Then browse to the
D:\Labfiles\Starter folder, click Adventure Works OLAP.sln, and then click Open.
3. In Solution Explorer, right-click the Adventure Works OLAP project, and then click Deploy.
Wait for the Deployment Completed Successfully message to appear before you proceed
to the next task.
Task 2: Create a KPI
1. In Solution Explorer, right-click Adventure Works Cube.cube, and then click View
Designer.
2. In the Cube Designer, click the KPIs tab.
3. On the KPIs tab, click the Reconnect button, and then click the New KPI button.
4. In the Name box, type Actual Sales VS Quotas
5. In the Associated measure group box, click Reseller Sales.
6. On the Metadata tab of the Calculation Tools pane, expand Measures, expand Reseller
Sales, and then drag Reseller Sales-Sales Amount to the Value Expression box.
7. On the Metadata tab of the Calculation Tools pane, expand Measures, expand Sales
Quotas, and then drag Sales Amount Quota to the Goal Expression box.
8. In the Status area, verify that Gauge is selected in the Status indicator box.
9. Type the following code in the Status expression box.

Case
When KpiValue( "Actual Sales VS Quotas" ) /
KpiGoal( "Actual Sales VS Quotas" ) >= .83
Then 1
When KpiValue( "Actual Sales VS Quotas" ) /
KpiGoal( "Actual Sales VS Quotas" ) < .83
And
KpiValue( "Actual Sales VS Quotas" ) /
KpiGoal( "Actual Sales VS Quotas" ) >= .80
Then 0
Else -1
End

Tip: You can copy the code for the status expression from the KPIExpressions.txt text file in
the D:\Labfiles\Starter folder.

10. Verify that Standard arrow is selected in the Trend indicator box.
11. Type the following code in the Trend Expression box.
Customizing Cube Functionality 6-3

Case
When IsEmpty
(ParallelPeriod
([Date].[Calendar Time].[Calendar Year],1,
[Date].[Calendar Time].CurrentMember))
Then 0
When (
KpiValue("Actual Sales VS Quotas") -
(KpiValue("Actual Sales VS Quotas"),
ParallelPeriod
([Date].[Calendar Time].[Calendar Year],1,
[Date].[Calendar Time].CurrentMember))
/
(KpiValue ("Actual Sales VS Quotas"),
ParallelPeriod
([Date].[Calendar Time].[Calendar Year],1,
[Date].[Calendar Time].CurrentMember)))
>=.02
Then 1
When(
KpiValue("Actual Sales VS Quotas") -
(KpiValue( "Actual Sales VS Quotas" ),
ParallelPeriod
([Date].[Calendar Time].[Calendar Year],1,
[Date].[Calendar Time].CurrentMember))
/
(KpiValue("Actual Sales VS Quotas"),
ParallelPeriod
([Date].[Calendar Time].[Calendar Year],1,
[Date].[Calendar Time].CurrentMember)))
<0
Then -1
Else 0
End

Tip: You can copy the code for the trend expression from the KPIExpressions.txt
text file in the D:\Labfiles\Starter folder.

Task 3: View the KPI


1. In Solution Explorer, right-click the Adventure Works OLAP project, and then click Deploy.
Wait for the Deployment Completed Successfully message to appear before you proceed.

2. On the KPIs tab, click the Browser View button, and then click the Reconnect button.
3. In the Filter pane, click Date in the Dimension box, click Calendar Year in the Hierarchy
box, click Equal in the Operator box, and then select CY 2002 and click OK in the Filter
Expression list. Then press ENTER to update the KPI display.
4. Leave the Business Intelligence Development Studio open.
5. Click Start, point to All Programs, point to Microsoft SQL Server 2005, and then click SQL
Server Management Studio.
6. In the Connect to Server window, in the Server type box, click Analysis Services. In the
Server name box, verify that MIAMI is selected, and then click Connect.
7. On the File menu, point to Open, and then click File. Then browse to the D:\Labfiles\Starter
folder, click KPIQuery.mdx, and then click Open.
6-4 Implementing and Maintaining Microsoft SQL Server 2005 Analysis Services

8. When prompted, ensure that MIAMI is selected in the Server name box, and then click
Connect.
9. In the Available Databases list, click Adventure Works OLAP.

10. Examine the MDX in the query editor.

Tip: Click the Auto Hide button on the Object Explorer and Solution Explorer windows to
make it easier to see the query editor.

11. Click Execute and examine the query results.

12. Close Microsoft SQL Server Management Studio.

Exercise 2: Implementing an Action


Task 1: Create a drillthrough action
1. In Business Intelligence Development Studio, click the Actions tab on the Adventure Works
Cube.cube Cube Designer
2. On the Actions page, click the New Drillthrough Action button.
3. In the Details pane, in the Name box, type Internet Sales Detail Drillthrough.
4. In the Details pane, in the Measure group members box, click Internet Sales.
5. In the Drillthrough Columns area of the Details pane, in the Dimensions box, click
Internet Sales Order Details. Then select Item Description and Order Number and click
OK in the Return Columns box.
Task 2: Deploy and test the action
1. In Solution Explorer, right-click the Adventure Works OLAP project, and then click
Deploy. Wait for the Deployment Completed Successfully message before you proceed.
2. On the Cube Designer, click the Browser tab, and then click the Reconnect button.
3. In the Metadata pane, expand Measures, expand Internet Sales, expand Sales, right-click
Internet Sales-Sales Amount, and then click Add to Data Area.
4. In the Metadata pane, expand Customer, expand Location, and drag the Customer
Geography hierarchy to the Drop Row Fields Here area.
5. Expand Canada, expand Alberta, expand Calgary, expand T2P 2G8, and then click the
Internet Sales Sales Amount value for Carly Yuan.
6. Right-click the Internet Sales Sales Amount value for Carly Yuan, and then click Internet
Sales Detail Drillthrough. View the sales details associated with this customer.
7. In the Data Sample Viewer, click Close.

Exercise 3: Implementing a Perspective


Task 1: Create a perspective for Internet marketing personnel
1. In the Cube Designer for Adventure Works Cube.cube, click the Perspectives tab.
2. On the Perspectives page, click the New Perspective button.
3. In the Perspective Name column, replace Perspective with Internet Marketing.
Customizing Cube Functionality 6-5

4. In the Perspective Name column, clear the Reseller Sales Measure Group checkbox to
clear all Reseller Sales measures check boxes.
5. Clear the check boxes for the Sales Quotas and Sales Quotas 1 measure groups.

6. Clear the check boxes for the Reseller, Reseller Geography, Sales Territory, Employee,
and Promotion dimensions.
7. Clear the check box for the Actual Sales VS Quotas KPI.
8. Clear the check box for the Large Resellers Named Set.
9. Clear the check boxes for all of the calculated members.
10. On the File menu, click Save All.

Task 2: View the perspective


1. In Solution Explorer, right-click the Adventure Works OLAP project, and then click
Deploy. Wait for the Deployment Completed Successfully message.
2. On the Browser page of the Cube Designer, click the Reconnect button.
3. Click anywhere in the Data pane, and then click the Clear Results button.
4. On the Browser page, in the Perspective box, click Internet Marketing.
5. In the Metadata pane, expand Measures. Notice that Internet Sales in the only measure
listed. Also notice that many of the dimensions are no longer listed.

Exercise 4: Implementing a Translation


Task 1: Add a translation for cube objects
1. In the Cube Designer for Adventure Works Cube.cube, click the Translations tab.
2. On the Translations page, click the New Translation button.
3. In the Select Language window, click French (France), and then click OK.
4. In the French (France) column, in the Internet Sales measure group box, type
VentesD'Internet.
5. In the French (France) column, in the Internet Sales Sales Amount box, type Quantit
de Ventesd'Internet.
6. In the French (France) column, in the Sales display folder box, type Ventes.
7. On the File menu, click Save All.
Task 2: Add a translation for the Time dimension
1. In Solution Explorer, right-click Time, and then click View Designer.
2. In the Time Dimension Designer, click the Translations tab.
3. On the Translations page, click the New Translation button.
4. In the Select Language window, click French (France), and then click OK.
5. In the French (France) column, in the Time dimension Caption box, type Temps.
6. In the French (France) column, in the All Periods box, type Toutes les Priodes.
7. In the French (France) column, in the Month Name box, type Moisd'Anne.
6-6 Implementing and Maintaining Microsoft SQL Server 2005 Analysis Services

8. In the Moisd'Anne box, click the ellipsis ().


9. In the Attribute Data Translation window, in the Translation columns list, click
FrenchMonthName, and then click OK.

10. On the File menu, click Save All.


Task 3: View the translated data
1. In Solution Explorer, right-click the Adventure Works OLAP project, and then click
Deploy.
2. Wait for the Deployment Completed Successfully message before you proceed.
3. Click the Cube Designer Tab, and then click the Browser tab.

4. On the Browser page, click the Reconnect button.


5. If necessary, click anywhere in the Data pane, and then click the Clear Results button.
6. On the Browser page, click French (France) in the Language box.
7. In the Metadata pane, expand Measures, expand Ventes D'Internet, expand Ventes, right-
click Quantit de Ventes d'Internet, and then click Add to Data Area.
8. In the Metadata pane, expand Date, expand Calendar, right-click Date.CalendarYear, and
click Add to Filter Area.
9. In the filter area, notice that Toutes les Priodesis selected, then in the Date.Calendar Year
list, select only CY 2003, and click OK.
10. In the Metadata pane, expand Date, right-click Date.Moisd'Anne, and then click Add to
Row Area.
Deploying and Securing an Analysis Services Database 7-1

Module 7
Deploying and Securing an Analysis Services Database
Contents:
Lab Answer Keys 2
7-2 Implementing and Maintaining Microsoft SQL Server 2005 Analysis Services

Lab Answer Keys


Lab: Deploying and Securing an Analysis Services Database
Exercise 1: Deploying an Analysis Services Database
Task 1: Use the Deployment Wizard to create a deployment script
1. Click Start, point to All Programs, point to Microsoft SQL Server 2005, point to Analysis
Services, and then click Deployment Wizard.
2. On the Welcome to the Analysis Services Deployment Wizard page, click Next.
3. On the Specify Source Analysis Services Database page, type
D:\Labfiles\Starter\Adventure Works OLAP\bin\Adventure Works OLAP.asdatabase in
the Database file box, and then click Next.

4. On the Installation Target page, change the value in the Database box to Adventure
Works OLAP Copy, and then click Next.
5. On the Specify Options for Partitions and Roles page, click Next.
6. On the Specify Configuration Properties page, click Next.
7. On the Select Processing Options page, click Next.
8. On the Confirm Deployment page, select the Create deployment script check box, and
then click Next.
9. On the Deploying Database page, wait for the deployment script to be completed, and
then click Next.
10. On the Deployment Complete page, click Finish.
Task 2: Review and run the deployment script
1. Click Start, point to All Programs, point to Microsoft SQL Server 2005, and then click SQL
Server Management Studio.
2. In the Connect to Server window, in the Server type list, click Analysis Services, verify that
MIAMI is selected in the Server name list, and then click Connect.
3. In SQL Server Management Studio, on the File menu, point to Open, and then click File.
4. In the Open File window, browse to the D:\Labfiles\Starter\Adventure Works OLAP\bin
folder, click Adventure Works OLAP Copy Script.xmla, and then click Open.

5. In the Connect to Analysis Services window, click Connect.


6. In the Query window, review the script. Notice the new databases name and ID of
Adventure Works OLAP Copy.
7. On the toolbar, click Execute. Wait for the query to finish executing.
8. In Object Explorer, expand Databases and verify that the Adventure Works OLAP Copy
database has been created. If the database is not listed, click the Refresh button on the
Object Explorer toolbar.
9. Keep Microsoft SQL Server Management Studio open for the next exercise.
Deploying and Securing an Analysis Services Database 7-3

Exercise 2: Securing an Analysis Services Database


Task 1: Set up the lab environment
1. Click Start, and then click My Computer.
2. Browse to the D:\Labfiles\Starter folder, and then double-click the Setup.cmd file and wait
for the cmd.exe window to close.

3. Close the folder window.


Task 2: Add a user to the Analysis Services Server role
1. In SQL Server Management Studio, in Object Explorer, refresh the Databases folder and
verify that the Adventure Works OLAP database has been created.
2. Right-click the MIAMI instance of Analysis Services, and then click Properties.
3. In the Analysis Server Properties window, under Select a page, click Security.

4. Click Add, and then in the Select Users or Groups window, in the Enter the object names to
select box, type ASAdmin, click Check Names, and then click OK.
5. Click OK to close the Analysis Server Properties dialog box.
6. Close SQL Server Management Studio.
Task 3: Add a new role with the ability to process the database
1. Click Start, point to All Programs, point to Microsoft SQL Server 2005, and then click SQL
Server Business Intelligence Development Studio.
2. On the File menu, point to Open, click Project/Solution, browse to the D:\Labfiles\Starter
folder, click Adventure Works OLAP.sln, and then click Open
3. In Solution Explorer, right-click Roles, and then click New Role.
4. In Solution Explorer, click Role.role.
5. In the Properties pane, change the File Name to DB Process Role.role, and then press
ENTER. When prompted, click Yes to change the object name as well.
6. On the General page of the Role Designer, select the Process database and Read
definition check boxes.
7. Click the Membership tab, and then in the Specify the users and groups for this role
area, click Add.
8. In the Select Users or Groups window, type ProcessAdmin, click Check Names, and then
click OK.
9. On the File menu, click Save All.
10. Close the Role Designer.
Task 4: Add a new role with specific cube and dimension permissions
1. In Solution Explorer, right-click Roles, and then click New Role.
2. In Solution Explorer, click Role1.role.
3. In the Properties pane, change the File Name to Marketing Manager Role.role, and then
press ENTER. When prompted, click Yes to change the object name as well.
7-4 Implementing and Maintaining Microsoft SQL Server 2005 Analysis Services

4. Click the Membership tab, and then in the Specify the users and groups for this role
area, click Add.
5. In the Select Users or Groups window, type DBradley, click Check Names, and then click
OK.
6. Click the Cubes tab, and then in the Cube area, in the Access column, click Read.
7. Click the Dimensions tab. Notice that the role has been automatically granted Read access
to all dimensions in the cube.
8. Click the Cell Data tab, and then select the Enable read permissions check box.
9. In the Allow reading of cube content box, type the following MDX code.

NOT Measures.CurrentMember IS [Measures].[Sales Amount Quota]

Note: You can copy this MDX code from D:\Labfiles\Starter\CellDataMDX.txt.

10. On the File menu, click Save All.


Task 5: Deploy the solution
1. In Solution Explorer, right-click the Adventure Works OLAP solution, and then click Deploy.
If prompted to overwrite the existing database, click Yes.
2. Wait for the Deployment Completed Successfully message.
Task 6: Test user security by using Business Intelligence Development Studio
1. Click the Role Designer, and then click the Cell Data tab.
2. Click Test cube security.
3. Notice the information line just below the toolbar stating that you are using the Marketing
Manager Role credentials.
4. In the Metadata pane, under Measures, expand Sales Quotas, right-click Sales Amount
Quota, and then click Add to Data Area.
5. In the Metadata pane, under Measures, expand Internet Sales, expand Sales, rightclick
Internet Sales Sales Amount, and then click Add to Data Area.
6. Notice that the value of the Sales Amount Quota is not visible.
7. Click the Close button to close the Adventure Works OLAP [Browse] window.
8. In Solution Explorer, right-click Adventure Works Cube.cube, and then click View
Designer.
9. In the Cube Designer, click the Browser tab.
10. On the Browser page, click the Change User button.
11. In the Security Context dialog box, click Roles, and then select the Marketing Manager
Role and click OK. Then click OK to close the Security Context dialog box.
12. In the Metadata pane, under Measures, expand Sales Quotas, right-click Sales Amount
Quota, and then click Add to Data Area.
13. In the Metadata pane, under Measures, expand Internet Sales, expand Sales, rightclick
Internet Sales Sales Amount, and then click Add to Data Area.
Deploying and Securing an Analysis Services Database 7-5

14. Notice that the value of the Sales Amount Quota is not visible.
15. On the Browser page, click the Change User button.
16. In the Security Context dialog box, click Roles, clear all currently selected roles, and then
select the DB Process Role. Then click OK to close the Security Context dialog box.
17. Notice that you cannot browse the cube.
18. Close Business Intelligence Development Studio.
Task 7: Test server role security
1. Click Start, point to All Programs, point to Microsoft SQL Server 2005, rightclick SQL
Server Management Studio, and then click Run as.
2. Select The following user, and then in the User name box, type ASAdmin and in the
Password box, type Pa$$w0rd. Click OK.
3. In the Connect to Server window, click Analysis Services in the Server type box, type
MIAMI in the Server name box, and then click Connect.
4. In Object Explorer, browse the Adventure Works UDM and Adventure Works OLAP
databases.
5. In Object Explorer, expand the Adventure Works UDM database, right-click Roles, and
then click New Role.
6. In the Create Role window, in the Role name box, type TestRole, and then click OK. Verify
that the new role is created.
7. In Object Explorer, right-click the new role, and then click Delete.
8. In the Delete Objects window, click OK, and then click OK to verify that you want to
proceed. Verify that the role is deleted.
9. Close SQL Server Management Studio.

Task 8: Test database level security


1. Click Start, point to All Programs, point to Microsoft SQL Server 2005, rightclick SQL
Server Management Studio, and then click Run as.
2. Select The following user, and then in the User name box, type ProcessAdmin, and in the
Password box, type Pa$$w0rd. Click OK.
3. In the Connect to Server window, click Analysis Services in the Server type box, type
MIAMI in the Server name box, and then click Connect.
4. In the Object Explorer, expand Databases and notice that only the Adventure Works OLAP
database is listed.
5. In the Object Explorer, right-click the Adventure Works OLAP database, and then click
Process.
6. In the Object list, in the Process Options list, click Process Default, and then click OK.
7. When the Process succeeded message appears, click Close.
8. In Object Explorer, expand the Adventure Works OLAP database, right-click Roles, and
then click New Role.
7-6 Implementing and Maintaining Microsoft SQL Server 2005 Analysis Services

9. In the Create Role window, in the Role name box, type TestRole, and then click OK. Then
click OK in the error message stating that this user does not have permissions to create new
objects.

10. In the Create Role window, click Cancel to close the window.
11. Close SQL Server Management Studio.
Task 9: Test user security
1. Click Start, point to All Programs, point to Microsoft SQL Server 2005, rightclick SQL
Server Management Studio, and then click Run as.
2. Select The following user, and then in the User name box, type DBradley, and in the
Password box, type Pa$$w0rd. Then click OK.
3. In the Connect to Server window, in the Server type box, click Analysis Services, type
MIAMI in the Server name box, and then click Connect.
4. In SQL Server Management Studio, on the File menu, point to Open, and then click File.
5. Browse to the D:\Labfiles\Starter folder, click the TestDBradley.mdx file, and click Open.
When prompted, click Connect to connect to the MIAMI instance of Analysis Services.

6. Execute the query and verify that you can view the values for the Reseller Sales - Sales
Amount measure, but not for the Sales Amount Quota measure.
7. Close SQL Server Management Studio.
Maintaining a Multidimensional Solution 8-1

Module 8
Maintaining a Multidimensional Solution
Contents:
Lab Answer Keys 2
8-2 Implementing and Maintaining Microsoft SQL Server 2005 Analysis Services

Lab Answer Keys


Lab: Maintaining an Analysis Services Database
Exercise 1: Configuring Processing
Task 1: Set up the lab environment
1. Click Start, and then click My Computer.
2. Browse to the D:\Labfiles\Starter folder, and then double-click setup.cmd.
3. Wait for the cmd.exe window to close, and then close the folder window.

Task 2: Write a script to perform a full process of the Reseller Sales partition
1. Click Start, point to All Programs, point to Microsoft SQL Server 2005, and then click SQL
Server Management Studio.
2. In the Connect to Server window, click Analysis Services in the Server type box, verify that
MIAMI is selected in the Server name box, and then click Connect.
3. Click the Auto Hide buttons to hide the Object Explorer and Solution Explorer windows.
4. In SQL Server Management Studio, click the Analysis Services XMLA Query button, and
then in the Connect to Analysis Services window, click Connect.
5. In the query window, type the following code.

<Batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Parallel>
<Process xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Object>
<DatabaseID>Adventure Works OLAP</DatabaseID>
<CubeID>Adventure Works DW</CubeID>
<MeasureGroupID>Reseller Sales</MeasureGroupID>
<PartitionID>Reseller Sales</PartitionID>
</Object>
<Type>ProcessFull</Type>
<WriteBackTableCreation>UseExisting</WriteBackTableCreation>
</Process>
</Parallel>
</Batch>

Note: The completed query is located in D:\Labfiles\Solution\ProcessPartition.xmla.

6. Click File, and then click Save XMLAQuery1.xmla As.


7. In the Save As dialog box, browse to the D:\Labfiles\Starter folder, then in the File name
box, type ProcessPartition.xmla, and then click Save.
8. Keep Microsoft SQL Server Management Studio open for the next task.
Task 3: Update the data in the relational Reseller fact table and then perform a
full process
1. In SQL Server Management Studio, on the File menu, point to Open, and then click File.
2. In the Open File dialog box, browse to the D:\Labfiles\Starter folder, click MDXQuery.mdx
and then click Open. In the Connect to Analysis Services dialogue box, click Connect.
Maintaining a Multidimensional Solution 8-3

3. On the SQL Server Analysis Services Editor toolbar, in the Available Databases list, click
Adventure Works OLAP.
4. Review the query. Then on the toolbar, click Execute. Note that the value of the Reseller
Sales-Sales Amount is $80,450,596.98
5. On the File menu, point to Open, and then click File.
6. In the Open File dialog box, browse to the D:\Labfiles\Starter folder, click
InsertNewFact.sql, and then click Open.
7. In the Connect to Database Engine dialog box, click Connect.
8. Review and execute the SQL script. This script adds a new row into the FactResellerSales
table.
9. Click the query tab for the MDXQuery.mdx file, and then execute the query. Note that the
Reseller Sales-Sales Amount value has not changed.

Note: If you can not see the query tab with the MDXQuery.mdx file, click the Active Files
icon in the Query pane.

10. Click the ProcessPartition.xmla tab, and then click Execute. This will perform afull process
of the Reseller Sales partition.
11. Click the MDXQuery.mdx tab, and then execute the query. Notice that the value of the
Reseller Sales amount is now $80,450,935.98.
12. Leave SQL Server Management Studio open for the next exercise.

Exercise 2: Implementing Logging and Monitoring


Task 1: Configure Logging for an Analysis Services instance
1. In Object Explorer, right-click the MIAMI instance of Analysis Services, and then click
Properties.
2. On the General page, in the Value column, in the Log\QueryLog\CreateQueryLogTable
row, click true.
3. On the General page, in the Value column, in the
Log\QueryLog\QueryLogConnectionString row, click the ellipsis ().
4. In the Connection Manager dialog box, in the Server name box, click MIAMI, and then
verify that Use Windows Authentication is selected.
5. In the Connect to a database area, verify that Select or enter a database name is selected,
click AdventureWorksDW, and then click OK.
6. On the General page, in the Value column, in the Log\QueryLog\QueryLogSampling row,
type 2.

Note: Setting a sampling rate of one in every two queries is too frequent for most production
environments; it is used here to overcome the low query volume on a test server.

7. On the General page, click OK.


8. If a message appears stating that changes will take place when Analysis Services is restarted,
click OK.
8-4 Implementing and Maintaining Microsoft SQL Server 2005 Analysis Services

9. In Object Explorer, right-click the MIAMI instance of Analysis Services, and then click
Restart. When prompted to confirm the restart, click Yes.
10. Leave SQL Server Management Studio open so that you can use it later in this exercise.

Task 2: Simulate activity in the database


1. Click Start, point to All Programs, point to Microsoft SQL Server 2005, point to
Performance Tools, and then click SQL Server Profiler.
2. In SQL Server Profiler, On the File menu, point to Open, and then click Trace File.
3. Browse to the D:\Labfiles\Starter folder, click playbacktrace.trc, and then click Open.
4. Press F5 to replay the trace. When prompted, click Connect.
5. In the Replay Configuration, click Replay events using multiple threads. This option
optimizes performance and disables debugging, and then click OK.
6. Wait for the replay to complete, and then close SQL Server Profiler.
Task 3: Run usage-based optimization for the Internet Sales partition
1. In SQL Server Management Studio, in Object Explorer, expand Databases, expand
Adventure Works OLAP, expand Cubes, expand Adventure Works Cube, expand
Measure Groups, expand Internet Sales, expand Partitions, right-click Internet Sales, and
then click Usage Based Optimization.
2. On the Welcome to the Usage-Based Optimization Wizard page, click Next.
3. On the Specify Query Criteria page, click Next.
4. On the Review the Queries that will be Optimized page, review the queries, and then click
Next.

5. On the Specify Storage and Caching Options page, click Next.


6. On the Specify Object Counts page, click Count, wait for the counts to finish, and then click
Next.
7. On the Set Aggregation Options page, click Performance gain reaches, verify that the
default value of 30% is selected, and then click Start.
8. Wait for the aggregation design to finish, and then click Next.

9. On the Completing the Wizard page, click Finish.


10. Leave SQL Server Management Studio open for the next exercise.

Exercise 3: Backing Up and Restoring an Analysis Services Database


Task 1: Back up the Adventure Works OLAP database
1. In SQL Server Management Studio, in Object Explorer, right-click the Adventure Works
OLAP database, and then click Back Up.
2. On the General page, change the Backup file to D:\Labfiles\Starter\Adventure Works
OLAP.abf.
3. In the Options section, select the Allow file overwrite checkbox, and then clear the Encrypt
backup file check box.
Maintaining a Multidimensional Solution 8-5

4. In the Backup Database window, click OK. When the backup completes, the Backup
Database window will automatically close.
Task 2: Create a restore script for the Adventure Works OLAP database.
1. In Object Explorer, right-click the Adventure Works OLAP database, and then click Restore.
2. In the Restore target section, in the Restore database box, click Adventure Works OLAP.
3. In the Restore target section, in the From backup file box, type
D:\Labfiles\Starter\Adventure Works OLAP.abf.
4. In the Options section, select the Allow database overwrite check box.
5. On the toolbar, click Script.

6. Close the Restore Database window without clicking OK.


7. View the XMLA script created. Save the script as AWOLAPRestore.xmla in the
D:\Labfiles\Starter folder.
Task 3: Test a restore of the Adventure Works OLAP database.
1. In the Object Explorer, right-click the Adventure Works OLAP database, and then click
Delete.

2. In the Delete Objects window, click OK. Then verify that the Adventure Works OLAP
database has been deleted.
3. Execute the AWOLAPRestore.xmla script.
4. Wait for the query to finish running.
5. In the Object Explorer, right-click the Databases folder, and then click Refresh. Then verify
that the Adventure Works OLAP database has been successfully restored.
Introduction to Data Mining 9-1

Module 9
Introduction to Data Mining
Contents:
Lab Answer Keys 2
9-2 Implementing and Maintaining Microsoft SQL Server 2005 Analysis Services

Lab Answer Keys


Lab: Implementing Data Mining
Exercise 1: Creating a Data Mining Structure
Task 1: Browse the data mining project and data source view
1. Click Start, point to All Programs, point to Microsoft SQL Server 2005, and then click SQL
Server Business Intelligence Development Studio.
2. On the File menu, point to Open, and then click Project/Solution. Next, browse to the
D:\Labfiles\Starter folder, click Adventure Works Data Mining.sln, and then click Open.
3. In Solution Explorer, right-click Adventure Works DM DSV, and then click View Designer.
4. Review the tables and views included in the data source view.

Task 2: Create a data mining structure


1. In Solution Explorer, right-click Mining Structures, and then click New Mining Structure.
2. On the Welcome to the Data Mining Wizard page, click Next.
3. On the Select the Definition Method page, verify that From existing relational database
or data warehouse is selected, and then click Next.
4. On the Select the Data Mining Technique page, in the Which data mining technique do
you want to use box, click Microsoft Time Series, and then click Next.
5. On the Select Data Source View page, verify that the Adventure Works DM DSV is
selected, and then click Next.
6. On the Specify Table Types page, select the Case check box for the vTimeSeries table, and
then click Next.
7. On the Specify the Training Data page, click the Key check boxes for the ModelRegion
and TimeIndex columns, click the Input and Predictable column check boxes for the
Quantity and Amount columns, and then click Next.

Note: This configuration will only work if the TimeIndex column is unique across each
individual value in the ModelRegion column.

8. On the Specify Columns Content and Data Type page, click Next.
9. On the Completing the Wizard page, change the Mining structure name to Sales
Forecasting, change the model name to Time Series Forecast, and then click Finish.
Task 3: Modify a data mining structure
1. In the Sales Forecasting.dmm designer, click the Mining Models tab.
2. Right-click Time Series Forecast column heading, and then click Set Algorithm
Parameters.
3. In the Algorithm Parameters dialog box, type {12} in the Value column of the
PERIODICITY_HINT row, and then click OK.
Introduction to Data Mining 9-3

Note: The hint tells the algorithm that the data repeats itself every twelve periods (the data is
organized in months per year.)

Exercise 2: Adding a Data Mining Model


Task 1: Add a Naive Bayes mining model to the Targeted Mailing mining
structure
1. In Solution Explorer, right-click the Targeted Mailing mining structure, and then click View
Designer.
2. In the Targeted Mailing.dmm designer, click the Mining Models tab.
3. On the Mining Model toolbar, click the Create a related mining model button.
4. In the New Mining Model dialog box, in the Model name box, type TM_Naive_Bayes.
Then in the Algorithm name box, click Microsoft Naive Bayes, and then click OK.
5. Read the message stating that some columns will not be supported, and then click Yes.
6. Notice that the Yearly Income and Age columns have a value of Ignore in the
TM_Naive_Bayes column.
Task 2: Add a Clustering mining model to the Targeted Mailing mining structure
1. On the Mining Model toolbar, click the Create a related mining model button.
2. In the New Mining Model dialog box, in the Model name box, type TM_Clustering, then
in the Algorithm name box, click Microsoft Clustering, and then click OK.

Exercise 3: Exploring Data Mining Models


Task 1: Deploy the data mining solution
1. In Solution Explorer, right-click the Adventure Works Data Mining solution, and then click
Deploy.
2. Wait for the Deployment Completed Successfully message.

Task 2: View the data mining model in the Sales Forecasting mining structure
1. Click the Sales Forecasting.dmm designer tab, and then click the Mining Model Viewer
tab.
2. In the Mining Model Viewer, verify that Time Series Forecast is selected in the Mining
Model box and that Microsoft Time Series Viewer is selected in the Viewer box.
3. In the Mining Model Viewer tab, click the Charts tab.

4. To the right of the Chart view, clear the check boxes for the M200 Europe:Quantity, M200
North America:Quantity, and M200 Pacific:Quantity series.

Tip: You can click the Auto Hide buttons to hide the various windows in the Microsoft
Visual Studio environment and make it easier to view the designer.

5. Review the chart displayed. Notice that the actual data is to the left of the vertical line and
noted by solid data lines, while predicted data is to the right of the vertical line and is noted
with dotted lines.
9-4 Implementing and Maintaining Microsoft SQL Server 2005 Analysis Services

Task 3: View the data mining models in the Targeted Mailing mining structure
1. Click the Targeted Mailing.dmm designer tab, and then click the Mining Model Viewer
tab.
2. In the Mining Model Viewer, verify that TM_Decision_Tree is selected in the Mining
Model name box and that Microsoft Tree Viewer is selected in the Viewer box.
3. On the Decision Tree page, in the Background box, click 1. This will chane the background
color of the nodes. The darker the color, the stronger the link to bicycle purchase.
4. In the Data area, use the scroll bars to view all of the nodes. Notice that people between the
ages of 33 and 40 who own no cars are most likely to buy a bicycle.
5. On the Mining Model Viewer page, click the Dependency Network tab.
6. All links are currently shown. Move the All Links slider down three stops. Notice that several
of the dependency lines disappear.
7. In the Data area, click the Bike Buyer node. Review the color legend at the bottom of the
page.
8. Move the All Links slider down to Strongest Links to find the most significant factor in
determining whether a customer will purchase a bicycle.

Exercise 4: Validating Data Mining Models


Task 1: View the accuracy of the mining models in the Targeted Mailing mining
structure
1. On the Targeted Mailing.dmm designer, click the Mining Accuracy Chart tab.
2. In the Select Input Table(s) area, click Select Case Table.
3. Verify that Adventure Works DM DSV is selected in the Data Source box.
4. In the Select Table window, in the Table/View Name box, click vTargetMail (dbo), and
then click OK.
5. In the Select predictable mining model columns to show in the lift chart area, click 1 the
Predict Value box of any mining model.
6. Click the Lift Chart tab.
7. After the Lift Chart has been built successfully, notice that the TM_Decision_Tree model is
the most accurate.
8. Click the Classification Matrix tab.
9. Review the matrix data and notice that it also confirms that the TM_Decision_Tree model is
the most accurate.
Implementing and Maintaining Microsoft SQL Server 2005 Analysis Services R-1

Resources
Contents:
Internet Links 2
R-2 Implementing and Maintaining Microsoft SQL Server 2005 Analysis Services

Internet Links
The Web sites listed below provide additional resources.
Analysis Services Overview
Analysis Services 2005 Performance Guide
Analysis Services 2005 Processing Architecture
Business Intelligence
Calculated Members and Key Performance Indicators (KPI)
Configuring the Analysis Services Query Log
Data Marts
Data Warehouse Design Considerations
Got Dot Net: Microsoft .NET Framework Community
Handling Data Integrity Issues in Analysis Services 2005
Introduction to SQL Server 2005 Analysis Services
Introduction to SQL Server 2005 Data Mining
Introduction to MDX Scripting in Microsoft SQL Server 2005
Microsoft Corporation
Microsoft Developer Network
Microsoft Internet Explorer
Microsoft Learning
Microsoft Product Support Services
Microsoft Security
Microsoft Visual Studio
SQL Server 2005 Analysis Services (SSAS) Server Properties
SQL Server 2005 Data Mining
Implementing and Maintaining Microsoft SQL Server 2005 Analysis Services R-3

Send Us Your Feedback


You can search the Microsoft Knowledge Base for known issues at Microsoft Help and Support before
submitting feedback. Search using either the course number and revision, or the course title.

Note Not all training products will have a Knowledge Base article if that is the case, please ask your
instructor whether or not there are existing error log entries.

Courseware Feedback
Send all courseware feedback to support@mscourseware.com. We truly appreciate your time and effort.
We review every e-mail received and forward the information on to the appropriate team. Unfortunately,
because of volume, we are unable to provide a response but we may use your feedback to improve your
future experience with Microsoft Learning products.

Reporting Errors
When providing feedback, include the training product name and number in the subject line of your e-
mail. When you provide comments or report bugs, please include the following:
Document or CD part number
Page number or location
Complete description of the error or suggested change
Please provide any details that are necessary to help us verify the issue.

Important All errors and suggestions are evaluated, but only those that are validated are added to the
product Knowledge Base article.