Contents
Overview 1
Building the Warehouse Cube 2
Lab A: Building the Warehouse Cube 8
Building the Sales Cube 16
Lab B: Building the Sales Cube 22
Building the Warehouse and Sales Virtual
Cube 28
Lab C: Building the Warehouse and Sales
Cube 33
Review 38
Module 18: Case
Study—Working with
the Foodmart Database
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
Information in this document is subject to change without notice. The names of companies,
products, people, characters, and/or data mentioned herein are fictitious and are in no way intended
to represent any real individual, company, product, or event, unless otherwise noted. Complying
with all applicable copyright laws is the responsibility of the user. No part of this document may
be reproduced or transmitted in any form or by any means, electronic or mechanical, for any
purpose, without the express written permission of Microsoft Corporation. If, however, your only
means of access is electronic, permission to print one copy is hereby granted.
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.
2000 Microsoft Corporation. All rights reserved.
Microsoft, BackOffice, MS-DOS, Windows, Windows NT, <plus other appropriate product
names or titles. Replace this example list with list of trademarks provided by copy editor.
Microsoft is listed first, followed by all other Microsoft trademarks in alphabetical order. > are
either registered trademarks or trademarks of Microsoft Corporation in the U.S.A. and/or other
countries.
<This is where mention of specific, contractually obligated to, third party trademarks, which are
added by the Copy Editor>
The names of companies, products, people, characters, and/or data mentioned herein are fictitious
and are in no way intended to represent any real individual, company, product, or event, unless
otherwise noted.
Other product and company names mentioned herein may be the trademarks of their respective
owners.
Module 18: Case Study—Working with the Foodmart Database iii
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
Instructor Notes
In this module, students apply concepts they have learned in modules 1 through
17 in the course 2074A, Designing and Implementing OLAP Solutions Using
Microsoft
®
SQL Server
™
2000. Students will use various cube and dimension
techniques to build cubes from the Foodmart 2000 database by using
Microsoft SQL Server 2000 Analysis Services.
In the labs, students are given high-level procedures and must recall the specific
steps and actions for creating various dimension and cube structures. Students
create a preliminary cube, and must then make changes to the cube by applying
dimension and level properties.
After completing this module, students will be able to:
!
Create a cube based on user requirements.
!
Create another cube with different dimensions and measures.
!
Build a virtual cube.
Materials and Preparation
This section lists the required materials and preparation tasks that you need to
teach this module.
Required Materials
To teach this module, you need the following materials:
!
Microsoft PowerPoint
®
file 2074A_18.ppt
Preparation Tasks
To prepare for this module, you should:
!
Perform all the student labs.
!
Read all the student materials.
!
Read the instructor notes and margin notes.
!
Practice integrating the demonstrations with the lecture.
!
Review the Trainer Preparation presentation for this module on the Trainer
Materials compact disc.
!
Review any relevant white papers that are located on the Trainer Materials
compact disc.
Presentation:
60 Minutes
Labs:
120 Minutes
iv Module 18: Case Study—Working with the Foodmart Database
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
Demonstration: Reviewing Lab A
In this demonstration, you will view and discuss the solutions of lab A.
The following demonstration procedures provide information that will not fit in
the margin notes or is not appropriate for student notes.
!
To restore a new database and define a data source
1. In Analysis Manager, right-click the server, click Restore Database, click
the Look in list, click the file
C:\Moc\2074A\Labfiles\L18\Answers\Module 18A.CAB, click Open,
click the Restore button, and then click Close.
2. Expand the Module 18A database, double-click the Data Sources folder,
right-click the FoodMart 2000 data source, and then click Edit.
3. Verify that FoodMart 2000 is selected in step 1. Click OK.
!
To view the Warehouse cube
1. Expand the Cubes folder, right-click Warehouse, and then click Edit.
2. Point out that the cube contains the dimensions shown in the following
table.
Dimension Dimension type
Product Shared
Time Shared
Warehouse Shared
Store Shared
First Opened Year Private
3. Highlight the fact that the cube contains the following measures:
• Units Ordered
• Units Shipped
• Warehouse Sales
• Warehouse Cost
• Maximum Supply Time
4. Drill down on each dimension and verify that students have the correct
number of levels in each dimension and that the levels are in the correct
order.
5. Drill down on the First Opened Year dimension and verify that students
have the correct expression in the Member Key Column and the Member
Name Column for the level.
Module 18: Case Study—Working with the Foodmart Database v
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
6. Click the Maximum Supply Time measure, and verify that students use the
Max Aggregate Function to define the measure.
7. Edit each of the three calculated members, and verify that students use the
correct expressions to define each calculated member.
8. Close the Cube Editor.
9. Expand the Warehouse cube, expand the Partitions folder, and verify that
students have two partitions defined in the cube: one partition for 1998
inventory data and one for 1997 inventory data.
vi Module 18: Case Study—Working with the Foodmart Database
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
Demonstration: Reviewing Lab B
In this demonstration, you will view and discuss the solutions of lab B.
The following demonstration procedures provide information that will not fit in
the margin notes or is not appropriate for student notes.
!
To restore a new database and define a data source
1. In Analysis Manager, right-click the server, click Restore Database, click
the Look in list, click the file
C:\Moc\2074A\Labfiles\L18\Answers\Module 18B.CAB, click Open,
click the Restore button, and then click Close.
2. Expand the Module 18B database, double-click the Data Sources folder,
right-click the FoodMart 2000 data source, and then click Edit.
3. Verify that FoodMart 2000 is selected in step 1. Click OK.
!
To view the Sales cube
1. Expand the Cubes folder, right-click Sales, and then click Edit.
2. Point out that the cube contains the dimensions shown in the following
table.
Dimension Dimension type
Store Shared
Product Shared
Time Shared
Quarter Virtual
Customer Shared
Gender Private
Education Virtual
Yearly Income Virtual
3. Highlight the fact that the cube contains the following measures:
• Store Sales
• Store Cost
• Unit Sales
4. Notice the Customer dimension.
The Customer dimension contains the Customer level that uses the
customer_id as the Member Key Column, and lname, fname as the
Member Name Column.
Demonstration:
10 Minutes
Module 18: Case Study—Working with the Foodmart Database vii
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
5. Notice the Product dimension. The Product Name level is disabled in the
Cube Editor.
6. Edit each of the three calculated members, and verify that students use the
correct expressions to define each calculated member.
7. Close the Cube Editor.
8. Expand the Sales cube, expand the Partitions folder, and verify that
students have three partitions defined in the cube: one partition for 1997
sales data, one for 1998 sales data, and one for 1998 December sales data.
viii Module 18: Case Study—Working with the Foodmart Database
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
Demonstration: Reviewing Lab C
In this demonstration, you will view and discuss the solutions of lab C.
The following demonstration procedures provide information that will not fit in
the margin notes or is not appropriate for student notes.
!
To restore a new database and define a data source
1. In Analysis Manager, right-click the server, click Restore Database, click
the Look in list, click the file
C:\Moc\2074A\Labfiles\L18\Answers\Module 18C.CAB, click Open,
click the Restore button, and then click Close.
2. Expand the Module 18C database, double-click the Data Sources folder,
right-click the FoodMart 2000 data source, and then click Edit.
3. Verify that FoodMart 2000 is selected in step 1. Click OK.
!
To view the Warehouse and Sales virtual cube
1. Expand the Cubes folder, right-click Warehouse and Sales, and then click
Edit.
2. Point out that the cube contains the following dimensions:
• Time
• Product
• Store
• Customer
3. Highlight the fact that the cube contains the following measures:
• Units Shipped
• Store Cost
• Store Sales
• Warehouse Sales
• Warehouse Cost
4. Edit the Average Shipped Cost calculated member, and verify that students
use the correct expression to define the calculated member.
5. Verify that Average Selling Price does not exist in the cube.
6. Close the Virtual Cube Editor.
Demonstration:
10 Minutes
Module 18: Case Study—Working with the Foodmart Database ix
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
Other Activities
Difficult Questions
Below are difficult questions that students may ask you during the delivery of
this module and answers to the questions. These materials delve into subjects
that are within the scope of the module but are not specifically addressed in the
content of the student notes.
1. How can you temporarily add 1997 inventory data to the Warehouse cube?
You can incrementally update the Warehouse cube, defining the
inventory_fact_1997 as the fact table from which to retrieve data.
2. What is an easy way to create the First Opened Year dimension in the
Warehouse cube?
In the Warehouse Cube Editor, create a new dimension by using the
Dimension Wizard. Select the store table as the dimension table, create
the dimension as a Time dimension, and then define the hierarchy
containing two levels—year and month. At the end of the wizard, clear
the Share this dimension with other cubes check box.
After the dimension appears in the cube tree view, you can delete the
month level, leaving one level, First Opened Date. Rename the level
First Opened Year.
x Module 18: Case Study—Working with the Foodmart Database
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
Module Strategy
Use the following strategy to present this module:
!
Building the Warehouse Cube
Begin by defining the schema that students will use to build the Warehouse
cube. Let students know which tables to use, and then introduce the
dimensions and levels that they will create. Next, introduce the measures to
include in the cube. Finally, define the calculated members to create.
!
Building the Sales Cube
Introduce the schema of the Sales cube. Let students know which tables to
use. Next, introduce the dimensions and levels that they will create and then
introduce the measures to include. Finally, define the calculated members to
create.
!
Building the Warehouse and Sales Virtual Cube
Explain that students will be creating a virtual cube named Warehouse and
Sales by combining the Warehouse cube and the Sales cube. Introduce the
dimensions and levels to be included, and then define which measures to
add. Finally, explain that students will add calculated members by using two
different methods—creating a new one, and importing several from the
source cubes.
Module 18: Case Study—Working with the Foodmart Database 1
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
Overview
!
Building the Warehouse Cube
!
Building the Sales Cube
!
Building the Warehouse and Sales Virtual Cube
In this module, you will apply the concepts learned in modules 1 through 17 in
the course 2074A, Designing and Implementing OLAP Solutions Using
Microsoft
®
SQL Server
™
2000 by creating various cubes from the Foodmart
2000 database.
After completing this module, you will be able to:
!
Create a cube based on user requirements.
!
Create another cube with different dimensions and measures.
!
Build a virtual cube.
Topic Objective
To provide an overview of
the module topics and
objectives.
Lead-in
In this module, you will
apply the concepts learned
in modules 1 through 17 of
the course 2074A,
Designing and Implementing
OLAP Solutions Using
Microsoft SQL Server 2000
by creating various cubes
from the Foodmart 2000
database.
2 Module 18: Case Study—Working with the Foodmart Database
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
#
##
#
Building the Warehouse Cube
!
Defining the Warehouse Schema
!
Introducing the Dimensions and Levels
!
Analyzing the Measures
!
Defining the Calculated Members
In this section, you will learn about the schema of the database used to create
the Warehouse cube by using Microsoft SQL Server 2000 Analysis Services.
In addition, you will learn about the dimensions, measures, and calculated
members that you will create in the Warehouse cube.
Topic Objective
To introduce the database,
dimensions, and levels in
the Warehouse cube.
Lead-in
In this section, you will learn
about the database that you
use to build the Warehouse
cube. In addition, you will
learn about the dimensions
and measures of the cube.
Module 18: Case Study—Working with the Foodmart Database 3
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
Defining the Warehouse Schema
The Foodmart 2000 database contains tables that you will use to create the
Warehouse cube.
You will create a cube that tracks Units Ordered, Units Shipped, Warehouse
Sales, Warehouse Cost, Maximum Supply Time, and Margin. Users need to
see these numeric values by Warehouse, by Store, by Time period, and by
Product. You will need to include two years worth of data, as well as the
variance of the two years—1997 and 1998. In addition, users want to evaluate
the all the values based on the year in which the stores opened.
The tables that you will use to build the cube are the following:
!
Inventory fact tables—for 1997 and 1998 data
!
time_by_day
!
product
!
product_class
!
store
!
warehouse
!
warehouse_class
Topic Objective
To introduce the
Warehouse schema that
students use to build the
Warehouse cube.
Lead-in
You will be creating the
Warehouse cube by using
the tables in the Foodmart
2000 Microsoft Access 2000
database.
Delivery Tips
Let students know that they
can turn back to this page
during the lab to identify
levels and tables used to
build dimensions.
Students can also open the
database themselves in
Access by navigating to
\Program Files\Analysis
Services\Samples on their
computers and opening
Foodmart 2000.mdb.
4 Module 18: Case Study—Working with the Foodmart Database
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
Introducing the Dimensions and Levels
!
Product
!
Time
!
Warehouse
!
Store
!
First Opened Year
You will create five dimensions in the Warehouse cube. Before creating each
dimension, you will determine the source table and the levels that are required
to build the dimension.
Product
Define the shared Product dimension by using the tables product and
product_class. The Product dimension contains six levels:
!
Product Family
!
Product Department
!
Product Category
!
Product Subcategory
!
Brand Name
!
Product Name
Time
Define the shared Time dimension by using the time_by_day table. The Time
dimension contains three levels:
!
Year
!
Quarter
!
Month
Be certain that the Time dimension levels are specified with the proper Level
Type properties.
Topic Objective
To introduce the dimensions
and levels created in the
Warehouse cube.
Lead-in
You will create five
dimensions in the
Warehouse cube.
Delivery Tips
For classes with more
experienced students,
briefly highlight the fact that
they will be creating several
dimensions in lab A. Do not
cover the dimension
structures in detail.
For less advanced classes,
use this page as an
opportunity to prepare
students for the lab by
discussing each of the
dimensions in detail.
Module 18: Case Study—Working with the Foodmart Database 5
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
Warehouse
Define the shared Warehouse dimension by using the tables warehouse and
warehouse_class. The Warehouse dimension contains four levels:
!
Country
!
Description
!
State
!
Warehouse
Store
Define the shared Store dimension by using the store table. The Store
dimension contains four levels:
!
Store Country
!
Store State
!
Store City
!
Store Name
First Opened Year
Define the private First Opened Year dimension by using the store table. This
defines the year in which each store first opened.
Use an expression to generate the year for this dimension by using the datepart
function.
6 Module 18: Case Study—Working with the Foodmart Database
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
Analyzing the Measures
!
Units Ordered
!
Units Shipped
!
Warehouse Sales
!
Warehouse Cost
!
Maximum Supply Time
You will create five measures in the Warehouse cube. All measures come from
the inventory fact tables. The measures to include in the cube are:
!
Units Ordered
!
Units Shipped
!
Warehouse Sales
!
Warehouse Cost
!
Maximum Supply Time
Topic Objective
To describe the use of
measures in the
Warehouse cube.
Lead-in
You will create five
measures in the
Warehouse cube.
Module 18: Case Study—Working with the Foodmart Database 7
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
Defining the Calculated Members
!
Margin
$
Warehouse Sales minus Warehouse Cost
!
1998 versus 1997 Variance
$
The difference between the two years
!
USA + Canada
$
Rollup created by using the Sum function
You will create three calculated members in the Warehouse cube. The
calculated members to include in the cube are:
!
Margin. Warehouse Sales - Warehouse Cost.
!
1998 versus 1997 Variance. The difference between the two years.
!
USA + Canada. The rollup of the two members created by using the Sum
function.
Topic Objective
To describe the use of
calculated members in the
Warehouse cube.
Lead-in
You will create three
calculated members in the
Warehouse cube.
8 Module 18: Case Study—Working with the Foodmart Database
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
Lab A: Building the Warehouse Cube
Objectives
After completing this lab, you will be able to:
!
Create a new cube from start to finish.
!
Create several dimensions in a cube.
!
Verify results of a cube.
Prerequisites
Before working on this lab, you must have:
!
Experience working with dimensions.
!
An understanding of dimensions, cubes, and measures.
!
Experience working with the Cube Editor and the Dimension Editor.
!
Experience working with the Calculated Member Builder.
For More Information
This module uses the Analysis Manager to create a new cube with several
dimensions. For more information, note the following references.
The Dimension Editor
For more information on using the Dimension Editor interface and creating
dimensions, see module 4, "Building Dimensions Using the Dimension Editor,"
and module 5, “Using Advanced Dimension Settings,” in course 2074A,
Designing and Implementing OLAP Solutions Using Microsoft SQL Server
2000.
Topic Objective
To introduce the lab.
Lead-in
In this lab, you will create a
new cube, Warehouse,
from start to finish.
Explain the lab objectives.
Module 18: Case Study—Working with the Foodmart Database 9
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
The Cube Editor
For more information on using the Cube Editor, see module 6, "Working with
Cubes and Measures," in course 2074A, Designing and Implementing OLAP
Solutions Using Microsoft SQL Server 2000.
Calculated Members
For more information on creating calculated members, see module 11,
"Implementing Calculations Using MDX," in course 2074A, Designing and
Implementing OLAP Solutions Using Microsoft SQL Server 2000.
Partitions
For more information on creating partitions, see module 10, "Managing
Partitions," in course 2074A, Designing and Implementing OLAP Solutions
Using Microsoft SQL Server 2000.
Estimated time to complete this lab: 60 minutes
10 Module 18: Case Study—Working with the Foodmart Database
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
Exercise 1
Creating the Warehouse Cube
In this exercise, you will create a new cube, Warehouse, which contains five
dimensions with varying specifications, levels, and structures. In addition, the
cube contains five measures and three calculated members. You will process
the cube and will confirm that the cube is correct by verifying cube values.
The lab provides high-level procedures for you to follow. If you do not
remember the specific steps for a procedure, refer to the modules outlined in the
For Your Information section of the lab.
If you still cannot determine the proper steps for a single procedure, then refer
to the corresponding answer files, which are located in:
C:\Moc\2074A\Labfiles\L18\Answers
!
To create a new database
1. In Analysis Manager, create a new database, and then name the database
Module 18.
2. Create a new data source in Module 18.
3. On the Provider tab of the Data Link Properties dialog box, click the
Microsoft OLE DB Provider for ODBC Drivers. Click Next.
4. On the Connection tab, click the Use data source name list, and then click
Foodmart 2000.
5. Click Test Connection to verify that the Foodmart 2000 data source is
available to the local server.
6. Click OK, and close the Data Link Properties dialog box.
!
To create a new cube
1. In the Module 18 OLAP database, create a new cube containing the
following five measures defining 1998 inventory data:
• Units Ordered
• Units Shipped
• Warehouse Sales
• Warehouse Cost
• Maximum Supply Time
2. Create and add the following five dimensions to the Warehouse cube:
• Product
• Time
• Warehouse
• Store
• First Opened Year
Module 18: Case Study—Working with the Foodmart Database 11
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
To determine the tables and columns to include in the dimensions,
browse the dimension tables either in Analysis Manager or in the database
schema presented earlier in the module.
Use the following table to create the dimensions with various dimension
specifications.
Dimension Name Dimension Type Levels/Members
Product Shared Six levels: Product
Family, Product
Department, Product
Category, Product
Subcategory, Brand
Name, Product Name
Time Shared Three levels: Year,
Quarter, Month
Warehouse Shared Four levels: Country,
Description, State,
Warehouse
Store Shared Four levels: Store
Country, Store State,
Store City, Store Name
First Opened Year Private One level: First Opened
Year, derived by using the
datepart time function
3. Name the cube Warehouse.
4. Process the cube, without defining aggregations or storage mode.
Tip
12 Module 18: Case Study—Working with the Foodmart Database
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
!
To verify cube results
1. In the cube browser, verify that you retrieve $261.15 for the following
member combination:
• May 1998
• CA stores
• Drink products
• First Opened Year of 1971
• Warehouse Sales
• All Warehouse
2. Verify that you retrieve 106 for the following member combination:
• 1998
• All Stores
• Beer products
• All First Opened Year
• Units Ordered
• Canada Warehouses
3. Why do you not receive any data for 1997?
You were told to define the measures for 1998 inventory data.
Therefore, you defined the fact table as inventory_fact_1998.
____________________________________________________________
____________________________________________________________
Module 18: Case Study—Working with the Foodmart Database 13
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
Exercise 2
Updating the Warehouse Cube
In this exercise, you will modify the Warehouse cube by adding calculated
members and retrieving data from another fact table containing 1997 data.
!
To add 1997 data to Warehouse
• In the Warehouse cube, update the cube to permanently include inventory
data for 1997.
!
To create calculated members
• In the Warehouse cube, create the following three calculated members:
• Margin
Warehouse Sales - Warehouse Cost
• 1998 versus 1997 Variance
The difference between 1998 and 1997
• USA + Canada Stores
A rollup created by using the Sum function
To define a multidimensional expressions (MDX) set with only two
members, the syntax is the following: {member1, member2}. Notice the
braces surrounding the two members and the comma separating the two
members.
!
To verify cube results
1. In the cube browser, verify that you retrieve 96 for the following member
combination:
• 1997
• USA stores
• Seafood products
• First Opened Year of 1959
• Units Shipped
• All Warehouse
2. Verify that you retrieve $191,141.64 for the following member
combination:
• All Time
• USA + Canada Stores
• All Product
• All First Opened Year
• Warehouse Cost
• All Warehouse
Ti
p
14 Module 18: Case Study—Working with the Foodmart Database
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
3. Verify that you retrieve 157,890 for the following member combination:
• 1998 versus 1997 Variance
• All Store
• All Product
• All First Opened Year
• Units Shipped
• All Warehouse
4. Verify that you retrieve $26,582.61 for the following member combination:
• All Time
• All Store
• Drink products
• All First Opened Year
• Margin
• All Warehouse
5. Save the Warehouse cube, and then close the Cube Editor.
Module 18: Case Study—Working with the Foodmart Database 15
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
Demonstration: Reviewing Lab A
In this demonstration, you will view and discuss the solutions of lab A.
Topic Objective
To demonstrate solutions to
lab A.
Lead-in
In this demonstration, you
will view and discuss the
solutions to lab A.
Delivery Tips
The steps for this
demonstration are included
in the Instructor Notes.
Encourage students to
follow along with the
demonstration by comparing
their Warehouse cube to
the archived version that
you demonstrate.