You are on page 1of 759

Introduction

Contents

Introduction 1
Course Materials 2
Prerequisites 3
Course Outline 4
Course Outline (continued) 6
Microsoft Certified Professional Program 8
Facilities 10
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 should be
listed.>

Other product and company names mentioned herein may be the trademarks of their respective
owners.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Introduction iii

Instructor Notes
Presentation: The Introduction module provides students with an overview of the course
30 Minutes content, materials, and logistics for course 2074A, Designing and Implementing
OLAP Solutions with Microsoft SQL Server 2000.

Course Materials and Preparation


Required Materials
To teach this course, you need the following materials:
! Delivery Guide
! Trainer Materials compact disc

Preparation Tasks
To prepare for this course, you must:
! Complete the Course Preparation Checklist that is included with the trainer
course materials.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


iv Introduction

Module Strategy
Use the following strategy to present this module:
! Course 2074A: Designing and Implementing OLAP Solutions with
Microsoft SQL Server 2000.
Show the slide that displays the course number and course title.
! Introduction
Welcome students to the course and introduce yourself. Provide a brief
overview of your background to establish credibility.
Have students introduce themselves and provide their backgrounds, product
experience, and expectations of the course.
Record student expectations on a white board or flip chart that you can
reference later in class.
! Course Materials
Explain the purpose of all materials used in this course.
Tell students that they will have an opportunity at the end of class to
provide feedback on the course and facilities by using the Microsoft Online
Evaluation System.
! Prerequisites
Provide the students with the list of prerequisites that they should have met
before taking this course. This is an opportunity for you to identify students
who may not have the appropriate background or experience to attend this
course.
! Course Outline
Provide an overview of each module and what students will learn.
Explain how this course will meet students’ expectations by relating the
information covered in individual modules to their expectations.
! Microsoft Certified Professional Program
Inform students about the Microsoft Certified Professional (MCP) program
and the various certification options.
! Facilities
Explain the facility information for the training site.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Introduction 1

Introduction
Topic Objective
To introduce yourself,
establish credibility, meet ! Name
students, and set student
expectations for the course. ! Company Affiliation
Lead-in ! Title/Function
Good morning. Welcome to
Designing and Implementing ! Job Responsibility
OLAP Solutions Using
Microsoft SQL Server 2000. ! Database Design, Administration, and Implementation
Experience
My name is...
! Analysis Services or OLAP Experience
! Data Warehousing Experience
! Expectations for the Course

Introduce yourself.

Provide a brief overview of


your background to
establish credibility as an
online analytical processing
(OLAP) instructor.

Ask students to introduce


themselves, addressing the
bulleted items on the slide.
Delivery Tip
As students introduce
themselves, use a white
board or flip chart to record
their expectations of the
course.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


2 Introduction

Course Materials
Topic Objective
To identify and describe the
course materials.
Lead-in ! Name Card
We have provided ! Student Workbook
everything you need for this
course. You will find the ! Student Materials Compact Disc
following materials at your
desk... ! Course Evaluation

Describe the contents of the The following materials are included with your kit:
student workbook and the
Student Materials compact ! Name card. Write your name on both sides of the name card.
disc. ! Student workbook. The student workbook contains the material covered in
class, in addition to the hands-on lab exercises.
Have students write their
names on both sides of the ! Student Materials compact disc. The Student Materials compact disc
name card. contains the Web page that provides students with links to resources
pertaining to this course, including additional readings, review and lab
Tell students that a course answers, lab files, multimedia presentations, and course-related Web sites.
evaluation must be
completed at the end of the
Note To open the Web page, insert the Student Materials compact disc into
course.
the CD-ROM drive and then, in the root directory of the compact disc,
Tell students where they double-click Default.htm.
can send comments.
Delivery Tip ! Course evaluation. At the conclusion of this course, please complete the
Demonstrate how to open course evaluation to provide feedback on the instructor, course, and
the Web page provided on software product. Your comments will help us improve future courses.
the Student Materials
To provide additional comments on course materials, send e-mail to
compact disc. On the
Trainer Materials compact
mstrain@microsoft.com. Be sure to type Course 2074A in the subject line.
disc, double-click To provide additional comments or inquire about the Microsoft Certified
Default.htm in the Professional program, send e-mail to mcp@msprograms.com.
StudntCD folder.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Introduction 3

Prerequisites
Topic Objective
To present and describe the
prerequisites for this course.
Lead-in ! Understanding of Basic Database Design,
The following prerequisite Administration, and Implementation Concepts
knowledge is needed for this
course.
! Experience with Microsoft Windows 2000

This course requires that you meet the following prerequisites:


! Understanding of basic database design, administration, and implementation
concepts.
! Experience with Microsoft Windows® 2000.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


4 Introduction

Course Outline
Topic Objective
To provide an overview of
each module and what ! Module 1: Introduction to Data Warehousing and OLAP
students will learn. ! Module 2: Introducing Analysis Manager Wizards
Lead-in ! Module 3: Understanding Analysis Services Architecture
In this course, we will
cover... ! Module 4: Building Dimensions Using the Dimension Editor
! Module 5: Using Advanced Dimension Settings
! Module 6: Working with Cubes and Measures
! Module 7: Case Study—Creating the Store Expense Cube
! Module 8: Managing Storage and Optimization
! Module 9: Processing Dimensions and Cubes

Module 1, “Introduction to Data Warehousing and OLAP,” introduces you to


data warehousing and online analytical processing (OLAP). After completing
this module, you will be able to describe characteristics, goals, and applications
Briefly describe each of a data warehouse, explain the need and use for OLAP solutions, and describe
module. data warehouse design. You also will be able to explain the reasons for
implementing OLAP models, describe their components, and visualize a
As you describe each multidimensional database.
module, acknowledge any
information that will meet Module 2, “Introducing Analysis Manager Wizards,” gives you a
the student expectations comprehensive introduction to cube building fundamentals by using the
that you recorded earlier. Analysis Manager wizards. After completing this module, you will be able to
describe Microsoft SQL Server 2000 Analysis Server components, navigate
through the basic interfaces of Analysis Manager, and prepare to create a cube
by reviewing data sources and initiating the Cube Wizard. You also will be able
to create an OLAP cube by using the Cube Wizard and the Dimension Wizard,
process the cube, and browse the cube data and metadata by using the Analysis
Manager browser.
Module 3, “Understanding Analysis Services Architecture,” provides an
architectural foundation for the various system components. After completing
this module, you will be able to describe the components of the Microsoft data
warehousing strategy, the SQL Server Analysis Server architecture, and the
function of the metadata repository. You also will be able to explain the basic
differences between the three storage modes for OLAP cubes, describe client
architecture and the role of Microsoft PivotTable® Service (PTS), and recognize
Microsoft Office 2000 OLAP capabilities.
Module 4, “Building Dimensions Using the Dimension Editor,” teaches you
about the Dimension Editor and how to use it to create and manage dimensions.
After completing this module, you will be able to describe dimension
fundamentals, explain when to use shared and private dimensions, and describe
the characteristics of standard dimensions. You also will be able to add level
properties to dimensions and develop parent-child dimensions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Introduction 5

Module 5, “Using Advanced Dimension Settings,” consists of a solutions-


oriented discussion of various advanced dimension settings and methods used
to develop OLAP dimensions and cubes. After completing this module, you
will be able to work with dimension levels and hierarchies, understand and
work with time dimensions, and create custom rollup dimensions. You also will
be able to define member properties at dimension levels and create virtual
dimensions from member properties and member levels.
Module 6, “Working with Cubes and Measures,” explains how to use the Cube
Editor to create and manipulate cubes, add measures and dimensions, and use
properties to enhance cubes. After completing this module, you will be able to
define the required components of cubes, create cubes by using the Cube
Editor, and describe the characteristics of measures. You also will be able to
assign properties to measures, modify cube properties by using the Cube Editor,
and disable levels of shared dimensions.
Module 7, “Case Study—Creating the Store Expense Cube,” allows you to
create an OLAP cube and several dimensions from start to finish. After
completing this module, you will be able to create a cube based on end-user
requirements, update dimensions, and add new dimensions to a cube.
Module 8, “Managing Storage and Optimization,” explains that designing the
storage mode and aggregations for a cube is one of the most crucial steps in
cube development. After completing this module, you will be able to explain
the advantages and disadvantages of the three data storage modes, use the
Storage Design Wizard to set storage design, and describe how aggregations
work. You also will be able to design aggregations for cubes, describe the
concepts and mechanics of usage-based optimization, and override aggregation
settings per dimension.
Module 9, “Processing Dimensions and Cubes,” describes how to manage
dimension and cube processing with Analysis Services. After completing this
module, you will be able to understand the difference between OLAP schema
and data, process dimensions, and perform the three types of cube processes.
You also will be able to optimize and troubleshoot cube processing.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


6 Introduction

Course Outline (continued)

! Module 10: Managing Partitions


! Module 11: Implementing Calculations Using MDX
! Module 12: Working with Virtual Cubes
! Module 13: Using Excel as an OLAP Client
! Module 14: Using Actions, Drillthrough, and Writeback
! Module 15: Implementing Security
! Module 16: Deploying an OLAP Solution
! Module 17: Introduction to Data Mining
! Module 18: Case Study—Working with the Foodmart Database

Module 10, “Managing Partitions,” explains how to create partitions, how to


define slices and filters, and the benefits of using partitions in cubes to improve
scalability. At the end of this module, you will be able to explain the benefits of
partitioning, describe the mechanics of the Partition Wizard, explain when to
define slices and when to define filters, and describe the purpose and mechanics
of merging partitions.
Module 11, “Implementing Calculations Using MDX,” allows you to learn
about calculated members and how to use them in OLAP cubes to enhance
analysis. After completing this module, you will be able to describe how
calculated members work, explain the mechanics of the Calculated Member
Builder, create calculated members in Measure dimensions, and create
calculated members in non-Measure dimensions. You also will be able to
describe the use of functions in calculated members, explain other calculation
methods in Analysis Services, and describe the importance of Solve Order to
generate accurate results.
Module 12, “Working with Virtual Cubes,” defines virtual cubes and explains
when to use them and the mechanics of how to build them in Analysis Services.
After completing this module, you will be able to describe when to use virtual
cubes, explain the rules for constructing meaningful virtual cubes, build virtual
cubes by using the Virtual Cube Wizard, and define calculated members in
virtual cubes by using the Calculated Member Builder.
Module 13, “Using Excel as an OLAP Client,” provides an overview of
Microsoft Excel 2000 OLAP features and gives you the opportunity to create
and manipulate the various Office 2000 interfaces. After completing this
module, you will be able to describe the various Microsoft Office 2000 OLAP
features, create a PivotTable from an OLAP cube, create Microsoft
PivotCharts®, create local cube files, and create a Web page containing Pivot
Web components.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Introduction 7

Module 14, “Using Actions, Drillthrough, and Writeback,” teaches you how to
implement three important features: actions, drillthrough, and writeback. At the
end of this module, you will be able to create and view actions, implement and
test drillthrough, and describe the applications for cube writeback.
Module 15, “Implementing Security,” teaches you how to implement security in
Analysis Services. At the end of this module, you will be able to understand the
use of security, explain administrator security, and describe authentication
methods. You also will be able to assign database roles, apply dimension
security, and manage cube roles.
Module 16, “Deploying an OLAP Solution,” explains how to automate cube
processing, copy server objects, and move databases from testing to production
environments. After completing this module, you will be able to describe the
role of Data Transformation Services (DTS), create a DTS package, and define
an Analysis Services processing task. You also will be able to copy, archive,
and restore OLAP databases.
Module 17, “Introduction to Data Mining,” introduces you to data mining
principles and applications while you explore the wizard-driven interface for
creating data mining models. After completing this module, you will be able to
describe data mining characteristics, applications, and modeling techniques,
describe the process of training your model, and use the OLAP Mining Model
Wizard to edit, process, and explore the decision trees. You also will be able to
analyze relational data relationships in the dependency network browser,
describe the steps required to build a clustering model by using OLAP data, and
use the Relational Mining Model Wizard to edit, process, and browse a
clustering model.
Module 18, “Case Study—Working with the Foodmart Database,” is a case
study covering material from the earlier modules. In this module, you use
various cube and dimension techniques to build cubes from the Foodmart 2000
database by using Analysis Services. After completing this module, you will be
able to create a cube based on user requirements. You also will be able to build
a virtual cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


8 Introduction

Microsoft Certified Professional Program


Topic Objective
To provide students with
information about the ! Microsoft Certified Systems Engineer + Internet
(MCSE + Internet)
Microsoft Certified
Professional Program. ! Microsoft Certified Systems Engineer (MCSE)
Lead-in ! Microsoft Certified Database Administrator (MCDBA)
The Microsoft Certified ! Microsoft Certified Solution Developer (MCSD)
Professional Program
includes these ! Microsoft Certified Professional + Site Building
certifications… (MCP + Site Building)
! Microsoft Certified Professional + Internet
(MCP + Internet)
! Microsoft Certified Professional (MCP)
! Microsoft Certified Trainer (MCT)

The Microsoft Certified Professional program provides the best method to


prove your command of current Microsoft products and technologies. The
following table describes each certification in more detail.
Certification Description

Microsoft Certified Systems MCSEs with a specialty in Internet technologies are qualified to enhance, deploy,
Engineer + Internet and manage intranet and Internet solutions that include a browser, proxy server, host
(MCSE + Internet) servers, database, messaging, and commerce components. An MCSE + Internet
certified professional also manages and analyzes Web sites.
Microsoft Certified Systems MCSEs are qualified to effectively plan, implement, maintain, and support
Engineer information systems in a wide range of computing environments with Microsoft®
(MCSE) Windows NT® Server and Microsoft BackOffice®.
Microsoft Certified MCDBAs are qualified to derive physical database designs, develop logical data
Database Administrator models, create physical databases, create data services by using Transact-SQL,
(MCDBA) manage and maintain databases, configure and manage security, monitor and
optimize databases and install and configure Microsoft SQL Server.
Microsoft Certified Solution MCSDs are qualified to build Web-based, distributed, and commerce applications by
Developer using Microsoft products, such as Microsoft SQL Server, Microsoft Visual Studio®,
(MCSD) and Component Services.
Microsoft Certified MCPs with a specialty in site building are qualified to plan, build, maintain, and
Professional + Site Building manage Web sites by using Microsoft technologies and products.
(MCP + Site Building)
Microsoft Certified MCPs with a specialty in the Internet are qualified to plan security, install and
Professional + Internet configure server products, manage server resources, extend servers to run Common
(MCP + Internet) Gateway Interface (CGI) scripts or Internet Server Application Programming Inter-
face (ISAPI) scripts, monitor and analyze performance, and troubleshoot problems.
Microsoft Certified MCPs demonstrate in-depth knowledge of at least one product by passing any one
Professional (MCP) exam (except Networking Essentials).
Microsoft Certified Trainer MCTs demonstrate the instructional and technical skills that qualify them to deliver
(MCT) Microsoft Official Curriculum through Microsoft Certified Technical Education
Centers (Microsoft CTEC).

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Introduction 9

Certification Requirements
The certification requirements differ for each certification category and are
specific to the products and job functions addressed by the certification. To
become a Microsoft Certified Professional, you must pass rigorous certification
exams that provide a valid and reliable measure of technical proficiency and
expertise.
The following table describes exam requirements.
Certification Exam requirements

MCSE + Internet Pass seven core exams and two elective exams.
MCSE Pass four core exams and two elective exams.
MCDBA Pass four core exams and one elective exam.
MCSD Pass three core exams and one elective exam.
MCP + Site Building Pass two core exams.
MCP + Internet Pass three core exams.
MCP Pass one exam (except Networking Essentials).
MCT Required to meet instructional and technical requirements
specific to each Microsoft Official Curriculum course they
are certified to deliver.1

For More Information See the “Certification” section of the Web page provided
on the compact disc or the Microsoft Training and Certification Web site at
http://www.microsoft.com/train_cert/
You can also send e-mail to mcp@msprograms.com if you have specific
certification questions.

Exam Preparation Guides


To help prepare for the MCP exams, you can use the preparation guides that are
available for each exam. Each Exam Preparation Guide contains exam-specific
information, such as a list of the topics on which you will be tested. These
guides are available on the Microsoft Certified Professional Web site, located at
the following address: http://www.microsoft.com/mcp/examinfo/exams.htm

Important Microsoft Official Curriculum (MOC) helps you to prepare for


Microsoft Certified Professional (MCP) exams. However, no one-to-one
correlation exists between MOC courses and MCP exams.

1
Inside the United States and Canada, call (800) 636-7544 for more information on becoming a
Microsoft Certified Trainer. Outside the United States and Canada, contact your local Microsoft
subsidiary.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


10 Introduction

Facilities
Topic Objective
To inform students of class Class Hours
logistics and rules for the
training site.
Lead-in Building Hours Phones
Before we start, let’s go over
the class logistics.
Parking Messages

Rest Rooms Smoking

Meals Recycling

Explain the class hours,


extended building hours for
labs, parking, rest room
location, meals, phones,
message posting, and
where smoking is or isn’t
allowed.

Also make sure that the


students are aware of the
recycling program if one is
available.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 1: Introduction
to Data Warehousing
and OLAP
Contents

Overview 1
Introducing Data Warehousing 2
Defining OLAP Solutions 11
Understanding Data Warehouse Design 18
Understanding OLAP Models 24
Applying OLAP Cubes 32
Review 40
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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 1: Introduction to Data Warehousing and OLAP i

Instructor Notes
Presentation: This module introduces students to data warehousing and online analytical
60 Minutes processing (OLAP)—their uses, essential concepts, terminology, and
architecture.
Lab:
00 Minutes The module describes the value of deriving business information from raw
operational data, and the process of using defined types of business analysis to
drive decision support systems. The module introduces data warehouses and
OLAP systems and describes the differences between relational data marts and
OLAP cubes.
Finally, the module introduces OLAP technology. Students will learn the
fundamentals of dimensions, members, and cubes. The materials also explore
methods for visualizing multidimensional databases.
After completing this module, students will be able to:
! Describe characteristics, goals, and applications of a data warehouse.
! Understand the need of and use for OLAP solutions.
! Describe data warehouse design.
! Understand the reasons for implementing OLAP models and describe their
components.
! Visualize a multidimensional database.

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_01.ppt
! Microsoft Excel file DEMO_01.xls
! Local cube file DEMO_01.cub

Preparation Tasks
To prepare for this module, you should:
! Read all the student materials.
! Read the instructor notes and margin notes.
! Practice the lecture presentation and demonstration.
! Review the Trainer Preparation presentation for this module on the Trainer
Materials compact disc.
! Review any relevant white papers that are on the Trainer Materials compact
disc.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


ii Module 1: Introduction to Data Warehousing and OLAP

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. Is a data mart synonymous with a star schema?
Not necessarily. The data mart is a subset of a data warehouse with
data specific to a particular subject or business activity. It can be
relational or multidimensional.
A relational data mart may have one or many star schemas that belong
to the data mart and contain data particular to a subject.
Multidimensional data marts use star schemas behind the scenes to
support multidimensional data structures called cubes.
2. Are data marts only composed of summary data?
No. Data marts can contain detailed data in addition to summarized
data. Using summarized data marts is a way to enhance query
performance.
3. Do you need to purchase Microsoft SQL Server™ 2000 in order to use
Microsoft SQL Server 2000 Analysis Services?
Yes. Analysis Services is bundled with SQL Server. However, you can
install Analysis Services without using—or installing—SQL Server.
4. What are reasons to use OLAP technology instead of relational database
technology?
OLAP technology provides fast, intuitive access to numeric data. It
gives users the ability to browse the database themselves, without
needing intermediate parties to develop queries. OLAP technology
provides a central calculation engine to model complex business models
and processes.
5. Is Measures a dimension?
When administering a cube, Measures are treated differently from
dimensions. When browsing a cube and when using MDX, Measures is
simply a dimension with only one level—and no All level.
6. Is a cell that is empty—that is, it has no value—still a cell?
Yes. The intersection of a member from each dimension forms a cell,
whether that cell is populated or not. The cell does not take any
physical storage space, but a cube is a logical construct and does not
reflect the physical storage.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 1: Introduction to Data Warehousing and OLAP iii

Displaying the Animated PowerPoint Slides


All the animated build slides are identified with an icon of links on the lower
left corner of the slide.

! To display the Data Warehouse System Components slide


This slide shows the components of a data warehouse system. In the slide, data
flows from sources systems to users. Integrate this information with material
from the student notes.
1. Advance to the first animation that displays, at the bottom of the slide, the
user data access, the data sources, and a data access line.
Explain that the purpose of a data warehouse is to expose business
information to users. The data that users are interested in is that which
resides in source systems.
2. Advance to the second animation to display a data access line that connects
the user data access to the data sources.
Explain that although users require the data in the source system, directly
accessing a source system can lead to several problems. Because source
systems are optimized for the inserts and updates associated with essential
business processes, user queries often burden these systems and interfere
with these essential processes. In addition, because these systems are
constantly changing, you will find that user data retrieval can produce
differing results and lead to inconsistent reports.
Given the limitations of source system reporting, explain that the best way
to meet the business analysis needs of an organization is by using a data
warehouse. Note that the transfer of data from the source system to users
becomes the primary function of the data warehouse.
3. Advance to the third animation to dissolve the data access line between the
users and data sources and to display the staging area.
Describe the characteristics of a staging area and note how data is extracted
from source systems for staging.
4. Advance to the fourth animation to display the data marts.
Describe a data mart. Mention that data marts can reside in relational
databases or in OLAP cubes.
5. Advance to the fifth animation to display the data warehouse.
Explain that the data warehouse is a virtual union of the subject-specific
data marts and cubes.
6. Advance to the sixth animation to display the user data access lines to the
data warehouse.
Reiterate that the business analysis needs of an organization define the need
for a data warehouse. Given this need, the transfer of data from the source
system to users becomes the primary function of the data warehouse.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


iv Module 1: Introduction to Data Warehousing and OLAP

Module Strategy
Use the following strategy to present this module:
! Introducing Data Warehousing
Present the differences between raw data and information. Describe the
characteristics of online transaction processing (OLTP) source systems and
give some examples of OLTP systems. Present the characteristics of a data
warehouse and describe the components of a data warehouse system.
! Defining OLAP Solutions
Begin by introducing the basic characteristics of OLAP databases. Give
examples of common OLAP applications. Explain the differences between
relational data marts and OLAP cubes in terms of data storage, data content,
data sources, and data retrieval. Finally, introduce OLAP in
SQL Server 2000 and discuss its two main OLAP components—the
SQL Server database and Analysis Services.
! Understanding Data Warehouse Design
Introduce the concept of a star schema and describe its characteristics. Next,
present the components of a fact table—foreign keys and measures—and
explain the concept of the fact table grain. Describe the characteristics of
dimension tables and give examples from a data warehouse. Finally, define
a snowflake schema as a variation of a star schema in which hierarchies are
stored in dimension tables.
! Understanding OLAP Models
Define the key components of the OLAP database—measures, dimensions,
and cubes. Compare OLAP dimensions and relational dimensions. Next,
define the components of a dimension—levels and members—giving
examples of each. Discuss the family terms that describe the relationships
between levels and members in a dimension. Describe the characteristics of
measures. Finally, to summarize the requirements for building OLAP cubes
by using relational data sources, discuss how the relational source relates to
the OLAP cube.
! Applying OLAP Cubes
Define a cube as the logical storage structure for an OLAP database.
Explain that each cell of a cube holds one value. Describe how users isolate
data with a cube. Introduce the concepts of slicing and dicing data in a cube,
and drilling up and drilling down through the levels in a hierarchy. Discuss
the visualization of multidimensional data, using spreadsheets to illustrate
the concept. Finally, connect to an OLAP cube by using a Microsoft Excel
PivotChart® to demonstrate the power of OLAP.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 1: Introduction to Data Warehousing and OLAP 1

Overview
Topic Objective
To provide an overview of
the module topics and
objectives. ! Introducing Data Warehousing
Lead-in ! Defining OLAP Solutions
In this module, you will learn
about data warehousing, ! Understanding Data Warehouse Design
OLAP systems, and OLAP
cube fundamentals. ! Understanding OLAP Models
! Applying OLAP Cubes

This module introduces you to data warehousing and online analytical


processing (OLAP)—their uses, essential concepts, terminology, and
architecture.
You will learn about the value of deriving business information from raw
operational data, and the process of using defined types of business analysis to
drive decision support systems.
You are introduced to data warehouses and OLAP systems and will learn the
differences between relational data marts and OLAP cubes.
Finally, you are introduced to OLAP technology. You will learn the
fundamentals of dimensions, members, and cubes. The materials also explore
methods for visualizing multidimensional databases.
After completing this module, you will be able to:
! Describe characteristics, goals, and applications of a data warehouse.
! Understand the need of and use for OLAP solutions.
! Describe data warehouse design.
! Understand the reasons for implementing OLAP models and describe their
components.
! Visualize a multidimensional database.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


2 Module 1: Introduction to Data Warehousing and OLAP

# Introducing Data Warehousing


Topic Objective
Introduce the concept of
data warehousing.
Lead-in ! Raw Data vs. Business Information
This section defines the ! OLTP Source Systems
differences between raw
data and derived ! Data Warehouse Characteristics
information, describes OLTP
systems, and introduces ! Data Warehouse System Components
data warehouse systems.

This section defines the differences between raw data and derived information,
describes online transaction processing (OLTP) systems, and introduces data
warehouse systems. An understanding of data warehouse system components is
important when you begin to design and implement decision support systems.
The following topics are discussed:
! Raw data versus business information
! OLTP source systems
! Data warehouse characteristics
! Data warehouse system components

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 1: Introduction to Data Warehousing and OLAP 3

Raw Data vs. Business Information


Topic Objective
To describe the differences
and relationships between ! Capturing Raw Data
raw data and business
information. $ Gathering data recorded in everyday operations
Lead-in ! Deriving Business Information
Turning raw data into
valuable information is a $ Deriving meaningful information from raw data
core analysis process that
drives the operations and ! Turning Data into Information
business decisions of a
company.
$ Implementing a decision support system

Turning raw data into valuable information is a core analysis process that drives
Delivery Tip the operations and business decisions of a company.
Ask students about the
types of systems that they
work with that capture raw Capturing Raw Data
data, derive business A company typically captures large amounts of data daily. This data often
information, and turn data
consists of raw facts that reflect the current state of the business.
into information.
Examples of raw data include:
! An international retail music store chain captures sales data for every
product purchase, return, and exchange around the world. A raw fact may
describe the Chicago branch of this music store selling $10,000 worth of
merchandise in June of 2000.
! A financial institution captures data for each customer’s checking and
savings account. A raw data fact may describe Stefan Knorr withdrawing
$50 from his checking account this morning in Amsterdam.

On the surface, this data provides an indication of what happens in the business.
However, the captured data can perform many more functions. The captured
data can help a company understand how it currently operates and help a
company plan its operations in the future.

Deriving Business Information


The process by which you can derive business information from raw data
involves:
! Examining the raw data in several different contexts and from several
different points of view.
! Determining how these facts relate to other data.
! Understanding how this data reflects overall business goals and objectives.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


4 Module 1: Introduction to Data Warehousing and OLAP

By using this process, consider how the raw data from the previous examples is
converted to valuable business information.
The Chicago Music Store
Raw Data: The Chicago branch of this music store sold $10,000 worth of
merchandise in June 2000. However, the Chicago branch sold $15,000 in June
1999. The Chicago branch sales goal for June 2000 is $20,000.
Derived Information: It appears as if the Chicago branch did not meet its sales
goal for June 2000 and did not perform as well as the previous year. Business
analysis is now required to determine the cause of the decline in sales.
Typical business questions arising from this analysis include:
! What products are selling in the Chicago store?
! What products are not selling?
! What is the effect of product promotions?

The Financial Institution


Raw Data: Stefan Knorr withdrew $50 from his checking account this morning
in Amsterdam. Stefan’s primary residence is located in Los Angeles, California.
In the past month, Stefan has withdrawn money from London, England; Oslo,
Norway; and Stockholm, Sweden.
Derived Information: Stefan apparently travels extensively throughout Europe.
Perhaps he would be interested in a special ATM card that allows unlimited
access to his checking account in 16 different countries for an additional yearly
fee. However, additional analysis is required to verify that he meets other
requirements for the new ATM card.
Typical business questions arising from this analysis include:
! What is the average daily balance of his account?
! How many times has this customer been overdrawn in the last 2 weeks? In
the last 2 months? In the last 2 years?
! For what other promotions does he qualify?

Turning Data into Information


After the value of meaningful business analysis is recognized in an
organization, data and information requests become numerous and frequent.
Satisfying these requests can be a complex task as you navigate through the
large amounts of captured source data and attempt to consolidate, analyze, and
distribute information to other members of the organization.
To meet these requests, a company typically implements a decision support
system dedicated to providing data and information that can be used to perform
meaningful business analysis.
A company’s investment in these decision support systems is usually very large
in terms of expense, time, and effort. The return on this investment is reflected
in how well the decision support system can satisfy the business needs of the
organization.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 1: Introduction to Data Warehousing and OLAP 5

OLTP Source Systems


Topic Objective
To define an OLTP source
system.
! OLTP System Characteristics
Lead-in
Here are the characteristics $ Processes real-time transactions of a business
of a database designed for
an OLTP environment. $ Contains data structures optimized for entries and edits
$ Provides limited decision support capabilities
! OLTP Examples
$ Order tracking $ Service-based sales
$ Customer service $ Banking functions
$ Point-of-sales

OLTP systems are operational systems that capture the transactions of a


business and supply data to the data warehouse or data mart.
Key Point
Point out that OLTP A given company may have one or many operational systems that conduct
systems are optimized for essential business processes. These operational systems can be on separate
inserts and updates, not servers, on different networks, and may be internal or external to the company.
user queries.
OLTP System Characteristics
OLTP operational systems:
! Process real-time transactions of a business.
OLTP systems conduct essential business processes by tracking real-time
transactions. OLTP systems continually change to represent the current state
of the business. As the OLTP system processes new transactions, data is
updated or inserted into the OLTP system immediately.
! Contain data structures optimized for entries and edits.
Because the performance of these systems is critical to keeping track of
essential business processes, data structures are optimized for data entry and
edits.
! Provide limited decision support capabilities.
Decision support goals are not a priority of OLTP systems. Reporting from
operational systems may supply the most current data. However, directly
accessing a source system can have a negative impact on source system
performance and produce inconsistent reports due to the volatility of the
OLTP system.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


6 Module 1: Introduction to Data Warehousing and OLAP

Ask students to list


OLTP System Examples
operational system OLTP operational system examples include:
examples in their own
organizations. ! Order-tracking applications, such as catalog sales.
! Customer-service applications, such as setting up customer accounts.
! Point-of-sales applications, such as paying for items at a grocery store.
! Service-based sales applications, such as cellular telephone billing.
! Banking functions, such as deposits and withdrawals.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 1: Introduction to Data Warehousing and OLAP 7

Data Warehouse Characteristics


Topic Objective
To present the
characteristics of the data
warehouse. ! Provides Data for Business Analysis Processes
Lead-in ! Integrates Data from Heterogeneous Source Systems
The primary function of a
data warehouse system is to ! Combines Validated Source Data
support an organization’s
business analysis ! Organizes Data into Non-Volatile, Subject-Specific
processes. Groups
! Stores Data in Structures that Are Optimized for
Extraction and Querying

A data warehouse system has components that move data from a source system
to users who want to perform data analysis. The primary function of a data
warehouse system is to support an organization’s business analysis processes.
A data warehouse:
! Provides data for business analysis processes.
A data warehouse is a data store that supports an organization’s business
analysis processes. Often, it is implemented as an enterprise-wide decision
support system, installed to provide a reporting environment that facilitates
data analysis by providing extensive decision support capabilities.
! Integrates data from heterogeneous source systems.
Operational systems and, sometimes, external systems are the sources for
data warehouses. These heterogeneous source systems can contain
transformed and integrated source data from OLTP systems, previous-
version systems, text files, and spreadsheets.
! Combines validated source data.
A data warehouse combines heterogeneous source data that has been
authenticated according to previously defined business rules. It is important
that the integrity of data in a data warehouse meet the standards of the
business rules and processes.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


8 Module 1: Introduction to Data Warehousing and OLAP

! Organizes data into non-volatile, subject-specific groups.


A data warehouse stores data as non-volatile, subject-oriented data sets. A
data warehouse is a static environment. Data is updated and inserted into the
data warehouse periodically. The frequency of data updates and inserts
depends on business analysis requirements.
! Stores data in physical structures that are optimized for data distribution and
querying.
A data warehouse facilitates data retrieval and analysis, and therefore query
performance is important. Thus, the design of a data warehouse is important
for optimal data distribution and querying.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 1: Introduction to Data Warehousing and OLAP 9

Data Warehouse System Components


Topic Objective
Data Warehouse
To present the components User
Data Data Marts
of a data warehouse Staging Data Access
Sources
system. Area
Lead-in
A data warehouse system
contains many components
that move data from its
source system to users who
perform data analysis.

Data Input

Data Access

Delivery Tips The data warehouse system contains several components that transfer data from
Use this slide to introduce a source system to users who want to perform data analysis. It is important to
OLAP solutions and data understand the role of a data warehouse system and where it persists in the data
marts and to transition into flow of an organization.
the next section that
describes OLAP solutions. User Data Access
Use the slide to explain The purpose of a data warehouse in an organization is to expose business
each of the data warehouse information to users. Users analyze data to derive business information and
system components and the thereby make decisions. The data that users are interested in is the data from
relationships of the operational source systems.
components.
Even though users require the data in these source systems, directly accessing a
Before explaining the above source system can lead to several problems. Because source systems are
slide, review Displaying the optimized for the inserts and updates associated with essential business
Animated PowerPoint Slides operations, user data access queries often burden and interfere with essential
in the Other Activities business processes. In addition, because these systems are constantly changing,
section of the Instructor you will find that user data retrieval can produce differing results and lead to
Notes. inconsistent reports.
Given the limitations of source system reporting, the best way to meet the
business analysis needs of an organization is to use a data warehouse. The
transfer of data from the source system to users becomes the primary function
of the data warehouse system.

Important The transfer of data from source system to user is the critical path of
a data warehouse system.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


10 Module 1: Introduction to Data Warehousing and OLAP

Data Sources
Source systems are known as OLTP systems or legacy systems in a mainframe
environment. Source systems are the operational systems that capture the
transactions of a business and supply data to the data warehouse or data mart.
A source system can be relational or non-relational. Source systems do not
generally contain large amounts of historical information, as they are
continually updated to reflect the current state of the business.

Staging Area
The staging area, or data preparation area, is a collection of processes that
cleans, transforms, combines, and prepares source data for use in the data
warehouse or data mart. In a staging area, source system data is transformed
into common formats, checked for consistency and referential integrity, and
prepared to load into the data warehouse database. A staging area:
! Is on one or several computers.
! May not be based on relational technologies.
! Does not support user reporting.

Data Marts
The data mart is a subset of a data warehouse with data specific to a particular
subject or business activity, such as finance or customer analysis. Data marts:
! Can be included (one or many subject-specific data marts) in a data
warehouse.
! Can be built in relational or OLAP databases.
! Can contain detailed or summarized data, which may or may not be shared
across data marts.

Note The definition of a data mart can vary. In this course, the data mart is a
subset of a data warehouse with data specific to a particular subject or business
activity. The data marts you will create in this course will be OLAP databases.

Data Warehouse
In this course, the data warehouse is defined as a virtual union of data marts
with integrated information that is shared across data marts. In other
circumstances, a data warehouse may be defined as a centralized, integrated
data store providing data to the data marts. Either definition is correct.

Note The definition of a data warehouse can vary from organization to


organization. In this course, the data warehouse is defined as a virtual union of
data marts with integrated information shared across data marts.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 1: Introduction to Data Warehousing and OLAP 11

# Defining OLAP Solutions


Topic Objective
To define OLAP solutions.
Lead-in
This section introduces
! OLAP Databases
OLAP solutions and defines ! Common OLAP Applications
how they are used to
provide users with fast, ! Relational Data Marts and OLAP Cubes
flexible data access.
! OLAP in SQL Server 2000

In the previous section, you learned about data warehousing and the flow of
data from source systems to users. This section focuses on one area of the data
warehouse—the OLAP database. The section introduces OLAP databases,
describes common applications implemented by using OLAP technology,
differentiates relational data marts and OLAP cubes, and describes the OLAP
database solution available in Microsoft® SQL Server™ 2000.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


12 Module 1: Introduction to Data Warehousing and OLAP

OLAP Databases
Topic Objective
To introduce the
fundamental characteristics
of OLAP databases. ! Optimized Schema for Fast User Queries
Lead-in ! Robust Calculation Engine for Numeric Analysis
OLAP database technology
provides an alternative to ! Conceptual, Intuitive Data Model
relational database
technology, offering fast, ! Multidimensional View of Data
flexible data viewing,
analysis, and navigation. $ Drill down and drill up
$ Pivot views of data

OLAP technology provides an alternative to relational database technology,


offering fast, flexible data viewing, analysis, and navigation. The following are
Key Point characteristics of OLAP technologies:
OLAP technology is
considered something in ! OLAP databases have an optimized schema for fast user queries.
between a relational
OLAP queries are very fast, and allow for more interactive use from users
database management
system (RDBMS) and a
than typical relational database management system (RDBMS) reporting
spreadsheet. applications. OLAP cubes store various levels of summarized data in data
structures highly optimized for user queries.
! OLAP databases have a robust calculation engine for numeric analysis. You
use OLAP cubes for numeric analysis, from producing simple sales reports
to performing complex allocation algorithms. Many advanced calculations
performed by OLAP calculation engines cannot be performed by relational
databases because of analytical limitations in the RDBMS database engines.
! OLAP is a conceptual, intuitive data model.
More than a particular database technology, OLAP is a conceptual, intuitive
data model that users can easily understand without the development of
custom reporting applications.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 1: Introduction to Data Warehousing and OLAP 13

! OLAP provides a multidimensional view of data.


Cubes provide a multidimensional view of data that extends beyond
standard two-dimensional analysis. OLAP allows flexible data viewing,
analysis, and navigation.
• Users can drill down and drill up through various levels of summarized
data. In OLAP cubes, data is stored in both detailed and summarized
levels. OLAP cubes give users the opportunity to easily drill down—that
is, to double-click top-to-bottom through the summarized levels to more
detailed levels of data—or drill up from lower levels to more
summarized levels of data.
• Users can pivot views of data. Users can easily switch the rows,
columns, and pages in OLAP reports. The term pivoting defines the
intuitive mouse action by users that changes the orientation of their
reports.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


14 Module 1: Introduction to Data Warehousing and OLAP

Common OLAP Applications


Topic Objective
To introduce common OLAP
applications. ! Executive Information Systems ! Financial Applications
Lead-in $ Performance measures $ Reporting
OLAP databases are $ Exception reporting $ Planning
adapted to a wide range of
business applications. Let $ Analysis
us talk about some
examples.
! Sales/Marketing Applications ! Operations Applications
$ Booking/billing $ Manufacturing
$ Product analysis $ Customer service
$ Customer analysis $ Product cost

OLAP databases are adapted to a wide range of business intelligence (BI)


Ask students what
applications, including the following:
applications in their ! Executive information systems (EIS)
organizations have been or
could be converted to an Users, typically senior and middle managers, receive information about key
OLAP database. performance measures of the business and exceptions or variances from
preset benchmarks and standards. EIS systems typically present
Discuss the types of OLAP multidimensional data in graphical formats.
data marts with which you
may have worked. ! Financial applications
Many different types of financial applications use OLAP databases for
reporting, planning, and analysis. Examples of financial applications include
financial reporting, month-close analysis, product profitability analysis,
budgets and forecasting, and financial modeling. Financial analysts use
OLAP extensively for ad hoc analysis of financial and operational data to
answer questions from senior management.
! Sales and marketing applications
Many types of sales and marketing applications frequently use OLAP where
slice and dice capabilities and timeliness of information are important.
Examples include booking and billing applications, product analysis,
customer analysis, and regional sales analysis.
! Operations applications
OLAP databases are adapted to a wide range of operational analyses,
including manufacturing throughput and efficiency, customer service
effectiveness, and product cost analysis.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 1: Introduction to Data Warehousing and OLAP 15

Relational Data Marts and OLAP Cubes


Topic Objective
To explain the relationships
between relational data Relational
Relational OLAP
marts and OLAP cubes.
Data OLAP Cube
Cube
Data Mart
Mart
Lead-in
It is important to understand Relational
Relational N-dimensional
N-dimensional
Data
Data Storage
Storage
the differences between Data
Data Structure
Structure Data
Data structure
structure
relational data marts and
Detailed
Detailed and
and
OLAP cubes. Data
Data Content
Content Summarized
Summarized Data
Data
Summarized
Summarized Data
Data

Relational
Relational and
and Relational
Relational and
and
Data
Data Sources
Sources Non-relational
Non-relational Sources
Sources Non-relational
Non-relational Sources
Sources

Fast
Fast Performance
Performance for
for Faster
Faster Performance
Performance for
for
Data
Data Retrieval
Retrieval Data
Data Extract
Extract Queries
Queries Data
Data Extract
Extract Queries
Queries

Most organizations use a combination of relational data marts and OLAP cubes
Point out that the table to meet their decision support needs.
presents a a general
comparison. The Given their common decision support goals, relational data marts and OLAP
comparision points may vary cubes differ greatly in data storage, data content, data sources, data retrieval,
depending on the particular and business analysis capabilities.
relational or OLAP
technology.
Data Storage
Ask students to participate Relational data marts and OLAP cubes differ in how they store data:
in a comparision discussion.
! Relational data marts store data in structures supported by relational
database technologies.
! OLAP cubes store data in multidimensional structures. These structures can
use both relational and multidimensional database technologies.

Data Content
Relational data marts and OLAP cubes differ in their data content:
! Relational data marts store detailed and summarized data in relational
structures.
! OLAP cubes store summarized data in n-dimensional structures.

Data Sources
Relational data marts and OLAP cubes differ in how they are sourced:
! Relational data marts can centralize source data from one or many
heterogeneous source systems that may or may not be relational.
! OLAP cubes can be sourced from relational or non-relational sources, and
most often originate from detailed, relational data marts.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


16 Module 1: Introduction to Data Warehousing and OLAP

Data Retrieval
Relational data marts and OLAP cubes differ in how they retrieve data:
! Relational data mart structures are optimized for data retrieval.
! OLAP cube structures are also optimized for data retrieval. Because
aggregated data is stored in these n-dimensional structures, query
performance exceeds that of relational data marts.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 1: Introduction to Data Warehousing and OLAP 17

OLAP in SQL Server 2000


Topic Objective
To introduce OLAP in SQL
Server 2000.
Lead-in ! Microsoft Is One of Several OLAP Vendors
Microsoft is one of several ! Analysis Services Is Bundled with Microsoft SQL Server
OLAP vendors.
2000
! Analysis Services Include
$ OLAP engine
$ Data mining technology

OLAP technology is not unique to Microsoft. Several companies distribute


OLAP database engines. Many companies also sell applications that provide
user interfaces that interact with OLAP database engines.
SQL Server 2000 includes two main OLAP components: the SQL Server
database and Analysis Services. Both products are included on the same
installation media, but you can install either component without installing the
other.
Two distinct but overlapping tools are included in Analysis Services:
! The OLAP engine and its related components.
! A data mining tool. Data mining tools search for patterns in large quantities
of data.

Analysis Services includes multiple types of OLAP storage schemes, such as:
! Multidimensional OLAP (MOLAP). Data is stored in and retrieved from
cube structures that are separate from the relational database source of
information.
! Relational OLAP (ROLAP). Data is stored in and retrieved from a relational
database.
! Hybrid OLAP (HOLAP). Data is stored in and retrieved from a combination
of multidimensional cube structures and relational database tables.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


18 Module 1: Introduction to Data Warehousing and OLAP

# Understanding Data Warehouse Design


Topic Objective
To introduce data
warehouse design concepts.
Lead-in ! The Star Schema
This section describes data ! Fact Table Components
warehouse design concepts
including the star schema, ! Dimension Table Characteristics
fact tables, and dimension
tables. ! The Snowflake Schema

Before you can create an OLAP database and understand its components, you
must first understand the data warehouse components that you use to build the
OLAP databases.
This section describes data warehouse design concepts including the star
schema, fact tables, and dimension tables. It is important to understand how all
the elements interact, because you define OLAP cubes from these data
warehouse components.
This section discusses the following components:
! The star schema
! Fact table components
! Dimension characteristics
! The snowflake schema

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 1: Introduction to Data Warehousing and OLAP 19

The Star Schema


Employee_Dim
Employee_Dim
Topic Objective EmployeeKey
EmployeeKey
To introduce the star EmployeeID
EmployeeID
schema design technique. ...
...
Lead-in
To facilitate data retrieval Dimension Table
and analysis, a data Time_Dim Fact Table Product_Dim
Time_Dim Product_Dim
warehouse physically TimeKey Sales_Fact ProductKey
TimeKey Sales_Fact ProductKey
organizes data into easy-to- TheDate TimeKey
TheDate TimeKey ProductID
ProductID
use structures called star ...
... EmployeeKey
EmployeeKey ...
...
schemas. ProductKey
ProductKey
CustomerKey
CustomerKey
ShipperKey
ShipperKey
Sales
Sales Amount
Amount
Unit
Unit Sales
Sales ...
...

Shipper_Dim
Shipper_Dim Customer_Dim
Customer_Dim
ShipperKey
ShipperKey CustomerKey
CustomerKey
ShipperID
ShipperID CustomerID
CustomerID
...
... ...
...

Introduce the concept of the To facilitate data retrieval and analysis, a data warehouse physically organizes
star schema and explain data into easy-to-use structures called star schemas. A data warehouse made up
that OLAP cubes use star of subject-oriented data marts uses one or more star schemas to represent
schemas as their data specific business events or processes.
sources.
A star schema is characterized as having one central fact table surrounded by
many dimension tables that contain denormalized descriptions of the facts.
The following items are characteristics of a star schema:
! The center of the star is the fact table (Sales_Fact).
A fact table contains business metrics—measures—that describe specific
events in a business, such as bank transactions or product sales. It can also
contain aggregated data, such as sales that are summarized at the monthly
level from daily transactions.
! The points of the star are the dimensional tables (Employee_Dim,
Product_Dim, Customer_Dim, Shipper_Dim, and Time_Dim).
These points of the star are used to describe the information that exists in a
specific business process and to provide context for the numeric data. In the
retail sales example in the preceding illustration, the dimension tables
describe how sales data is measured.
! The grain of the fact table is a one-sentence definition of what the fact table
represents. This fact table contains daily sales data by product, employee,
shipper, and customer.

OLAP cubes use star schemas as their data sources. Therefore, a star schema
must be present before you can create an OLAP cube in Analysis Services.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


20 Module 1: Introduction to Data Warehousing and OLAP

Fact Table Components


Topic Objective Dimension
To present fact table
Dimension
components.
Tables
Tables sales_fact Table
Lead-in customer_dim
customer_dim
201
201 ALFI
ALFI Alfreds
Alfreds Foreign Keys Measures
The fact table is a central
table in a star schema
presenting numeric data in
the context of business customer_key
customer_key product_key
product_key time_key
time_key quantity_sales
quantity_sales amount_sales
amount_sales
product_dim
product_dim
entities. 201 25 134 400 10,789
25
25 123
123 Chai
Chai

time_dim
time_dim
134
134 1/1/2000
1/1/2000
The grain of the sales_fact table is defined by the lowest
level of detail stored in each dimension

The fact table is a central table in a star schema that presents numeric data in
Delivery Tips the context of business entities. The fact table is principally made up of
Use the example in the measures and foreign keys.
preceding illustration to
explain the components of
fact tables.
Measures
A measure is a quantitative, numerical column in the fact table. Measures
Point out the major typically represent the values that are analyzed, such as unit sales or number of
components of the fact employees. Measures are generally additive and numeric because these values
table: foreign keys and are the bases from which you can perform calculations.
measures.
In the preceding illustration, the measures in the sales_fact table are
Use the data in the slide to quantity_sales and amount_sales. These measures are additive across all
show how each foreign key dimensions.
relates to a primary key in a
dimension table.
Foreign Keys
A foreign key is the representation of a dimension’s primary key in the fact
table. Foreign keys are taken from the primary keys of each dimension table.
The combination of these keys is typically the unique identifier for each fact
table record.
In the slide, the foreign keys are the customer_key, product_key, and
time_key fields.

Note Note that fact tables can also contain additional facts that are not foreign
keys or measures. These facts provide additional descriptive information to the
fact table record, such as data lineage information.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 1: Introduction to Data Warehousing and OLAP 21

Fact Table Grain


Delivery Tips The fact table grain is the meaning of a single fact table record that conveys the
Explain the concept of the context of the numeric data stored in the fact table. The fact table grain is
fact table grain by using the
typically defined by the lowest level of detail stored in each of the dimensions
sales_fact table shown in
the slide.
associated with the fact table.
Given its dependency on dimension data, the integrity of fact table data relies
Point out that the grain of
on maintaining the fact table grain and enforcing application key uniqueness in
the sales_fact table is the
lowest level of detail in all
dimension tables.
the dimensions. Fact table grains must adhere to the following design principles:
Note that the concept of the ! Each fact table can have only one defined grain.
fact table grain may be
confusing to some students. ! All the measures in a fact table must conform to the defined grain.
! When you have data at two different levels of detail, you will need to
implement more than one fact table to contain the data.

Tip Typically, the fact table grain is the lowest level of detail stored in each of
the dimensions associated with the fact table

In the slide, the grain of the sales_fact table is sales data by customer ID,
product ID, and order date. These represent the lowest level of detail in the
customer_dim, product_dim, and time_dim dimensions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


22 Module 1: Introduction to Data Warehousing and OLAP

Dimension Table Characteristics


Topic Objective
To describe dimensions by
using examples from a data
warehouse.
Lead-in
A dimension table
represents a business entity
and provides the context for
numeric data in the fact
table.

! Describes Business Entities


! Contains Attributes That Provide Context to Numeric
Data
! Presents Data Organized into Hierarchies

A dimension table represents a business entity, providing the context for


numeric data in the fact table. The design of dimension tables targets the
Delivery Tips analytical needs of the business user by presenting usable, descriptive
Use the dimensions in the information that is easy for users to browse.
preceding illustration to
present the characteristics A dimension table:
of dimension tables.
! Describes business entities
Give examples of how these In star schemas, a dimension table represents a single business entity, such
dimension tables describe as a product or customer.
business entities, contain
attributes, and present The preceding illustration displays three dimension tables: customer, State,
hierarchies. and time_by_day. These tables represent the following business entities
respectively: customer, region, and time. The lowest level of detail for each
dimension is: customer_id, State_ID, and time_id.
! Contains attributes that provide context for numeric data
Attribute columns are highly correlated and descriptive. They are used to
provide context for the numeric data stored in the fact table. For example, a
user may request monthly sales data measured by customer and by region.
! Presents data organized into hierarchies
In each dimension, you can organize data into one or many hierarchies.
Building data hierarchies allows users to view both detailed and
summarized data. Physically, each dimension table contains one or many
hierarchies. A hierarchy contains levels that break the dimension into
categories.
In the preceding illustration, the time_by_day dimension provides users
with a general calendar year hierarchy: days that are organized in months,
months that are organized into quarters, and quarters that are organized into
years.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 1: Introduction to Data Warehousing and OLAP 23

The Snowflake Schema


Topic Objective
To describe a snowflake
schema.
Lead-in
A snowflake schema is a
variation of the star schema
in which dimension
hierarchies are stored in
multiple dimension tables.

! Defines Hierarchies by Using Multiple Dimension Tables


! Is More Normalized than a Single Table Dimension
! Is Supported within Analysis Services

A snowflake schema is a variation of the star schema in which dimension


hierarchies are stored in multiple dimension tables. For example, in the
preceding illustration, the Product dimension is stored in three tables: Product
Category, Product Subcategory, and Product. In the example, each
dimension table corresponds to a different level in the dimension—Category,
Subcategory, and Product.
Because you store the dimensional data across multiple tables, a snowflake
schema is more normalized than a strict star schema containing single tables for
each dimension. Only one dimension table joins to the fact table, and then the
other dimension tables are joined with foreign key relationships. Analysis
Services supports snowflake schemas when creating dimensions in OLAP
cubes.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


24 Module 1: Introduction to Data Warehousing and OLAP

# Understanding OLAP Models


Topic Objective
To introduce OLAP models.
Lead-in
Now we will discuss OLAP ! OLAP Database Components
models and their
components. ! OLAP Dimensions vs. Relational Dimensions
! Dimension Fundamentals
! Dimension Family Relationships
! Cube Measures
! Relational Data Sources

In the previous section, you learned about data warehouse design concepts.
Now, you will learn how to apply those concepts to the design and creation of
OLAP models.
This section describes OLAP models and their components. You will learn
about the components that define an OLAP database, the difference between
OLAP and relational dimensions, the fundamentals of OLAP dimensions,
family relationship terms used to describe dimensions, the definition of cube
measures, and the relational data sources of cubes.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 1: Introduction to Data Warehousing and OLAP 25

OLAP Database Components


Topic Objective
To introduce OLAP
database components.
Lead-in
! Numeric Measures
OLAP databases are ! Dimensions
composed of three major
components—numeric ! Cubes
measures, dimensions, and
cubes.

OLAP databases are defined by the following components:


Delivery Tip
Highlight the fact that ! Numeric Measures
measures come from the
fact table and dimensions Measures are the data values, or facts, that users analyze. Examples of
come from the dimension measures are Sales, Units, and Cost of Goods Sold. Measures in a cube
tables in the star schema. must come from the fact table defined in the database data source.
! Dimensions
Dimensions represent the business categories that provide context to the
numeric measures. Dimensions are the logical equivalent of star schema
dimensions with the exception that the members of a dimension are
typically organized into a hierarchical structure. In addition, OLAP
dimensions are much easier to navigate than star schema dimensions.
! Cubes
Cubes combine all dimensions and all measures into one conceptual model.
Cubes act as the logical storage medium for an OLAP database and are what
users manipulate to access their data.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


26 Module 1: Introduction to Data Warehousing and OLAP

OLAP Dimensions vs. Relational Dimensions


Topic Objective
To compare OLAP and OLAP Relational
relational dimensions.
Lead-in
In order to fully understand REGION REGION
OLAP dimensions, it is
West West
important to recognize the
differences between OLAP CA East
and relational dimensions.
OR
East STATE REGION
MA CA West
NY OR West
MA East
NY East

Describe OLAP dimensions In order to understand OLAP dimensions, it is important to recognize the
as being the logical differences between OLAP and relational dimensions:
equivalent of relational
domains. This helps ! OLAP dimensions are usually stored in structures that are completely
students who come from a different and separate from relational tables. These structures are very fast
relational background. to query.

Note You have the ability in Analysis Services to create dimensions that
store their structures in relational tables. These dimensions are known as
ROLAP dimensions and are discussion in module 9, “Processing
Dimensions and Cubes,” in course 2074A, Designing and Implementing
OLAP Solutions with Microsoft SQL Server 2000.

! Relational dimensions are stored in relational tables. For example, the two
tables Region and State store the relational dimension of Region.
! Users navigate easily through OLAP dimensions. To move from level to
level, a user simply double-clicks in the front-end application. For example,
to move from East to East’s children, users double-click East to move to
MA and NY.
! Tables are less intuitive for users as they navigate through relational
dimensions. Therefore, organizations purchase or develop front-end
applications to assist in relational dimension access. These applications
perform SQL-generated queries hidden from the user to provide the same
behavior as OLAP reports.
! The hierarchical structures and relationships of relational dimensions are not
as apparent as they are in OLAP dimensions.
! Relational dimension tables contain information that is not applicable to
user queries. For example, a dimension table contains a primary key, foreign
keys, and attributes. OLAP dimensions, on the surface, only contain
information used by users and their queries.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 1: Introduction to Data Warehousing and OLAP 27

Dimension Fundamentals
Topic Objective
To present OLAP dimension
fundamentals
Lead-in
An OLAP dimension
consists of levels and
members.

Use the time dimension in An OLAP dimension is made up of levels and members. These components
the slide to define levels and map to the dimension tables found in the OLAP cube’s data source.
members.
Dimensions contain the hierarchical elements that are shown in the following
table.
Dimension Element Definition

Level Group of dimension members that share a common


meaning. Levels map to dimension table columns.
Member Each discrete value in a dimension. Members map to
dimension table values in a level’s column.
Dimensions Organized levels and members in a tree structure

In the preceding illustration, the Time dimension consists of three hierarchical


levels:
! Year
! Quarter
! Month

Members of the dimension are the years—1999, 2000, and 2001—and the
quarters and months—for example, Quarter 1 and January.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


28 Module 1: Introduction to Data Warehousing and OLAP

Dimension Family Relationships


Topic Objective # USA is the parent of North West and
To review key family
relationships in a dimension. USA South West
North West # North West and South West are
Lead-in children of USA
OLAP uses family Oregon
relationship terms to Washington # North West and California are
describe how members South West descendants of USA
relate to each other. California # North West and USA are ancestors of
Washington
# North West and South West are
siblings
# Oregon and California are cousins
# All are dimension members

OLAP uses family terms to describe relationships between members and


Delivery Tip between levels of a dimension. In the preceding illustration, the following are
Use the build slide to step
through each of the
family relationships:
dimension terms. For each ! Parent
bullet of the list to the right,
the colors of the members USA is the parent of North West and South West.
change—the primary
! Child
members change to red,
and the secondary members North West and South West are children of USA.
change to blue.
! Descendant
All members below USA are its descendants. For example, North West and
California are two descendants of USA.
! Ancestor
California has two ancestors, South West and USA. USA is the ancestor of
South West in addition to being its parent.
! Sibling
North West and South West are siblings to each other. Oregon and
Washington are also siblings. Siblings share a common parent.
! Cousin
Oregon and California are cousins. Cousins have parents that are siblings.
! Member
Regardless of specific familial relationships, everyone in the greater family
is a member.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 1: Introduction to Data Warehousing and OLAP 29

Cube Measures
Topic Objective
To describe the
characteristics of cube
measures. ! Are the Numeric Values of Principle Interest
Lead-in ! Correspond to Fact Table Facts
Measures are the numeric
values of principle interest to ! Intersect All Dimensions at All Levels
users.
! Are Aggregated at All Levels of Detail
! Form a Dimension

Measures are the numeric values that users analyze. Every cube must contain at
least one measure, but cannot have more than 1,024 measures total.
The following are true of measures:
! Measures must be numeric.
! Measures correspond to fact table facts. Only one fact table can be used to
design a cube. Therefore, measures can only come from one table in the
cube’s data source.
! Measures intersect all dimensions at all levels.
! Measures are aggregated at all levels of detail across all dimensions. For
example, a Sales measure can be accessed at the monthly, quarterly, and
year total levels of the Time dimension, in addition to all levels in all other
dimensions of the cube.
! All cubes by definition contain a Measures dimension. You can think of the
measures in a cube as members of the Measures dimension.

Note The Measure dimension contains only one level. In other words, the
measure dimension does not contain a hierarchy.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


30 Module 1: Introduction to Data Warehousing and OLAP

Relational Data Sources


Topic Objective
To finish the section with a ! Star and Snowflake Schemas
discussion of how the
relational data source $ Are required to build a cube with Analysis Services
relates to the OLAP cube.
Lead-in ! Fact Table
Now that you understand
$ Contains measures
the components of a data
warehouse and an OLAP $ Contains keys that join to dimension tables
cube, let us summarize how
the two are related. ! Dimension Tables
$ Must exist in same database as fact table
$ Contain primary keys that identify each member

Use this slide to summarize Analysis Services creates a new layer on top of an existing relational
the requirements for building warehouse. The purpose of that new layer is to make access to the data very fast
OLAP cubes by using and very flexible.
relational data sources.
Star and Snowflake Schema
Before you build a cube with Analysis Server, your source data must be staged
in a relational database, in a star or snowflake schema. To use Analysis Services
successfully, you must know what Analysis Services expects the data
warehouse to look like.
If students are confused at
this point, let them know that Fact Table
the process of creating To be usable by Analysis Services, the fact table in the cube data source must
cubes reinforces all these contain a column for each measure. In addition, the fact table must contain
data source requirements. dimension keys that join to dimension tables.
The fact table must contain rows at the lowest level of detail you might want to
retrieve for a measure. In other words, the fact table contains rows only for the
lowest level of members of each dimension. Analysis Services cannot use a fact
table that stores aggregates, such as quarter and year totals.

Dimension Tables
From an OLAP perspective, dimension tables serve three purposes. A
dimension table:
! Contains member names.
! Contains the hierarchy definition.
! Contains other attributes.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 1: Introduction to Data Warehousing and OLAP 31

Dimension tables must exist in the same database as the fact table. Some
organizations store dimensional information in separate, isolated data sources.
In such cases, all information must be consolidated into one data source before
developing Analysis Services OLAP cubes.
In the data warehouse, the primary key column for a dimension table must
contain a unique value for each member of the dimension. The primary key
column of each dimension table must match one of the key columns in the
related fact table. Each key value that appears once in the dimension table will
appear multiple times in the fact table.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


32 Module 1: Introduction to Data Warehousing and OLAP

# Applying OLAP Cubes


Topic Objective
To present the topics
covered in this section.
! Defining a Cube
Lead-in
This section describes ! Querying a Cube
OLAP cube fundamentals
by demonstrating the ! Defining a Cube Slice
methods for visualizing
multidimensional databases. ! Working with Dimensions and Hierarchies
! Visualizing Cube Dimensions
! Connecting to an OLAP Cube

This section describes OLAP cube fundamentals by demonstrating the methods


for visualizing multidimensional databases. Contents include:
! Defining a cube
! Querying a cube
! Defining a cube slice
! Working with dimensions and hierarchies
! Visualizing cube dimensions
! Connecting to an OLAP cube

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 1: Introduction to Data Warehousing and OLAP 33

Defining a Cube
Topic Objective
To introduce the concept of
a cube.
Lead-in
Cubes are the logical
storage structures for OLAP
Atlanta
databases.

Market Dimension
Chicago

Denver
Grapes

ion
Cherries

ns
me
Detroit Melons

Di
Apples

ts
uc
Q1 Q2 Q3 Q4

od
Pr
Time Dimension

The next few slides highlight Cubes are the logical storage structures for OLAP databases. They combine
query patterns of users by dimensions and measures into intuitive and flexible models that users
using the example cube manipulate to create queries.
introduced here. Use this
slide to define the cube and A cube defines a set of related dimensions that form an n-dimensional grid:
to describe the three
dimensions in this example. ! Each cell of the cube holds one value, exactly like a spreadsheet.
! The value of each cell is an intersection of the dimensions.

The cube in the preceding illustration stores sales for all products, all markets,
and for all time periods. To retrieve an annual total, users choose a product and
a market, and sum up the four quarterly cells to retrieve the annual sales.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


34 Module 1: Introduction to Data Warehousing and OLAP

Querying a Cube
Topic Objective
To demonstrate how users
isolate data with cubes.
Lead-in
Users must be able to
isolate the data in which Sales
Atlanta
Fact
Markets Dimension
they are interested, in an
intuitive and timely manner.
Chicago

Denver
Grapes
Cherries
Dallas

n
Melons

sio
Apples

n
me
Q4

Di
Q1 Q2 Q3

ts
uc
Time Dimension

od
Pr
The Sales cube in the illustration contains three dimensions:
Delivery Tip
This slide builds a query in ! Time
the following order:
1. Apples ! Products
2. Q4 ! Markets
3. Atlanta
4. Sales Fact
Sales facts are stored at the intersections of all dimensions in the cube. Users
When you press the ENTER typically want to see only the data applicable to their market, to the products
key, the first three steps of they manage, and in time periods relevant to their business questions.
the query highlight in the
above order. The Sales
A user who manages Apples in the Atlanta region wants to query the cube for
Fact intersection appears Q4 Sales values. The user can easily query this information without having to
automatically if you do not sift through all the other cube data.
press ENTER.
Note Many times users cannot see other members and data because they do not
have security access to those members and data values.

The highlighted Sales Fact is considered an intersection, or a cell, in the cube.


One member from each dimension describes an intersection. In this example,
the following members describe the Sales intersection:
! Apples
! Atlanta
! Q4

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 1: Introduction to Data Warehousing and OLAP 35

Defining a Cube Slice


Topic Objective
To define the concept of
slicing OLAP cubes.
Lead-in
The manager of Cherry
distribution wants to view Atlanta

Markets Dimension
Cherry data across all time
periods, for all markets.
Chicago

Denver
Grapes
Cherries

ion
Detroit Melons

ns
Apples

me
Di
Q1 Q2 Q3 Q4

ts
uc
Time Dimension

od
Pr
This slide is not a build The term slice is used in cubes to define a member or group of members that
slide. When delivering this are isolated and then evaluated across other dimensions. You can think of a
slide, define the term slice in slice as being a subset of a cube.
the context of the Cherry
distribution manager. The manager of Cherry distribution wants to view Cherry data across all time
periods, for all markets. The manager queries a slice of the cube to analyze
Cherries across all members of all other dimensions.
The term slice is also used as a verb, indicating the act of querying a subset of a
cube. For example, the Cherry manager slices the cube, analyzing the Cherry
sales for all markets across all time periods.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


36 Module 1: Introduction to Data Warehousing and OLAP

Working with Dimensions and Hierarchies


Topic Objective
To present the purposes of
OLAP dimensions and
hierarchies. ! Dimensions Allow You to
Lead-in $ Slice
OLAP dimensions and
hierarchies provide the $ Dice
basis for navigating in a ! Hierarchies Allow You to
cube.
$ Drill Down
$ Drill Up

One of the major purposes of an OLAP database is to provide a flexible,


Delivery Tip intuitive model for browsing data. Dimensions and hierarchies provide that
Deliver this slide by
navigating the build slide.
flexibility.
For each second-level
bullet, an animation Dimensions Allow You to Slice and Dice
illustrates the purpose of
A dimension consists of multiple members that can be compared to members of
that concept.
other dimensions. A dimension is what enables you to slice and dice data in a
cube.
! When you slice a dimension, you select a single member from that
dimension. For example, you may want to focus on only a single product,
such as Colony Muffins. A slice allows you to ignore everything except
that one product.
! When you dice a cube, you put multiple members from a dimension on an
axis and then put multiple members from a different dimension on another
axis. This allows you to view the interrelationship of members from
different dimensions.

Hierarchies Allow You to Drill Down and Drill Up


All dimensions contain a hierarchy, and for most dimensions, the hierarchy
consists of multiple levels. The multiple levels of a hierarchy allow you to drill
up and drill down.
! When you drill down on a member of a hierarchy, you see all the children of
that member. You can drill down one member at a time, or you can drill
through all the members of a level at the same time. Drilling down allows
you to focus on specific data or a possible problem area.
! When you drill up on a member or group of members in a hierarchy, you
collapse the detail so that you see only the summary information for the
parent of those members. Drilling up allows you to see a bigger picture with
fewer details.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 1: Introduction to Data Warehousing and OLAP 37

Visualizing Cube Dimensions


Topic Objective
To discuss the visualization
of multidimensional data.
Lead-in
Here we see how multiple
dimensions can be
illustrated by using
spreadsheets.

It is not difficult to conceptualize a three-dimensional cube from a two-


Delivery Tip dimensional relational table. That is because a three-dimensional cube can be
To deliver this content, open
illustrated and visualized. However, visualizing four or more dimensions can be
the DEMO_01.xls workbook
that contains these
difficult to accomplish.
worksheets. Spreadsheets can be helpful for visualizing dimensions.

Key Points
The word cube implies three
dimensions. In reality, an
OLAP cube is n-
dimensional.

Think of the previous spreadsheet as a two-dimensional cube. The cube


contains two dimensions—Region and Time. The cube stores sales across all
regions and across all time periods.
The spreadsheet illustrates that every member intersects with every other
member of the other dimensions. This is true regardless of the level of the
member’s hierarchy. For instance, Portland intersects with Jan, Q1, and Year
Total.
In the example, all intersections contain sales data. However, most cubes do not
store data for all intersections. Cubes usually contain missing data points in a
majority of the cube intersections, or cells.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


38 Module 1: Introduction to Data Warehousing and OLAP

Suppose a third dimension—Product—is added to the model. In this example,


the company sells three products: Gadgets, Gizmos, and Widgets. One way to
model the cube is by using multiple worksheets in the same workbook:

Even though the model contains three dimensions, it still is true that every
member intersects with every member of the other dimensions.
Suppose you add a fourth dimension—Employee—consisting of four members:
Jones, Phelps, Smith, and Williams. The cube can be visualized by using
multiple, multi-sheet workbooks:

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 1: Introduction to Data Warehousing and OLAP 39

Connecting to an OLAP Cube


Topic Objective State USA
To connect to an OLAP
cube by using a PivotChart.
Sales Units

Lead-in 6000

We just saw how to model


Level 02
5000
Year
four dimensions in multiple 4000
Quarter

spreadsheets. Now, let us Sheri Now mer - 2001 - Quarter 4


Sheri Now mer - 2001 - Quarter 3
connect to a 3000
Sheri Now mer - 2001 - Quarter 2

multidimensional cube by 2000


Sheri Now mer - 2001 - Quarter 1
Sheri Now mer - 2000 - Quarter 4
using a single spreadsheet. Sheri Now mer - 2000 - Quarter 3
1000 Sheri Now mer - 2000 - Quarter 2
Sheri Now mer - 2000 - Quarter 1
0
Bagels Muffins Sliced Bread Cheese Deli Meats Frozen Chicken

Bread Dairy Meat

Category Subcategory

To fully understand the power of OLAP technology, you must observe a client
Delivery Tips application connecting to an OLAP cube. Microsoft Excel 2000 PivotTables®
Click the chart in the slide
during your presentation to
and PivotCharts® connect to Analysis Services OLAP cubes and provide users
automatically connect to a with a flexible and intuitive interface to use when accessing OLAP data.
local cube file located in
When you connect to a cube, you can:
C:\Moc\2074A\Demo\
DEMO_01.cub. ! Drill up and drill down dimension hierarchies by using the mouse.
The PivotChart ! Easily change the axes in which dimensions reside.
automatically opens and you ! Select individual members to slice dimensions.
can navigate the cube in the
chart. When you drill down, ! View several members in a single dimension.
select other members, and
so on, the chart Without OLAP technology, you create an endless number of separate reports to
automatically connects to perform the same analysis that simple mouse-clicks achieve in OLAP. OLAP
the cube file. If the cube file solutions reduce the need for standard reports, report writers, SQL query
does not exist in the defined
syntax, long query times, and report printouts.
location, the chart prompts
you to connect to the proper
cube source.

Perform the steps outlined


in the student notes to
demonstrate to users the
power of OLAP.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


40 Module 1: Introduction to Data Warehousing and OLAP

Review

Topic Objective
To reinforce module
objectives by reviewing key ! Introducing Data Warehousing
points.
! Defining OLAP Solutions
Lead-in
The review questions cover ! Understanding Data Warehouse Design
some of the key concepts
taught in the module. ! Understanding OLAP Models
! Applying OLAP Cubes

1. What is the purpose of a staging area for a data warehouse?


A staging area is a collection of processes that cleans, transforms,
combines, and prepares source data for use in the data warehouse or
data mart.

2. What is the purpose of OLAP?


To provide fast, flexible access to multidimensional data for reporting
and analysis.

3. Describe the differences between relational data marts and OLAP cubes.
Relational data marts store detailed and summarized data in two-
dimensional structures, optimized for data retrieval. Relational data
marts tend to store more detailed data than multidimensional data
marts.
Multidimensional data marts contain data in n-multidimensional
structures. Because aggregated data is stored in these n-dimensional
structures, query performance exceeds that of relational data marts.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 1: Introduction to Data Warehousing and OLAP 41

4. Define the main relational components from which you build an OLAP
cube.
Fact table—A central table in a data warehouse or data mart
presenting numeric data in a context that describes a specific event in a
business
Measure—A quantitative, numerical column in a fact table. Measures
typically represent the values that users analyze.
Dimension table—A table in a data warehouse or data mart
representing a business entity.

5. What must a fact table in an OLAP data source contain?


The fact table in an OLAP cube data source must contain all cube
measures. In addition, the fact table must contain dimension
information, usually in the form of dimension keys that join with the
cube dimension tables.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 2: Introducing
Analysis Manager
Wizards
Contents

Overview 1
Defining Terms 2
Previewing Analysis Manager 3
Preparing to Create a Cube 5
Building the Sales Cube 11
Processing the Cube 23
Viewing the Results 24
Review 27
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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Instructor Notes
Presentation: This module introduces students to Microsoft® SQL Server™ 2000 Analysis
90 Minutes Manager and how to build online analytical processing (OLAP) cubes by using
the Cube and Dimension Wizards. Integrating lecture topics and demonstration,
Lab: you create a cube with four dimensions. Each dimension illustrates a unique
00 Minutes method for dimension building. After building the cube, you process it and
review the results in the Analysis Manager browser.
This is an overview module where students learn how to build, process, and
view a simple cube by using Analysis Manager built-in wizards. You introduce
many concepts quickly, leaving detailed discussion and analysis for later
modules where subjects are explored in greater depth.
After completing this module, students will be able to:
! Describe SQL Server 2000 Analysis Server components.
! Navigate through the basic interfaces of Analysis Manager.
! Prepare to create a cube by reviewing data sources and initiating the Cube
Wizard.
! Create an OLAP cube by using the Cube and Dimension Wizards.
! Process a cube.
! Browse the cube data and metadata by using the Analysis Manager browser.

Materials and Preparation


This section provides you with the required materials and preparation tasks that
are needed to teach this module.

Required Materials
To teach this module, you need Microsoft PowerPoint® file 2074A_02.ppt.

Preparation Tasks
To prepare for this module, you should:
! Read all of the student materials for this module.
! Read the instructor notes and margin notes.
! Practice combining the lecture with the demonstrations.
! 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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module Strategy
Use the following strategy to present this module:
The bulk of this module requires that you combine your lecture with
demonstrations of the topics being discussed.
! Defining Terms
Define the basic terms and components of Analysis Services.
! Previewing Analysis Manager
Begin by showing students how to start Analysis Manager. Next, describe
the console tree view and how it is used to navigate Analysis Manager.
Show students the different menus available in Analysis Manager. Finish by
showing the metadata view and the data pane.
! Preparing to Create a Cube
Introduce students to the Module 02 database, describing the fact table,
dimension keys, and measures. Explain that each dimension key will be
used to create a different type of dimension. Finally, explain that a database
structure must be set up before a cube can be built. Show how to set up the
OLAP database, combining your lecture with a demonstration.
! Building the Sales Cube
First, show students how to select a fact table and measures for the cube.
Next, explain how to create four different types of dimensions: a star
schema dimension, a snowflake dimension, a parent-child dimension, and a
Time dimension. Demonstrate how to create each type of dimension as you
give the lecture. Show students how to finalize the cube, browse sample
data, and name the cube. Finally, summarize the characteristics of the
dimensions that were created.
! Processing the Cube
Explain that, for a cube to contain useful data, it must be processed. Take
students through the steps of processing a cube, integrating the lecture with
a demonstration.
! Viewing the Results
Explain that the Analysis Manager provides a simple browser that can be
used to view values in a processed cube. Show students how to browse data
in the Sales cube. Also, show them how to browse the metadata for the
cube. Integrate your lecture with a demonstration.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Customization Information
This section identifies the lab setup requirements for a module and the
configuration changes that occur on student computers during the labs. This
information is provided to assist you in replicating or customizing Microsoft
Official Curriculum (MOC) courseware.
There are no labs in this module, and as a result, there are no lab setup
requirements or configuration changes that affect replication or customization.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 2: Introducing Analysis Manager Wizards 1

Overview
Topic Objective
To provide an overview of
the module topics and
objectives. ! Defining Terms
Lead-in ! Previewing Analysis Manager
In this module, you will learn
about the fundamentals of ! Preparing to Create a Cube
cube building within
Analysis Manager. ! Building the Sales Cube
! Processing the Cube
! Viewing the Results

This module provides you with an introduction to Microsoft® SQL Server™


2000 Analysis Services.
The objective of the module is to give you a comprehensive introduction to
cube building fundamentals by using the Analysis Manager wizards, which
include the Cube Wizard and the Dimension Wizard.
After completing this module, you will be able to:
! Describe SQL Server 2000 Analysis Server components.
! Navigate through the basic interfaces of Analysis Manager.
! Prepare to create a cube by reviewing data sources and initiating the Cube
Wizard.
! Create an online analytical processing (OLAP) cube by using the Cube and
Dimension Wizards.
! Process a cube.
! Browse the cube data and metadata by using the Analysis Manager browser.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


2 Module 2: Introducing Analysis Manager Wizards

Defining Terms
Topic Objective
To define commonly used
terms.
Lead-in ! Analysis Services
Before creating databases ! Analysis Server
and cubes by using the
Analysis Manager, you must ! Analysis Manager
understand fundamental
terms applicable to Analysis ! PivotTable Service
Services.

Before creating databases and cubes by using the Analysis Manager, you must
understand fundamental terms applicable to Analysis Services.
The following are the product definitions for Analysis Services:
! Analysis Services. Microsoft SQL Server 2000 Analysis Services. The
Microsoft OLAP and data mining product that ships with SQL Server 2000
and includes the server and client software.
! Analysis Server. The central component of Analysis Services. Analysis
Server contains an OLAP engine and a data mining engine that runs as a
service under Microsoft Windows® 2000, or Microsoft Windows NT® with
Service Pack 5 or later. The Analysis Server service is called
MSSQLServerOLAPService.
! Analysis Manager. The administrative user interface for Analysis Server.
Analysis Manager runs under Windows 2000 and Windows NT.
! PivotTable Service. The client component of Analysis Services, commonly
referred to as PTS. PTS runs under Windows 2000, Windows NT, Microsoft
Windows 98, and Microsoft Windows 95. PTS is different from Microsoft
Excel PivotTables®.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 2: Introducing Analysis Manager Wizards 3

Previewing Analysis Manager


Topic Objective
To describe Analysis
Manager and to explain all
of the major interface
components.
Lead-in
Analysis Manager is the
user interface for designing
and administering Analysis
Server databases and
cubes.

Delivery Tips Analysis Manager is the interface for designing and administering Analysis
Note that more than one Server databases and cubes. It is a snap-in application in Microsoft
server may appear below Management Console (MMC), a common interface for hosting administrative
the Analysis Servers folder. tools. Analysis Manager contains various panes and menus that assist you in
When performing the administering Analysis Server objects.
demonstration, ensure that
students log on to the
Analysis Server located on
Console Tree View
their own computers. The tree view in the left pane of MMC, also referred to as the console tree, is
the primary means for navigating Analysis Manager.
Deliver these materials
while performing an informal Each level of the tree contains folders, OLAP objects, or both. The Analysis
demonstration of the Servers folder displays a list of servers that are available to you. Because only
Analysis Manager. one server can run on a single computer at a time, each server displays the name
of the computer running it.
Stress the usefulness of
right-clicking. In Analysis The server name acts as a folder for OLAP databases on that server. Each
Manager, when you want to Analysis Server can contain one or more databases. Databases can manage one
perform actions on server or many cubes. Shared components such as dimensions, roles, and data sources
objects, you usually do so are also stored at the database level.
by right-clicking the object.
The following folders are found under each OLAP database folder:
Do not spend too much time
on the data pane at this ! Data Sources
point. Using the data pane ! Cubes
for browsing data is covered
more thoroughly later in the ! Shared Dimensions
module. ! Mining Models
! Database Roles

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


4 Module 2: Introducing Analysis Manager Wizards

Menu System
You have access to several menus in Analysis Manager and MMC. MMC snap-
in applications such as Analysis Manager have two levels of menus.
The top-level menusConsole, Window, and Helpbelong to MMC itself
and do not apply to the current snap-in application.
The second level of menus is actually a toolbar. This toolbar contains the
Action, View, and Help menus, which are specific to the current MMC snap-in
applicationin this case, Analysis Manager.
The Action menu, which contains most of the functionality, is context-
sensitive. In other words, the commands that appear on the menu change
depending on the object you select in the tree view. The same commands that
appear on the Action menu also appear on a shortcut menu displayed by right-
clicking an item in the tree view.

Metadata View
The details pane can display a metadata view, which is a convenient technique
to review statistics about databases, cubes, and dimensions.
The metadata view is context-sensitive. The information that is displayed is
dependent on the folder that is selected in the Tree view. For example, at a
particular cube level, dimensions, measures, and cube size are among the
elements available in the metadata view.

Data Pane
The data pane enables you to browse the data of your cubes. This view is
accessible only at the cube level.

Note The details pane displays the Getting Started, Metadata, and Data tabs
only when HTML mode is enabled. To enable or disable HTML mode on the
toolbar, click View and then click HTML.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 2: Introducing Analysis Manager Wizards 5

# Preparing to Create a Cube


Topic Objective
To introduce the topics that
this section covers.
Lead-in ! Reviewing the Data Source
Before you develop a ! Setting up the OLAP Database
prototype cube, review the
data source used to build
the cube.

Before you develop a prototype cube, you review the data source that was used
Delivery Tip to build the cube. You must also understand how to create the OLAP database
Use this slide simply to
introduce the bullets on this
that contains the cube, as well as all of the related cube objects.
slide. Cover the two
sections when you arrive at
the next two slides.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


6 Module 2: Introducing Analysis Manager Wizards

Reviewing the Data Source


Topic Objective
To introduce the Module 02
database, which is used as
the data source for the
cube.
Lead-in
The cube that you will
create in the module is
based on a simple SQL
Server database.

You base the cube created in this module on a SQL Server database called
Delivery Tip Module 02. The database is a scaled-down version of the Foodmart 2000
You can present the tables
and keys by using the slide,
database that is included with Analysis Services.
or you can open SQL Server The Module 02 data warehouse is small and uncomplicated so that you can
Enterprise Manager directly,
easily describe its structure. This database illustrates basic dimension types.
connect to the Module 02
database, and open the
Module 02 Schema Note For more information about different types of dimensions, see module 4,
diagram. “Setting up Dimensions”, in course 2074A, Designing and Implementing OLAP
Solutions with Microsoft SQL Server 2000.

Module 02 Database Structure


The preceding diagram illustrates the structure of the Module 02 database,
which consists of a single fact table: SalesFact.
The SalesFact table has four dimension keys:
! Month
! State_ID
! Product_ID
! Employee_ID

In addition, the SalesFact table contains two measures:


! Sales_Units
! Sales_Dollars

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 2: Introducing Analysis Manager Wizards 7

Fact Table and Dimension Table Relationships


The following describes how the fact table and dimension tables are used to
create the cube dimensions:
! The State_ID key is joined to a single dimension table, creating a star
schema dimension.
! The Product_ID key is joined to a chain of dimension tables, creating a
snowflake schema dimension.
! The Employee_ID key is joined to the Employee dimension table, creating
a parent-child dimension.
! The Month key will create an entire hierarchy by using the Dimension
Wizard.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


8 Module 2: Introducing Analysis Manager Wizards

Setting Up the OLAP Database


Topic Objective
To explain how to create a
new OLAP database and to
prepare for the creation of ! Creating the New Database
the Module 02 database
cube.
! Starting the Cube Wizard
Lead-in ! Specifying a Data Source
You must create an OLAP
database before designing
and building a cube.

You must set up an OLAP database before designing and building a cube. An
OLAP database in Analysis Services is a collection of cubes and related cube
objects. After creating an OLAP database, you can begin creating the Module
02 database cube by starting the Cube Wizard.
The first table to assign in the Cube Wizard is the fact table. To assign a fact
table for a cube, you must specify a data source for the database. To do so, you
refer the Analysis Server Module 02 OLAP database to the SQL Server
Module 02 database.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 2: Introducing Analysis Manager Wizards 9

Demonstration: Preparing to Build the Sales Cube


Topic Objective
To demonstrate how to
review the data source for
the cube and create the
OLAP database that
contains the cube.
Lead-in
In this demonstration, you
will learn how to perform the
tasks that are performed
before building an OLAP
cube.

Delivery Tips In this demonstration, you will learn how to perform the tasks that are
Encourage students to performed before building an OLAP cube. You will connect to the Analysis
follow along with your Server, define an OLAP database, and specify the data source for the cube.
demonstration on their
computers. ! To verify that the Analysis Server is running on your computer
Periodically ask students
1. Log in to the NWTraders classroom domain by using the data in the
how they are doing to following table.
ensure that they are keeping Option Value
up with your demonstration.
User Name SQLAdminx (where x is your computer number)
The procedures in this Password Password
demonstration are:
1. Verify running service.
2. Click Start, point to Programs, point to Administrative Tools, and then
2. Open Analysis Manager.
3. Create OLAP Database. click Computer Management.
4. Start Cube Wizard. 3. Expand Services and Applications.
5. Define Data Source.
4. Double-click Services.
You may want to 5. Scroll down, and verify that the service MSSQLServerOLAPService
incorporate these exists and is running in the right pane of the Computer Management
demonstration procedures in
window.
the previous lecture topics.
The status of MSSQLServerOLAPService should indicate Started.
6. If the service is not started, right-click MSSQLServerOLAPService, and
then click Start.
7. Close the Computer Management window.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


10 Module 2: Introducing Analysis Manager Wizards

! To start Analysis Manager and connect to the Analysis Server


1. Click Start, point to Programs, point to Microsoft SQL Server, point to
Analysis Services, and then click Analysis Manager.
Microsoft Management Console and Analysis Manager are invoked.

Note Where you invoke Analysis Manager on the Start menu depends on
how Analysis Services was configured during installation. The procedure
here describes the steps for starting Analysis Manager if a default
installation was performed on your computer.

2. In the tree pane of the MMC console, expand the Analysis Servers folder.
3. Double-click the server name to which you will be connecting.

! To define an OLAP database


1. Right-click the local Analysis Server, and then click New Database to
display the Database dialog box.
2. Type Module 02 in the Database name box, type Market Sales in the
Description box, and then click OK.
3. Expand the Module 02 database folder in the tree view.
You now see five folders below the database. When you first define a
database, these folders are empty.

! To start the Cube Wizard


1. In the Module 02 database, right-click the Cubes folder, point to New
Cube, and then click Wizard.
2. At the initial welcome page, click Next.

! To specify a data source


1. From the Select a fact table from a data source page, click New Data
Source.
The Data Link Properties dialog box appears.
2. Click Microsoft OLE DB Provider for SQL Server, and then click Next.
3. On the Connection tab at step 1, type localhost in the Select or enter a
server name box.
4. At step 2, click Use Windows NT Integrated security.
5. At step 3, in the Select the database on the server box, click Module 02
from the list.
It will take a few seconds to connect to your computer’s SQL Server
because it searches for the available databases.
6. Click the Test Connection button to ensure the data source definition is
correct, and then click OK.
7. Click OK, closing the Data Link Properties dialog box.
Notice that the data source and its tables are now accessible from the Data
sources and tables box.
8. Leave the Cube Wizard open in preparation for the next demonstration.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 2: Introducing Analysis Manager Wizards 11

# Building the Sales Cube


Topic Objective
To introduce the next
section, which takes ! Selecting the Fact Table and Measures
students through the
process of defining their ! Creating a Star Schema Dimension
cubes and dimensions.
! Creating a Snowflake Dimension
Lead-in
After you create an OLAP ! Creating a Parent-Child Dimension
database and specify a data
source within the database, ! Creating a Time Dimension
you can build a cube.
! Finalizing the Cube
! Summarizing the Sales Dimensions

After you create an OLAP database and specify a data source in the database,
Delivery Tip you can build a cube. A cube contains measures, such as sales or cost. A cube
Use this slide as an
introduction to the section.
also contains dimensions, such as region, time, and product.
Do not describe each In this section, you will learn the basic procedures required to build a cube
dimension type at this time.
within Analysis Services. You will learn about the following topics:
! Selecting the fact table and measures
! Creating the dimensions
! Finalizing the cube
! Summarizing the Sales dimensions

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


12 Module 2: Introducing Analysis Manager Wizards

Selecting the Fact Table and Measures

Topic Objective
To show students the step
for selecting measures.
Lead-in
Each cube has one fact
table, which determines the
contents of the cube.

Each cube contains one fact table that determines the contents of the cube.
Specifically, fact tables contain the cube measures.
Measures are the numeric values that users analyze in cubes. All measures in a
cube come from a single fact table.
When you begin to design a cube in the Cube Wizard, you first select a fact
table, and then you select measures from that fact table.

The Cube Wizard prompts you to choose a fact table by listing all of the tables
within the source relational database management system (RDBMS)—even the
tables that are not fact tables.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 2: Introducing Analysis Manager Wizards 13

Creating a Star Schema Dimension


Topic Objective
To describe the State star
schema dimension.
Lead-in
After you specify the
measures, you select—or
create—dimensions.

After you specify the measures, you select—or create—dimensions. To create a


new dimension by using the Cube Wizard, you start a second wizard, which is
called the Dimension Wizard.
The SalesFact table in the Module 02 database contains four dimension keys:
! Month
! State_ID
! Product_ID
! Employee_ID

You use each of the four dimension keys in the SalesFact table to create a
dimension, each by a different method.
You create the State dimension by using the star schema method.
The State_ID key joins to a single dimension table named State. The State
dimension table includes columns suitable for creating a three-level hierarchy
consisting of the following levels:
! Country
! Region
! State_Name

A single star schema dimension table contains all of these levels. By using the
Cube Wizard, which accesses the State table, you select the levels in the correct
order.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


14 Module 2: Introducing Analysis Manager Wizards

Creating a Snowflake Dimension

Topic Objective
To briefly define a snowflake
dimension.
Lead-in
A snowflake schema
dimension is a dimension
defined by more than one
dimension table. You create
the Product dimension by
using the snowflake schema
method.

Analysis Services gives you the flexibility to create dimensions when your
database source contains multiple tables defining a single dimension. A
snowflake schema dimension is a dimension defined by more than one
dimension table. You create the Product dimension by using the snowflake
schema method.

Defining the Product Dimension


The following related tables exist in the data source and define the Product
dimension:
! Product Category
! Product Sub Category
! Product

These tables correspond to the levels required for the Product dimension. Each
dimension table contains a column for a single level of a three-tier hierarchy.
This is a classic snowflake dimension.

Creating the Dimension


You use the Dimension Wizard to define the Product dimension. You perform
the following general steps in the Dimension Wizard to define the Product
dimension:
1. Click the snowflake schema dimension option.
2. Select the tables that define the dimension.
3. Create and edit joins between the dimension tables.
4. Select the levels that define the dimension.
5. Name the dimension.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 2: Introducing Analysis Manager Wizards 15

Creating a Parent-Child Dimension


Topic Objective
To briefly explain parent-
child dimensions.
Lead-in
You now will create the
Employee dimension by
using the parent-child
method.

You create the Employee dimension by using the parent-child method.


Delivery Tip
When presenting the
Employee table on the Defining the Employee Dimension
preceding graphic slide, ask Following are the key relationships in the Employee dimension:
students how the three
columns interact. Explain ! The Employee_ID key of the SalesFact table is joined to the Employee
that the first column defines dimension table.
the members included in the
dimension, the second ! Each Employee_ID in the SalesFact table corresponds to an employee
column defines the name of record in the Employee table.
the members, and the third ! Each record in the Employee table also has a Manager_ID column,
column defines the
which—if this were a snowflake schema dimension—would join to another
placement of the members
in the dimension. table for the next level of the hierarchy. However, a manager is also an
employee, so the Manager_ID column actually joins back to the
If students are still confused Employee_ID column of the Employee table.
after the discussion, have ! The Employee_Name column in the Employee table names each
students talk you through Employee_ID. You use the column to name the members in the Employee
the Employee dimension
dimension.
table structure by drawing
the dimension hierarchy on
a whiteboard or flipchart Using a Parent-Child Table
based upon the table The Employee table is considered a parent-child table. A parent-child table
structure. allows a dimension to have an unbalanced hierarchy—where some branches of
the hierarchy contain more levels than other branches.
Do not spend additional time
describing parent-child A parent-child dimension is similar to a snowflake dimension in that each join
dimensions, as they are creates a new level. The difference from a snowflake dimension is that the
discussed in detail in later higher levels in the parent-child hierarchy derive from the same table as the
modules.
lowest levels.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


16 Module 2: Introducing Analysis Manager Wizards

Creating a Time Dimension


Topic Objective
To explain the steps for
creating the Time
dimension.
Lead-in
You create the Time
dimension directly from the
SalesFact table.

Almost all cubes contain a dimension that tracks time. The level of detail stored
for time varies considerably—for example, one cube may store data only at a
yearly level while another cube may store data at hourly intervals.
You create the Time dimension directly from the SalesFact table. In the
Module 02 database, no separate dimension table exists for the Time
dimension. Only a column labeled Month resides in the fact table.
Analysis Services can use the fact table itself as a dimension table. It simply
extracts unique values from the column you select.
You normally need a dimension table to define a hierarchy. The Dimension
Wizard, however, can generate an entire hierarchy from a single Date/Time
column. The wizard automatically generates several date-related hierarchies and
then gives you the option of selecting a hierarchy that meets your need.

Note The automatic construction of the date/time hierarchy requires that a field
in the source RDBMS be a Date/Time data type. However, it is possible to
manually build time dimensions from fields that are not Date/Time fields.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 2: Introducing Analysis Manager Wizards 17

Finalizing the Cube


Topic Objective
To finish creating the cube
in the Cube Wizard.
Lead-in ! Finalizing the Dimensions
You now continue in the ! Naming the Cube
Cube Wizard—finalizing the
dimensions for the cube, ! Introducing the Cube Editor
browsing cube sample data,
and naming the cube.

Continuing in the Cube Wizard, you now:


! Finalize the dimensions for the cube.
! Browse cube sample data.
! Name the cube.

Finalizing the Dimensions


From the Select dimensions for your cube dialog box in the Cube Wizard, you
can use arrow keys to deselect a dimension or reselect all dimensions.
If you have existing dimensions in the Module 02 database, they can be added
to the cube by clicking the > key.
All of the dimensions created for the Module 02 database cube are listed in the
Cube dimensions pane and are therefore included in the cube.

Naming the Cube


The last step in building a cube is to name it. You will name the cube by typing
Sales in the Cube name box.

Introducing the Cube Editor


Once you finish designing the Sales cube in the Cube Wizard, the Cube Editor
opens.
The Cube Editor provides access to properties and options not available in the
wizard. The Cube Wizard terminates in the Cube Editor, so that you can review
or refine definitions of the cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


18 Module 2: Introducing Analysis Manager Wizards

Demonstration: Building the Sales Cube


Topic Objective
To demonstrate how to build
the Sales cube.
Lead-in
In this demonstration, you
will learn how to build an
OLAP cube.

In this demonstration, you will learn how to build an OLAP cube. You will
define the fact table, select the measures, create the dimensions, and name the
Delivery Tips cube.
Encourage students to
follow along with your ! To choose the fact table from the Module 02 database
demonstration on their
computers. 1. From the Select a fact table from a data source step in the Cube Wizard,
click SalesFact in the Data sources and tables box.
Periodically ask students
how they are doing to
2. Click Browse Data to review the fact table information.
ensure that they are keeping 3. Close the Browse Data window, and then click Next to move to the next
up with your demonstration. page in the wizard.
The procedures in this
demonstration are:
! To select measures for the Module 02 database cube
1. Choose fact table. 1. From the Select the numeric columns that define your measures step,
2. Select measures. add Sales_Dollars and Sales_Units to the Cube measures box by double-
3. Create star-schema State clicking each one or by selecting each measure and clicking the right arrow
dimension. button (>).
4. Create snowflake-schema
Product dimension. 2. Click Next to move to the next step in the wizard.
5. Create parent-child
Employee dimension. ! To create the State dimension for the Module 02 database
6. Create star-schema Time
dimension. 1. To start the Dimension Wizard, click New Dimension in the Cube Wizard.
7. Name the cube Sales. 2. To continue through the welcome page, click Next.
8. Close the Cube Editor.
3. Click Star Schema: A single dimension table, and then click Next.
Briefly describe each
4. In the Select the dimension table page, click State from the Available
dimension structure, but do
not describe the structures tables list.
in too much detail, because 5. Click Next to move to the next page in the wizard.
they are described
thoroughly in later modules.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 2: Introducing Analysis Manager Wizards 19

6. In the Select the levels for your dimension page, sequentially double-click
Country, Region, and State_Name.
You must click levels in the correct order when defining levels because the
Delivery Tips order defines the placement of a level in a dimension. You select levels
The Dimension Wizard does
not resize table widths to
from the most summarized to the most detailed.
accommodate long table 7. Click Next three times—after selecting the levels, to bypass the Specify the
names. Therefore, when member key columns page, and to bypass the Select advanced options
you create the Product page.
dimension, you will need to
resize the various product 8. Type State in the Dimension name box.
tables to view their full 9. In the Preview box, expand the All New Dimension member and the USA
names in the Create and
member, and then click Finish.
edit joins step of the
Dimension Wizard. When the Dimension Wizard creates the dimension, it uses the dimension
name you enter as the top-level member name, preceded by the word All. In
Point out that the data being this case, All State will replace All New Dimension.
viewed in the browser is not
real data. The numbers are
sample data only.
! To create the Product dimension for the Module 02 database
1. To start the Dimension Wizard, click New Dimension in the Cube Wizard.
2. To continue through the welcome page, click Next.
3. Click Snowflake Schema: Multiple, related dimension tables, and then
click Next.
4. Double-click the dimension tables in the following order:
• Product
• Product Subcategory
• Product Category
5. To move to the Create and edit joins page, click Next.
The Create and edit joins page allows you to confirm the relationships
between the dimension tables.
6. If you added the tables in the correct order, the wizard suggests the proper
relationships by automatically connecting joined fields. Click Next to
continue.
7. If necessary, add joins between the two Subcategory_ID columns and the
two Category_ID columns by dragging and dropping columns between the
tables.
8. Double-click the following columns:
• Category, not Category_ID
• Subcategory, not Subcategory_ID
• Product_Name
9. Click Next three times—after selecting the levels, to bypass the Specify the
member key columns page, and to bypass the Select advanced options
page.
10. Type Product as the name of the dimension. You can preview the
dimension hierarchy from the Preview box, and then click Finish.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


20 Module 2: Introducing Analysis Manager Wizards

! To create the Employee dimension for the Module 02 database


1. To start the Dimension Wizard, click New Dimension in the Cube Wizard.
2. To continue through the welcome page, click Next.
3. Click Parent-Child: Two related columns in a single dimension table,
and then click Next.
4. Click Employee as the dimension table, and then click Next.
5. From the Select the columns that define the parent-child data hierarchy
page, select the parent-child hierarchy by performing the following steps:
a. In the Member key list, click Employee_ID. This is the column that is
joined to the fact table.
b. In the Parent key list, click Manager_ID.
c. In the Member name list, click Employee_Name.
6. Click Next twice—after defining the parent-child hierarchy, and to bypass
the Select advanced options step.
7. Type Employee as the name of the dimension, and then expand each
member in the Preview box that has a plus sign to the left of the blue icon.
8. Click Finish.

! To create the Time dimension for the Module 02 database


1. To start the Dimension Wizard, click New Dimension in the Cube Wizard.
2. To continue through the welcome page, click Next.
3. Click Star Schema: A single dimension table, and then click Next.
4. Click SalesFact as the dimension table, and then click Next.
Because the SalesFact table contains a Date/Time column, the wizard
displays a page offering to create a Time dimension based on that column.
In the Date column list in the Select the dimension type page, you can
choose which date column to use if there is more than one in the table. In
this case, there is only one Date/Time column. Therefore, Month is
selected.
5. On the Select the dimension type page, click Time dimension, and then
click Next.
In the Create the time dimension levels page, you can select the type of
time dimension hierarchy you want for the cube. You can specify the day
and month the year starts on, which is useful for dealing with fiscal years.
6. In the Select time levels list, click Year, Quarter, Month.
7. Click Next twice—to proceed to the next step of the wizard, and to bypass
the Select advanced options page.
8. Type Time as the name of the dimension, and then expand the hierarchy in
the Preview box to see the Year, Quarter, and Month levels of the
hierarchy.
9. Click Finish to return to the Cube Wizard.
You now see the four dimensions in the Cube dimensions list.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 2: Introducing Analysis Manager Wizards 21

! To name the Module 02 database cube


1. Verify that State, Product, Employee, and Time are included in the cube,
and then click Next.
2. Click Yes to the question Do you want to count the fact table rows?
3. Type Sales in the Cube name box.
4. Click Browse Sample Data to preview cube sample data.
Notice that the data displayed is sample, not real, data.
5. Close the Cube Browser window and then click Finish to complete the cube
design.

! To close the Cube Editor


• On the File menu, click Exit to close the Cube Editor, and then click No to
the question Do you want to set storage options now?

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


22 Module 2: Introducing Analysis Manager Wizards

Summarizing the Sales Dimensions


Topic Objective
To summarize the types of Dimension Number of Star, Dimension
dimensions created in the Name Table(s) Dimension Snowflake, Type
Sales cube. Tables or Parent-
Child
Lead-in
The Module 02 database State State 1 Star Standard
now has four dimensions,
each one created by using a Product Product, 3 Snowflake Standard
different method. Product Category,
Product
Subcategory

Employee Employee 1 Parent-Child Standard

Time SalesFact 0 Star Time

The Module 02 database cube now has four dimensions that originated from
the Module 02 SQL Server data source. All four dimensions are unique in how
they were constructed.
The following table summarizes key characteristics of each of the four
dimensions.
Number of Star,
Dimension Dimension Snowflake, or Dimension
Name Table(s) Tables Parent-Child Type

State State 1 Star Standard

Product Product, 3 Snowflake Standard


Product
Category,
Product
Subcategory
Employee Employee 1 Parent-Child Standard
Time SalesFact 0 Star Time

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 2: Introducing Analysis Manager Wizards 23

Processing the Cube


Topic Objective
To show students the dialog
box that documents cube
processing steps.
Lead-in
Though the Cube Wizard
saves the definition of the
cube, the act of saving does
not create actual cube files.

The Cube wizard defines the structure of the cube. The act of saving the cube
stores the definition in the OLAP repository database, but it does not create
actual cube files or load values from the data warehouse.
To use the cube, you must first process it. When you process a cube, the
Analysis Server automatically processes any dimensions in the cube that have
not yet been processed. Therefore, to process the cube and all of its dimensions,
you need to execute only one command.
When you process this cube, Analysis Services copies the detail values from the
fact table into a proprietary data structure. In this cube, because we did not
design aggregations, Analysis Services stores the data using the propriety data
structure and does not store any aggregated values.
For a small cube, such as the Sales cube, the lack of aggregates does not hinder
the ability to browse the cube data.

Note For more information about storage options and aggregation design, see
module 8, “Managing Storage and Optimization” in course 2074A, Designing
and Implementing OLAP Solutions with Microsoft SQL Server 2000.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


24 Module 2: Introducing Analysis Manager Wizards

Viewing the Results


Topic Objective
To describe the process of
browsing the cube data and
the cube metadata. ! Browsing the Cube
Lead-in ! Viewing the Metadata
You can use a simple
browser provided by the
Analysis Manager to view
the values in the Sales
cube.

You can use the Cube Browser interface included with Analysis Manager to
view values in a processed cube. In addition, you can view metadata describing
the structure and the size of the cube in Analysis Manager.

Browsing the Cube


After the Sales cube is processed, you can browse the actual data by using the
Cube Browser. You browse data by right-clicking the cube, and then clicking
Browse Data.
If the cube has not been processed, no data exists and you cannot view the
actual cube data. However, in most instances you can browse sample data
within the Cube Editor after you define the structure of the cube.

Viewing the Metadata


You can browse the metadata for information about a cube. The information
includes the dimensions and measures in the cube, the cube storage mode, the
size of the cube, and the time the cube is processed. You view cube metadata by
clicking the cube and then by clicking Metadata on the detail pane.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 2: Introducing Analysis Manager Wizards 25

Demonstration: Processing and Browsing the Cube


Topic Objective
To demonstrate how to
process and browse a cube.
Lead-in
In this demonstration, you
will learn how to process a
cube and then view data
from the cube.

In this demonstration, you will learn how to process a cube and then view data
Delivery Tip from the cube.
Encourage students to
follow along with your
demonstration on their ! To process the Sales cube
computers. 1. Expand the Cubes folder of the Module 02 database, right-click the newly
created Sales cube, and then click Process.
Periodically ask students
how they are doing to 2. Click OK to begin processing.
ensure that they are keeping
A log appears showing the progress of the processing operation. As each
up with your demonstration.
dimension and cube partition is processed, a group of entries appears in the
The procedures in this log.
demonstration are: 3. Click Close to close the Process dialog box after the cube finishes
1. Process the Sales cube. processing.
2. Browse Sales cube data.
3. View metadata for Sales.
! To browse data in the Sales cube
1. Right-click the Sales cube in the Module 02 database, and then click
Browse Data.
The cube browser displays all measures and one dimension in the data grid.
The remaining dimensions appear at the top of the browser in the Slicer
pane.
In the row or column areas, a plus sign (+) indicates that you can expand the
hierarchy and view more detail. A minus sign (–) indicates that you can
collapse the hierarchy to view less detail.
2. Double-click the Sheri Nowmer member to see the employees below Sheri
in the hierarchy.
3. Double-click the Sheri Nowmer member again to collapse the hierarchy.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


26 Module 2: Introducing Analysis Manager Wizards

4. Click and then drag the State button from the Slicer pane over the top of the
Level 02 label in the row area. When the mouse pointer icon includes a
double-headed arrow, release the mouse button.
The browser interchanges, or pivots, the two dimensions.
5. Double-click the Country label, the column heading, to expand countries in
one action.
Canada, Mexico, and USA all appear at one time.
6. Click and then drag the Product button from the Slicer pane over the top of
the Canada label. When the mouse pointer icon does not include a double-
headed arrow, release the mouse button.
The browser combines the two dimensions within the row headings.

Note You can drag and drop from the Slicer pane to the data grid to add a
column or row respectively. You can drag and drop the dimension from the
Slicer pane or data grid to replace the column or row respectively on the
data grid.

7. Click Close to return to the Analysis Manager tree view.

! To view the metadata for the Sales cube


• Click the Sales cube in the tree view of Analysis Manager, and then click
Metadata from the details pane.
You can now see all metadata defined for the Sales cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 2: Introducing Analysis Manager Wizards 27

Review
Topic Objective
To reinforce module
objectives by reviewing key
points. ! Defining Terms
Lead-in ! Previewing Analysis Manager
The review questions cover
some of the key concepts ! Preparing to Create a Cube
taught in the module.
! Building the Sales Cube
! Processing the Cube
! Viewing the Results

1. What is the difference between Analysis Services and Analysis Server?


Analysis Services is the product that contains both client and server
components. Analysis Server is the server-side, central component of
Analysis Services. It is an OLAP database server and a data mining
server that runs under Windows NT and Windows 2000 as a service.

2. In what interface does Analysis Manager run as a snap-in application?


Microsoft Management Console (MMC).

3. How can you verify that the Analysis Server is running?


You can examine the services running on the Analysis Server computer
to verify that MSSQLServerOLAPService is running.

4. How do you reference the Module 02 SQL Server database in the Sales
cube?
When you create the cube and start the cube wizard, the first step is to
define a data source for the cube. At this point, you define the SQL
Server data source, which in the example is Module 02.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


28 Module 2: Introducing Analysis Manager Wizards

5. What action must you perform on a cube before viewing cube data?
You must process a cube before you can view cube data.

6. What is the difference between the Module 02 OLAP database and the
Module 02 SQL Server database?
The Module 02 OLAP database is the database that is created in
Analysis Manager and that contains the cube, the data source, and the
dimensions.
The Module 02 SQL Server database is the data warehouse source used
to define and build the Module 02 OLAP database.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 3:
Understanding Analysis
Services Architecture
Contents

Overview 1
Microsoft Data Warehousing Overview 2
Analysis Services Components 8
Metadata Repository 12
Cube Storage Options 14
Client Architecture 24
Office 2000 OLAP Components 30
Review 31
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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 3: Understanding Analysis Services Architecture iii

Instructor Notes
This module provides students with an architectural foundation for the many
Presentation: different system components that comprise Microsoft® SQL Server™ 2000
60 Minutes Analysis Services. The various elements are introduced in this module.
Lab:
00 Minutes After completing this module, students will be able to:
! Describe the components of the Microsoft data warehousing strategy.
! Understand the Microsoft SQL Server 2000 Analysis Server components.
! Describe the function of the Microsoft Metadata Repository.
! Explain the basic differences between the three storage modes for online
analytical processing (OLAP) cubes—multidimensional OLAP (MOLAP),
relational OLAP (ROLAP), and hybrid OLAP (HOLAP).
! Understand client architecture and the role of PivotTable® Service (PTS).
! Recognize Microsoft Office 2000 OLAP capabilities.

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_03.ppt.

Preparation Tasks
To prepare for this module, you should:
! Read all the materials for this module.
! Read the instructor notes and margin notes for this module.
! Practice the lecture presentation.
! Review the Trainer Preparation presentation for this module on the Trainer
Materials compact disc.
! Review relevant white papers that are located on the instructor compact
disc.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


iv Module 3: Understanding Analysis Services Architecture

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. What are some of the third-party client applications that access Analysis
Server?
As of the date of publication of course 2074A, Designing and
Implementing OLAP Solutions with Microsoft SQL Server 2000, these are
the companies taken from the Microsoft Web site
http://www.microsoft.com/SQL/offerings.htm that provide client front-
end support for Analysis Services: Cognos®, Comshare®, AppsCo™,
Business Objects®, Knosys™, OutlookSoft™, and Seagate Software™.
2. Must PTS exist on all client computers accessing data from Analysis
Server? Is it possible for PTS to reside on a middle-tier?
Analysis Services makes it possible to connect from a thin client to the
server by using Internet protocols.
3. Can the metadata repository be migrated to a data source other than SQL
Server?
No.
4. How can programmers develop applications that access PTS?
PTS is bundled with Microsoft Excel 2000 as well as with Microsoft
Visual Studio®. Therefore, programmers have access to PTS in
Microsoft Visual Basic®.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 3: Understanding Analysis Services Architecture v

Module Strategy
Use the following strategy to present this module:
! Microsoft Data Warehousing Overview
This section introduces the components of the Microsoft data warehousing
and business intelligence strategy. The first slide acts as an introductory
slide. Use the first slide to introduce the section, then deliver the following
five slides in more detail, emphasizing the specific information for each
element. Each slide lists the concepts to teach in the lecture.
! Analysis Services Components
This section focuses on the overall architecture of Analysis Services. The
first slide is a build slide that highlights each component one at a time. Take
your time and thoroughly describe each component in detail. Realize that
some topics such as PTS and Decision Support Objects (DSO) are covered
later in the module. The architecture build slide is followed by a discussion
of Analysis Manager and DSO, and Analysis Server characteristics. Prepare
for this section from the student notes and the SQL Server Books Online.
! Metadata Repository
This one-page section is an important overview of the metadata repository.
Go through the lecture and describe the metadata repository’s importance
and role. After the lecture, you can incorporate an informal demonstration
by opening Microsoft Windows® Explorer and navigating to the metadata
repository in the Bin directory.
! Cube Storage Options
This section begins by introducing the three storage modes—MOLAP,
ROLAP and HOLAP. A key point to emphasize is that the storage mode
assigned to cubes is transparent and unimportant to users. Quickly present
the three storage modes. They are covered in substantial detail in module 8,
“Managing Storage and Optimization,” in course 2074A, Designing and
Implementing OLAP Solutions with Microsoft SQL Server 2000.
After the storage mode discussion, your lecture reviews partitions, virtual
cubes, database and cube structure, and Analysis Services limits. The slides
for these topics have useful graphics and tables to help you with the lecture.
! Client Architecture
This section introduces PTS. Emphasize the fact that PTS must be used to
access data from an OLAP cube by whatever client tool is used. In addition
to PTS, you will cover the specifics of intelligent caching and
multidimensional expressions (MDX). The intelligent caching animated
slide is integrated with the lecture. The last subject is MDX, and the slide is
intended to introduce its place and importance in Analysis Services.
! Office 2000 OLAP Components
This section describes the roles of Microsoft Excel PivotTables and the Web
Pivot control—two OLAP features in Office 2000 that depend on PTS in the
background. While describing Excel PivotTables, be sure to clarify the
difference between PivotTables and PivotTable Services.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


vi Module 3: Understanding Analysis Services Architecture

Customization Information
This section identifies the lab setup requirements for a module and the
configuration changes that occur on student computers during the labs. This
information is provided to assist you in replicating or customizing Microsoft
Official Curriculum (MOC) courseware.
There are no labs in this module, and as a result, there are no lab setup
requirements or configuration changes that affect replication or customization.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 3: Understanding Analysis Services Architecture 1

Overview
Topic Objective
To provide an overview of
the module topics and
objectives. ! Microsoft Data Warehousing Overview
Lead-in ! Analysis Services Components
In this module, you will learn
about the many different ! Metadata Repository
elements that make up
Analysis Services. ! Cube Storage Options
! Client Architecture
! Office 2000 OLAP Components

Use this slide to introduce There are many elements that make up Microsoft® SQL Server™ 2000 Analysis
the concepts that are Services. The purpose of this module is to provide an architectural foundation
presented in this module. for the different system components.
Tell students that most of
these subjects will be After completing this module, you will be able to:
covered in substantial detail
in module 8, “Managing ! Describe the components of the Microsoft data warehousing strategy.
Storage and Optimization,” ! Understand the SQL Server Analysis Server components.
in course 2074A, Designing
and Implementing OLAP ! Describe the function of the metadata repository.
Solutions with Microsoft ! Explain the basic differences between the three storage modes for online
SQL Server 2000.
analytical processing (OLAP) cubes—multidimensional OLAP (MOLAP),
relational OLAP (ROLAP), and hybrid OLAP (HOLAP).
! Understand client architecture and the role of PivotTable® Services (PTS).
! Recognize Microsoft Office 2000 OLAP capabilities.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


2 Module 3: Understanding Analysis Services Architecture

# Microsoft Data Warehousing Overview


Topic Objective
To introduce the
components of the Microsoft
data warehousing strategy.
Lead-in
Analysis Services is just one OLTP DTS DW DTS Analysis OLE DB
component of the Microsoft
data warehousing and Source Storage Services for OLAP, Clients
business intelligence ADO MD
strategy.

Each of the above components provides an important function in the data


Delivery Tip warehousing framework. In this section, you will learn about the components of
A common mistake is to
cover all components here
the Microsoft data warehousing and business intelligence strategy, from the
at this slide. Use this slide online transaction processing (OLTP) source to the client application. The
as an introduction, knowing components comprising the strategy include:
that each concept is
covered later in the section.
! Data Transformation Services (DTS)
! Data warehouse (DW) storage
! Analysis Services
! Client interfaces—OLE DB for OLAP or ActiveX® Data Objects
(Multidimensional) (ADO MD)
! Client applications

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 3: Understanding Analysis Services Architecture 3

Data Transformation Services


Topic Objective
To introduce DTS in the
Microsoft data warehousing
suite of products.
Lead-in
DTS is the feature of SQL
Server that moves and OLTP DTS DW DTS Analysis Services Clients
transforms data. Source Storage

! Transforming and Moving Data


! Scheduling DTS Tasks
! Automating OLAP Administrative Tasks

DTS is a feature built into SQL Server that moves and transforms data. Features
of DTS include:
! Transforming and moving data between heterogeneous data sources.
! Scheduling DTS tasks.
! Automating OLAP administrative tasks.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


4 Module 3: Understanding Analysis Services Architecture

Data Warehouse Storage


Topic Objective
To define the role of the
data warehouse.
Lead-in
Analysis Services does not
require that the data
warehouse be stored in SQL OLTP DTS DW DTS Analysis Services Clients
Source
Server 2000. Storage

! Not Limited to SQL Server 2000


$ SQL Server 6.5, SQL Server 7.0, Microsoft Access 97,
Microsoft Access 2000, Oracle 7.3, Oracle 8.0
$ Any ODBC / OLE DB provider

Analysis Services is bundled with SQL Server 2000. A common misperception


Key Point is that source data for Analysis Services must always be stored in SQL Server
A common misperception is
that source data for Analysis
2000.
Services must be stored in You are not limited to SQL Server 2000 as your relational database
SQL Server 2000.
management system. You may use Analysis Services with Open Database
Connectivity (ODBC)/OLE DB-compliant relational data sources, including:
! SQL Server versions 6.5 and later.
! Microsoft Access 97 and later.
! Oracle versions 7.3 and 8.0.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 3: Understanding Analysis Services Architecture 5

Analysis Services
Topic Objective
To describe the role of
Analysis Services in the
Microsoft data warehousing
framework.
Lead-in
Analysis Services is an OLTP DTS DW DTS Analysis Clients
essential component of the Source Storage
Services
Microsoft data warehousing
and business intelligence
strategy.

A data warehouse reporting system typically consists of a relational database


Delivery Tip that stores data values and a reporting application that displays values from the
You can quickly move on to
the next slide because the
relational database.
Analysis Server is covered Analysis Services accesses data from the relational database and provides data
later in detail.
to the reporting application. It functions as an intermediate layer that converts
relational warehouse data into a form that easily is made into flexible analytical
reports.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


6 Module 3: Understanding Analysis Services Architecture

Client Interfaces
Topic Objective
To describe the client
interfaces used to access
Analysis Services data from
client applications.
Lead-in
Now let us discuss the OLTP DTS DW DTS Analysis Client Clients
Source Storage Services Interfaces
application programming
interfaces (APIs) used to
develop front-end
applications for Analysis ! APIs:
Services.
$ Low level: OLE DB for OLAP and OLE DB for Data
Mining
$ High level: ADO-MD

Analysis Services client applications, such as Microsoft Excel 2000, use OLE
Delivery Tip DB for OLAP to communicate with the Analysis Server.
Be prepared to discuss OLE
DB for OLAP, OLE DB for OLE DB for OLAP is a set of methods—an application programming interface
Data Mining, and ADO MD. (API)—added to OLE DB to provide efficient access to multidimensional data.
This is a common area for
Programmers who use OLE DB for OLAP are typically developing commercial
students to ask questions.
front-end applications by using tools such as Microsoft Visual C++®.
OLE DB support has been enhanced with the OLE DB for Data Mining
specification. Programmers can therefore create custom applications that work
with the Analysis Services data mining features.
To assist programmers developing corporate applications, OLE DB for OLAP
comes in a wrapper layer called ADO MD.
ADO MD is a simpler, higher-level set of instructions commonly used by tools
such as Microsoft Visual Basic®. ADO MD is usable in Visual Basic, Excel
2000, or any development environment that supports Microsoft ActiveX
controls.

Note OLE DB for OLAP and ADO MD are not proprietary to Microsoft. Any
developer can create a data warehouse or OLAP database that supports OLE
DB for OLAP. In addition, a developer may create a client application that
works with any OLE DB for OLAP data source. In theory, any third-party
client application that works with OLE DB for OLAP will work with the
Analysis Server.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 3: Understanding Analysis Services Architecture 7

Client Applications
Topic Objective
To describe the role of client
applications in the Microsoft
data warehousing
framework.
Lead-in
To browse the Analysis OLTP DTS DW DTS Analysis Client Clients
Server data, a front-end Source Storage Services Interfaces
client application must be
used.

! Office 2000
! Third-Party Applications
! Custom Applications

Excel 2000 is Microsoft’s own OLAP client. In Excel 2000, PivotTables have
been enhanced to work smoothly with Analysis Server.
Delivery Tip
Mention any third-party
client applications you have Note In earlier versions of Excel, PivotTables were limited to the volume of
worked with. Such tools are data that could be analyzed—a restriction that is now relieved with Excel 2000.
generally easy to learn.
Students are naturally
curious about alternatives Most major third-party OLAP client products that interface with other OLAP
beyond Excel 2000. tools also interface with Analysis Server.
You can also create custom front-end applications to access Analysis Server by
using OLE DB for OLAP or by using ADO MD.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


8 Module 3: Understanding Analysis Services Architecture

# Analysis Services Components


Topic Objective
To introduce the
components in Analysis
Services. ! Analysis Services Architecture
Lead-in ! Analysis Manager
Analysis Services contains
many components that exist ! Analysis Server Characteristics
on the server and the client
side of the product.

Analysis Services contains many components that exist on the server and the
client side of the product. It is important to understand each of the components
and the interaction that occurs between them.
In the next section, you will learn about the following topics:
! Analysis Services architecture
! Analysis Manager
! Analysis Server characteristics

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 3: Understanding Analysis Services Architecture 9

Analysis Services Architecture


Topic Objective
To describe the components
of Analysis Services Analysis Manager
architecture.

OLEDB for DM
Lead-in

OLEDB for OLAP


SQL Server
Numerous components Data
interact to give users access Warehouse DSO

PivotTable Service
to OLAP cube data in
Analysis Services.

Application
Other
OLE DB Analysis Server

ADO MD
Providers
OLAP DM
MOLAP Engine Engine
Store

Numerous components interact to give users access to OLAP cube data in


Delivery Tips Analysis Services. It is important to understand how these components interact
This is an animated slide
used to take you through
before designing OLAP databases and cubes.
each of the components of The following are the important components of Analysis Services:
Analysis Services
architecture. Be prepared to ! Analysis Server, that contains the OLAP engine and the data mining (DM)
explain each of the engine.
components.
! Decision Support Objects (DSO)
The components appear on ! Analysis Manager
the slide in the following
order: ! Relational data sources
1. Analysis Server
! MOLAP stores
2. DSO
3. Analysis Manager ! PivotTable Service (PTS)
4. SQL Server Data
Warehouse and Other OLE ! OLE DB for OLAP and OLAP DB for Data Mining (DM)
DB Providers ! ADO MD
5. MOLAP Store
6. PivotTable Service ! Client applications
7. OLE DB for OLAP/OLE
DB for DM
8. ADO MD
9. Application

For detailed descriptions of


each component, refer to
the sections before and after
this page in the module and
to SQL Server Books
Online.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


10 Module 3: Understanding Analysis Services Architecture

Analysis Manager
Topic Objective
To introduce the Analysis
Manager and DSO. ! Application for Database Administration
Lead-in ! Snap-In to MMC
Analysis Manager is the
application you use to ! Decision Support Objects
perform database and
server administration in
Analysis Services. Analysis Manager Custom Administration Interface

DSO Analysis Server

When you interact with Analysis Server as an administrator, you use the
Key Point Analysis Manager application. With Analysis Manager, you define cubes,
The DSO interface is
specific to Analysis Server.
administer the server, and perform cube and dimension processing.
In other words, Analysis Analysis Manager works in Microsoft Management Console (MMC). MMC
Server is the only OLAP
allows for the customization of Analysis Manager. For example, you may add
server that communicates
with DSO. Conversely, OLE
commands that automate batch operations such as monthly cube processing.
DB for OLAP is the open, The Analysis Manager application communicates with the Analysis Server by
standard interface used by a
using a layer called DSO. DSO is a set of programming instructions—an API—
variety of OLAP database
servers.
that allows an application to control Analysis Services. Analysis Manager is an
application that uses DSO to control Analysis Services. You can use DSO to
write your own applications to manage the Analysis Server.

Tip There are certain aspects of the Analysis Server that are available through
DSO but are not included in the Analysis Manager application.

The DSO interface is specific to Analysis Server. In other words, Analysis


Server is the only OLAP server that communicates with DSO. Conversely,
OLE DB for OLAP is the open, standard interface used by a variety of OLAP
database servers.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 3: Understanding Analysis Services Architecture 11

Analysis Server Characteristics


Topic Objective
To list important
characteristics of the
Analysis Server. ! OLE DB for OLAP Provider
Lead-in ! OLE DB Provider
The Analysis Server is the
central component of ! Windows 2000 and Windows NT Service
Analysis Services.

The Analysis Server is the central component of Analysis Services. Analysis


Server is an OLAP database server and a data mining server that runs as a
service on Microsoft Windows® 2000, or Microsoft Windows NT® 4.0 with
Service Pack 5 or later.
Analysis Server is an OLE DB for OLAP provider as well as an OLE DB
provider. As a result, you can define an Analysis Server cube as a data source
for applications that are OLE DB for OLAP or OLE DB consumers.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


12 Module 3: Understanding Analysis Services Architecture

Metadata Repository
Topic Objective
To introduce the Analysis
Server metadata repository.
Lead-in ! Contains All Metadata for Analysis Server
The most important file on ! By Default, an Access Database
the Analysis Server
computer is the metadata ! msmdrep.mdb
repository.
! Can Migrate Repository to SQL Server
$ SQL Server 7.0 OLAP Services format
$ SQL Server 2000 Meta Data Services repository format

The metadata repository resides on the Analysis Server computer and contains
Delivery Tip the definitional information for all databases on that server.
After presenting the bullets
from the slide, take As you use Analysis Manager to administer an Analysis Server, your inputs are
students into Windows stored in the OLAP metadata repository.
Explorer and navigate to
the repository in the By default, the metadata repository is a Microsoft Access file stored on the
Program Files\Analysis Analysis Server in the Bin directory. Its name is msmdrep.mdb. When you use
Services\Bin directory. Analysis Manager, you are editing the Metadata Repository.

Important The Analysis Services metadata repository contains metadata


information for the Analysis Server only.

Following are issues of the metadata repository:


! The metadata repository is, by default, an Access database.
! If you use SQL Server, it is best to migrate the repository from Access to
SQL Server. There is no provision for migrating the repository to databases
other than SQL Server.

Tip After migration, both the old and new databases exist. Only the new
database is used by Analysis Services, however. You must delete the old
.mdb file manually. If you leave the repository in Access format, be sure to
periodically compact it by using Access. Also, back up the repository
frequently during database development and production.

! A wizard is included with Analysis Services that will migrate the metadata
repository to SQL Server. To start the wizard, right-click the server, and
click Migrate Repository.
! At the beginning of the wizard, you choose whether you want to store the
repository in SQL Server 7.0 OLAP Services format or in SQL Server 2000
Meta Data Services repository format.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 3: Understanding Analysis Services Architecture 13

! You can only migrate the metadata repository from Access to SQL Server.
You cannot migrate a SQL Server Analysis Services repository back to
Access.
! If an error occurs during the migration process, the entire transaction is
rolled back and the original repository is still in use.

Caution The repository is a readable database. However, it is inadvisable to


read or write to it with a tool other than Analysis Manager or DSO. There is no
guarantee that the repository schema will not change in future versions of
Analysis Services.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


14 Module 3: Understanding Analysis Services Architecture

# Cube Storage Options


Topic Objective
To introduce the section,
which will cover a variety of
cube storage topics. ! Storage Modes
Lead-in ! Partitioning
Analysis Services uses a
variety of storage options for ! Virtual Cubes
designing and building
OLAP cubes. ! Linked Cubes
! Database Architecture
! Analysis Server Limits

In designing OLAP cubes, configuring cube storage modes and database


Delivery Tip architecture becomes essential to optimizing cube storage and query
Point out that almost all the
following cube storage
performance. Analysis Services uses a variety of storage options for designing
topics have modules and building OLAP cubes. This section will introduce topics related to the
dedicated to them later on in storage of cube data, including the following subjects:
the course.
! Storage modes
! Partitioning
! Virtual cubes
! Linked cubes
! Database architecture
! Analysis Server limits

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 3: Understanding Analysis Services Architecture 15

Storage Modes
Topic Objective
To introduce the three
storage modes for Analysis
Server.
Lead-in
Analysis Server supports
three storage modes.

The Analysis Server supports three OLAP storage modes:


Delivery Tips
Do not spend too much time ! MOLAP
covering the storage modes.
Define each mode and ! ROLAP
move on. ! HOLAP
Realize that the graphical Following are characteristics that all three modes have in common:
representation of the cube
and its aggregations are not ! The three storage modes are administered almost identically, including such
drawn to scale. elements as: aggregation design, aggregation building, partitioning, and
dimension building.
Point out that Aggs stands ! None of the storage modes allocates storage for null aggregations. If a given
for Aggregations in the
data point does not exist—for example, if no bikinis are sold in Antarctica—
preceding illustration.
no disk storage is consumed. Analysis Server avoids the data explosion
problems that are characteristic of other OLAP databases where certain
combinations of nulls are typically stored.
! All three modes store dimension structures on the Analysis Server.

Note Dimension structures are stored on the Analysis Server for all three
storage modes, except when the dimensions are designed by using the
ROLAP storage mode. ROLAP dimensions are discussed in module 9,
"Processing Dimensions and Cubes," in course 2074A, Designing and
Implementing OLAP Solutions with Microsoft SQL Server 2000.

! All three provide the same multidimensional model to clients, users, and
applications.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


16 Module 3: Understanding Analysis Services Architecture

MOLAP Storage
When MOLAP is used, detailed data and aggregations are stored in Analysis
Server cube format.
The following are characteristics of MOLAP storage:
! MOLAP cubes have the fastest query performance for users.
! Because the detail data from the fact table is brought into Analysis Server
for storage, there is duplication of data.
! Due to efficient data compression algorithms, MOLAP is an economical
mode in terms of disk storage.
! Queries to the Analysis Server do not access the relational database
management system (RDBMS). If the RDBMS server is shut down at run
time, the Analysis Server is not affected.

ROLAP Storage
When ROLAP is used, detailed data and aggregations are stored in the source
RDBMS. The only data stored on the Analysis Server is the dimensional
hierarchies, assuming ROLAP dimensions are not used.
The following are characteristics of ROLAP storage:
! Analysis Server provides a multidimensional middle tier between clients
and the RDBMS.
! All queries, other than those satisfied by the client or server caches, must
access the source RDBMS tables.
! Under most circumstances, ROLAP cubes are much slower in query
performance than MOLAP cube equivalents.

HOLAP Storage
When HOLAP is used, detailed data is stored in the RDBMS and aggregations
are stored in multidimensional format.
The following are characteristics of HOLAP storage:
! HOLAP is a compromise between MOLAP and ROLAP in terms of
performance and disk consumption.
! Because detailed data is not duplicated, HOLAP is a reasonable storage
compromise where disk consumption is a concern.
! Queries are not as slow as in ROLAP cubes, nor as fast as in MOLAP
cubes.
! Processing times for HOLAP cubes are similar to processing times for
MOLAP cubes.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 3: Understanding Analysis Services Architecture 17

Partitioning

Topic Objective
To introduce the concept of
partitioning.
Lead-in MOLAP
Partitioning is an important Current Year 35% agg
feature of Analysis Services
that increases cube
scalability.
MOLAP
Prior Year 10% agg

ROLAP
History 0% agg

Partitioning is a feature of Analysis Services that increases cube scalability.


Delivery Tips Partitions separate cube data into discrete storage areas, with different storage
Point out that Agg stands for
Aggregation in the
modes, aggregation designs, and potentially different servers for each partition.
preceding illustration.
Definition of a Partition
A partition in Analysis Services is a physical unit of storage defined for an
OLAP cube. By default, a cube consists of one partition. You can also store a
cube across many partitions. Partitions may have different storage modes and
may reside on different server computers.

Note Partitions are physical, not logical, storage mechanisms. They are
transparent to users and to applications.

Example of Partitioning
In the above example, three partitions exist in a cube. The cube contains
partitions organized by current year, prior year, and history data. The
aggregation design for each partition is based on user access. The higher the
aggregation percentage is for a partition, the faster the queries execute against
the partition. The current year partition contains a higher aggregation
percentage because users access the current year partition in most of their
queries. Users access the history data infrequently, which explains why the
history partition contains zero aggregations.
Partitioning is available only with the Enterprise Edition of SQL Server
Analysis Services.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


18 Module 3: Understanding Analysis Services Architecture

Benefits of Partitioning
Cubes consisting of multiple partitions can derive performance benefits both at
cube processing time and at query time. The following are potential benefits:
! A cube aggregation design can be different for each partition, depending on
query and cube processing performance requirements.
! Specific partitions can be processed separately from other partitions.
Therefore, you can process a small subset of the cube for shorter processing
times.
! Partitions can reside on separate computers. Therefore, the processing and
querying of partitions can take advantage of separate processors, memory,
and storage.
! Query performance can be improved when queries only have to access a
single partition.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 3: Understanding Analysis Services Architecture 19

Virtual Cubes
Topic Objective
To list the benefits of virtual
cubes.
! Equivalent of RDBMS View
Lead-in ! Subset of One Cube
A virtual cube is a logical
cube based on underlying ! Combination of Data from Multiple Cubes
physical cubes.
! Virtually No Storage Consumed

Actual

Sales Virtual Cube


Budget

A virtual cube is a logical cube based upon underlying physical cubes. To users,
virtual cubes look the same as physical cubes.
The following are characteristics of virtual cubes:
! Virtual cubes are to Analysis Services what views are to relational
databases.
! One way to create a virtual cube is to define a subset of a single cube.
! The other method of creating a virtual cube is to define data from multiple
source cubes to define a single virtual cube.
! Virtual cubes consume no storage except for their definitions in the
metadata repository.
Virtual cubes access source cube data and aggregations and therefore do not
need to store their own data. You can create an unlimited number of virtual
cubes on the Analysis Server and each virtual cube can combine up to 64 source
cubes.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


20 Module 3: Understanding Analysis Services Architecture

Linked Cubes
Topic Objective ! Linked Cubes Characteristics
To list the benefits and use
of linked cubes. $ Are based on source cubes stored on different servers
Lead-in $ Reference entire source cubes and not subsets
Linked cubes give you
another option for cube $ Appear as regular cubes
storage on Analysis
Servers. $ Always have ROLAP storage mode with no aggregations
! Linked Cubes Limitations
$ Can only be created with SQL Server 2000 Enterprise
Edition
$ Cannot be used to write back cube data
$ Can only be created on Analysis Server with query
access to source cube

Linked cubes give you an alternative option for cube storage on Analysis
Servers.
A linked cube uses a cube as its data source and resides on a different Analysis
Server. The linked cube does not store data, but accesses its data from the other
cube, known as the source cube. Therefore, you can maintain multiple servers
that access the same cube without duplicating data on each server.
The linked cube resides on the subscribing server, and the source cube resides
on the publishing server.

Linked Cube Characteristics


The following are characteristics of linked cubes:
! Linked cubes are based on regular or virtual source cubes that are stored on
different servers.
! Linked cubes reference entire cubes, and not cube subsets.
! Linked cubes appear as regular cubes to users and client applications.
! Linked cubes always have ROLAP storage modes with zero aggregations.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 3: Understanding Analysis Services Architecture 21

Linked Cube Limitations


The following are limitations of linked cubes:
! You can only create linked cubes by using SQL Server 2000 Enterprise
Edition.
! You cannot perform writeback on linked cubes.

Note For more information about writeback, see module 14, “Using
Actions, Drillthrough, and Writeback,” in course 2074A, Designing and
Implementing OLAP Solutions with Microsoft SQL Server 2000.

! The Analysis Server used as the subscribing server must have query access
to the source cube on the publishing server.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


22 Module 3: Understanding Analysis Services Architecture

Database Architecture
Topic Objective
To show the organization of
a database.
Lead-in ! Analysis Server Contains One or More Databases
This is the hierarchy by ! Each Database Contains One or More Cubes
which databases, cubes,
and partitions are organized. ! Each Cube Contains One or More Partitions
! Each Partition Can Have a Different Storage Mode, a
Different Aggregation Design, and a Different Storage
Location

Databases, cubes and dimensions are organized in the following hierarchy:


Delivery Tip
A common approach for ! An Analysis Server contains one or more databases.
presenting this slide is to
open Analysis Manager with ! Each database contains one or more cubes.
the students to highlight the
database and cube structure Note You can think of an Analysis Services database as being a collection
online. of cubes.

! Each cube consists of one or more partitions.


! Each partition can have a different storage mode, a different aggregation
design, and can be stored on a different server computer.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 3: Understanding Analysis Services Architecture 23

Analysis Server Limits


Topic Objective Items Limits
To highlight published limits
associated with the Analysis Databases per server Unlimited
Server.
Lead-in Cubes per database Unlimited
There are limits to the
number of dimensions and Cubes per virtual cube 64
measures you can create in
Dimensions per cube 128
Analysis Services cubes
and databases. Measures per cube 1,024

Calculated members per cube 65,535

Levels per dimension 64

Partitions per cube Unlimited

Ask students if any of the There are limits to the number of dimensions and measures you can create in
limits are going to be Analysis Services cubes and databases. The following table contains those
problematic for them. limits, along with other restrictions.

Most of these limits are so Items Limits


high that there should not be
problems with the design of Databases per server Unlimited
an average-sized cube. Cubes per database Unlimited
Cubes per virtual cube 64
Dimensions per cube 128
Measures per cube 1,024
Calculated members per cube 65,535
Levels per dimension 64
Partitions per cube Unlimited

Most of these limits are so large that normal databases will not have difficulty
conforming to the limitations. However, for very large databases, you may need
to consider design alternatives to work around these limitations.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


24 Module 3: Understanding Analysis Services Architecture

# Client Architecture
Topic Objective
To introduce the
components and features of
client architecture. ! PivotTable Service
Lead-in ! PTS Architecture
This section introduces the
components of OLAP client ! Intelligent Caching
architecture.
! Multidimensional Expressions
! Internet Support on Clients

This section introduces the components of OLAP client architecture. The


following topics are discussed:
! PTS
! PTS architecture
! Intelligent caching
! Multidimensional expressions (MDX)
! Internet support on clients

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 3: Understanding Analysis Services Architecture 25

PivotTable Service
Topic Objective
To describe PTS in detail
and discuss its importance
when accessing Analysis ! Is Required in Order to Query Server
Server.
! Is the Desktop OLAP Component—Subset of Analysis
Lead-in
The client component of
Server
Analysis Services is PTS. ! Ships with Office 2000
All client applications must
communicate with the ! Provides:
Analysis Server through
PTS. ! Intelligent data and query caching
! Multidimensional formula engine
! Ability to create local cubes

The client component of Analysis Services is PTS. All client applications must
communicate with the Analysis Server through PTS.
PTS is the desktop OLAP component designed for Analysis Server to provide
online and offline data analysis. There is no user interface for PTS. It interacts
transparently with applications such as Excel 2000, third-party applications, and
custom applications.
PTS ships as a component of Microsoft Office 2000.

Note PTS is not the same as an Excel PivotTable. PTS is an OLE DB provider
that supports OLE DB for OLAP extensions, as well as ADO MD, the high-
level object interface.

PTS has some of the same features as Analysis Server. The following are
features the two have in common:
! Intelligent data and query caching. Both Analysis Server and PTS have
intelligent caching capabilities.
! MDX formula engine. Queries can be defined at the server or the client.
! Ability to create cubes. Analysis Server cubes are server-based, but PTS
cubes are considered local cubes.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


26 Module 3: Understanding Analysis Services Architecture

PTS Architecture
Topic Objective
To highlight the architecture
of PTS.
Client
Lead-in
(Excel 2000, Third-Party Applications)
When accessing cube data, ADO-MD / OLEDB for OLAP
you must first go through
PTS.

PivotTable Service

Offline
Cube OLAP
File Server

All clients accessing cube data must communicate through PivotTable Services.
When you use Analysis Manager to administer cubes and use its browser to
view cubes, Analysis Manager is communicating with PTS to view the data.
PTS is automatically installed on a computer when you install Analysis
Services (Server or Client Components). It is also automatically installed when
you install Office 2000.

Tip PTS can run on any Windows operating system beginning with Windows
95.

PTS is used to access cubes residing on the Analysis Server, as well as local
cubes created in Excel 2000.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 3: Understanding Analysis Services Architecture 27

Intelligent Caching
Topic Objective
To demonstrate how Query 1) January, February, and
Analysis Server and PTS March 2000 Sales
cache data.
Client
Lead-in Query 2) Quarter 1 2000 Sales 1) January, February, Client
Caching on both the server March 2000 Sales Calculates
2) Quarter 1 2000 Sales
and client is a key factor in
Analysis Server’s rapid 3) Quarter 1 1999 Sales
Query 3) Quarter 1 2000 Sales
query performance.
and Quarter 1 1999 Sales

Only Server
Quarter 1 1999
1) January, February, March 2000
Needed From Sales
Server
3) Quarter 1 1999 Sales

Intelligent caching on the server and client is a key factor in Analysis Server’s
Delivery Tip rapid query performance. It is performed by PTS on the client.
This slide builds and steps
you through a querying Following are examples of how intelligent caching works:
scenario that is described
on this page in detail. ! A user executes Query 1 for January 2000, February 2000, and March 2000
data. MDX executes by PTS to return the data. The data does not exist on
the client cache, so the query travels to the server cache.
! Since the data does not exist in the server cache either, the results must be
transported from the server disk to the server cache, then to the client cache,
and then to the user’s report
! The user executes Query 2, containing Quarter 1 2000, a summary of the
three months previously queried.
! Because the data for three months exists in the client cache, the values are
calculated by PTS on the client computer and presented in the user’s report.
The query does not access the server at any time.
! The user executes Query #3, which is Quarter 1 2000 and Quarter 1 1999.
! Only Quarter 1 1999 is brought from the server since Quarter 1 2000 values
already reside in the client cache.

Note The client-side caching described above is a feature provided by PTS.


The client cache remains in place for the duration of a client connection to a
server.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


28 Module 3: Understanding Analysis Services Architecture

Multidimensional Expressions
Topic Objective
To introduce and describe
MDX.
Lead-in ! Used as the Syntax for Modeling and Querying an OLAP
MDX is the syntax for Database
querying OLAP cubes.
! Supported by PTS
! Part of the OLE DB for OLAP API
! Used to Create Calculated Members
! Key to Advanced Analytical Capabilities of Analysis
Services

MDX is the Microsoft multidimensional query language. The following are


characteristics of MDX:
! MDX is the syntax for querying OLAP cubes.
! PTS supports MDX.
! MDX is part of the OLE DB for OLAP API, and is supported by multiple
database providers, such as Analysis Services, TM1, and SAS.
! A subset of MDX is used to create calculated members.
! MDX is the key for advanced analytical capabilities of Analysis Services.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 3: Understanding Analysis Services Architecture 29

Internet Support on Clients


Topic Objective
To describe how clients can
connect to Analysis Servers
by using Microsoft Internet
Information Services (IIS). ! Uses IIS to Provide Authentication Over the Internet
Lead-in ! Uses HTTP to Pass Through Firewalls
Client applications can
connect to the Analysis ! Supports Automatic Setup through ASP
Server through IIS by using
HTTP. ! Requires SQL Server 2000 Enterprise Edition

Client applications can connect to Analysis Servers through Microsoft Internet


Information Services (IIS) by using Hypertext Transfer Protocol (HTTP).
Through this connection method, clients do not require direct connectivity to
the Analysis Server. The method provides rapid enterprise-wide Internet and
intranet OLAP deployments.
To connect to the Analysis Server with IIS, you define a uniform resource
locator (URL) for the server name in the Data Source property of the client
connection string. By using this method, PTS passes through firewalls or proxy
servers to gain access to the Analysis Server. An Active Server Pages (ASP)
page, Msolap.asp, automatically manages the connection through IIS.
You must use SQL Server 2000 Enterprise Edition to take advantage of IIS and
HTTP connectivity to the Analysis Server.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


30 Module 3: Understanding Analysis Services Architecture

Office 2000 OLAP Components


Topic Objective
To introduce Office 2000
OLAP features.
Lead-in ! Excel PivotTables
There are several OLAP
features in Office 2000 that ! Local Cubes
depend on PTS behind the
! Web Pivot Control
scenes.

PivotTable Service is bundled with Office 2000. There are several OLAP
features in Office 2000 that depend on PTS.

Excel PivotTables
PivotTables, first introduced in Excel version 5.0, provided users with their first
exposure to OLAP functionality.
PivotTables were limited, however, by their inability to handle large data sets.
In Office 2000, PivotTables through PTS are able to analyze extremely large
data sets. In addition, PivotTables have gained new OLAP-aware charting
features.

Local Cubes
PTS supports the ability to create local cubes, which in turn can be queried in
the same manner that Analysis Server cubes are queried. Excel 2000 has an
interface for this feature.

Note Because local cubes can be created from relational sources, and because
PTS is bundled with Excel 2000, Analysis Services is not necessary when
performing client-side OLAP. Any Excel 2000 user can utilize these features.

Web Pivot Control


Included with Office 2000 are ActiveX controls designed for use on Web pages.
Among these controls is a Pivot control and a companion charting control. The
Pivot control is similar to an Excel PivotTable. It gives users the ability to
deploy intranet applications that access OLAP data from Web pages.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 3: Understanding Analysis Services Architecture 31

Review
Topic Objective
To reinforce module
objectives by reviewing key
points. ! Microsoft Data Warehousing Overview
Lead-in ! Analysis Services Components
The review questions cover
some of the key concepts ! Metadata Repository
taught in the module.
! Cube Storage Options
! Client Architecture
! Office 2000 OLAP Components

1. What is the component in SQL Server that moves and transforms data?
DTS communicates with Analysis Services and allows users to import,
export, and transform data from multiple heterogeneous data sources
into one or more databases.

2. Is the OLE DB for OLAP standard specific to Analysis Server?


No.

3. Is DSO specific to Analysis Server?


Yes.

4. What are the three storage modes?


MOLAP, ROLAP, and HOLAP.

5. Can one Analysis Server house more than one OLAP database?
Yes.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


32 Module 3: Understanding Analysis Services Architecture

6. How does PTS differ from an Excel PivotTable?


PTS is the client component in Analysis Services that is included with
Office 2000. PTS is required to access Analysis Services cube data.
Excel PivotTables are the objects that are created in Excel sheets,
allowing users to connect to external data sources and to manipulate
data through drilling down, pivoting, and so on.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 4: Building
Dimensions Using the
Dimension Editor
Contents

Overview 1
Understanding Dimension Basics 2
Shared vs. Private Dimensions 8
Working with Standard Dimensions 11
Basic Level Properties 13
Lab A: Creating a Standard Dimension 24
Lab B: Creating a Snowflake Dimension 28
Working with Parent-Child Dimensions 32
Lab C: Creating a Parent-Child Dimension 38
Review 45
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, the 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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 4: Building Dimensions Using the Dimension Editor iii

Instructor Notes
Presentation: Dimensions are the fundamental beginning point for building an online
60 Minutes analytical processing (OLAP) cube in Microsoft® SQL Server™ 2000 Analysis
Services. Cubes contain multiple dimensions, which may be either shared or
Labs: private, star or snowflake, regular or parent-child.
60 Minutes
In this module, students learn how to build dimensions by using the Dimension
Editor. You dissect the building blocks of dimensions for students in detail.
When they have completed this module, students will feel comfortable with all
aspects of dimension interfaces.
In the labs, students create two dimensions by using the Dimension Editor and
two dimensions by using the Dimension Wizard. Students perform various
dimension enhancements, such as updating the Member Key Column
property, defining sort order, adding levels, and creating member properties.
After completing this module, students will be able to:
! Understand dimension fundamentals.
! Know when to use shared and private dimensions.
! Describe the characteristics of standard dimensions.
! Add level properties to dimensions.
! Develop parent-child dimensions.

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_04.ppt

Preparation Tasks
To prepare for this module, you should:
! Read all the student materials.
! Read the instructor notes and margin notes.
! Complete the demonstration.
! Practice the lecture presentation and demonstration.
! Complete the labs.
! 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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


iv Module 4: Building Dimensions Using the Dimension Editor

Demonstration: Creating a Star Schema Dimension


Demonstration: You can create dimensions quickly and easily by using the Dimension Wizard.
While the Dimension Wizard is a useful tool for many situations, the
5 Minutes Dimension Editor and the Cube Editor are the primary tools for defining and
modifying dimensions.
The following demonstration procedures provide information that will not fit in
the margin notes or are not appropriate for student notes.

! To create a new database and define a data source


1. Open Analysis Manager and double-click the local server.
2. In Analysis Manager, right-click the local server, click New Database, type
Module 04 in the Database name box, and then click OK.
3. Double-click Module 04 to expand the database.
4. Right-click the Data Sources folder, and then click New Data Source.
5. On the Provider tab of the Data Link Properties dialog box, click
Microsoft OLE DB Provider for SQL Server, and then click Next.
6. Type localhost in the server name box, click Use Windows NT Integrated
security, click Module 04 in the Select the database on the server list, and
then click OK.

! To create a new dimension


1. In the Module 04 database, right-click the Shared Dimensions folder, point
to New Dimension, and then click Editor.
2. Click State as the dimension table in the Choose a Dimension Table dialog
box, and then click OK.
The left side of the Dimension Editor is divided into two panes. The upper
left pane contains the dimension tree that displays levels as you design the
dimension. The lower left pane contains dimension properties. If you click
the Properties button, the Properties pane disappears or reappears,
depending on whether the pane is showing after you open the Dimension
Editor.
3. In the Properties pane, the current name of the dimension is <New>. Type
State as the name, and then press ENTER.
The name of the dimension appears in the dimension tree.
4. Drag State_Name from the State table in the Schema pane onto the name
of the State dimension in the dimension tree.
This creates a new level in the dimension.
5. Click the State Name level in the dimension tree, type State in the Name
box on the Properties pane, and then press ENTER.
6. Click the Data tab at the bottom of the Schema pane. Double-click All
State and view the members in the State dimension.
7. On the toolbar, click Save, and then close the Dimension Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 4: Building Dimensions Using the Dimension Editor v

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 many dimensions are typically included in cubes?
Normal users cannot digest more than six or seven dimensions in an
OLAP report. For this reason, cube designers restrict the number of
dimensions in cubes based on user comprehension more often than
system limitations. Cubes typically contain four to ten dimensions in
production systems.
2. How does Analysis Services handle data sources for cubes that do not
contain a dimension, because the dimension information is stored in another
system?
You must have all dimension tables and fact tables existing in a single
relational data source before creating dimensions and cubes. If the
dimension exists in a separate system, you can use Data Transformation
Services (DTS) to move the dimension from the other system to the
source database. You must also be sure that the cube fact table contains
keys that map to the dimension table.
3. What options are available for sorting members, other than sorting by the
Member Key Column or the Member Name Column properties?
If neither the Member Key Column nor the Member Name Column of
a dimension provides the correct sort order, you can use a third column
to control the sort order. Simply add that column as a member
property to the level you want to sort. Member properties for a level
automatically appear in the Order by property list. If you build the
dimension by using the Dimension Wizard, it gives you the option to
select any column from the dimension table to define the sort order, and
then the wizard automatically creates the member property for you.
4. What is the best practice for defining members based on expressions?
Use expressions as a last resort for defining members. The best practice
for updating members is to update the data source so that all systems
describe members in the same manner. However, you may have
difficulties updating the source database due to administrative policies
against such a practice or other external issues. Defining expressions in
the Dimension Editor allows you to update members without updating
the source database.
5. How can users view the default member of a dimension?
When you browse the cube in the Cube Browser, the dimensions in the
filter area default to a single member. This member is known as the
default member.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


vi Module 4: Building Dimensions Using the Dimension Editor

Module Strategy
Use the following strategy to present this module:
! Understanding Dimension Basics
Introduce dimensions and the role they play in cube design. Describe how
various user communities define and use dimensions. Define levels and
members and how they relate to each other. Review dimension and level
system limitations.
! Shared vs. Private Dimensions
Describe shared dimensions, focusing on their characteristics and when to
incorporate them into cubes. Define private dimensions, comparing them to
shared dimensions throughout the discussion. Finish the shared dimension
and private dimension discussion with a summary statement of when to use
each type.
! Working with Standard Dimensions
Define standard dimensions, focusing on the use of columns to determine
dimension levels. Demonstrate the creation of dimensions by using the
Dimension Editor.
! Basic Level Properties
Describe the use of Member Key Columns and Member Name Columns
when creating dimensions. Discuss how you sort members in levels based
upon the key or the name. Introduce creating expressions in Member Key
Columns and Member Name Columns to change members. Focus on the
rules for creating valid expressions. Define ragged dimensions and how to
implement them in standard, balanced dimensions. Define snowflake
dimensions and compare them to star schema dimensions. Explain the
importance of the All level and discuss situations when not to use it in a
dimension. Define the default member and describe situations in which to
change it from its original setting.
! Working with Parent-Child Dimensions
Introduce parent-child dimensions by giving an example of a situation in
which a parent-child dimension is used. Describe the structure of a parent-
child dimension. Explain that parent-child dimensions can have values in
the fact table at both the leaf level and at a parent level. Introduce the
Members with Data property and describe the three values it can have.
Explain that there are different options for displaying the levels in a parent-
child dimension, and finish up with a description of how the Skipped
Levels Column property allows you to create ragged hierarchies in parent-
child dimensions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 4: Building Dimensions Using the Dimension Editor 1

Overview
Topic Objective
To provide an overview of
the module topics and
objectives. ! Understanding Dimension Basics
Lead-in ! Shared vs. Private Dimensions
In this module, you will learn
about the Dimension Editor ! Working with Standard Dimensions
and how to use it to create
and manage dimensions. ! Basic Level Properties
! Working with Parent-Child Dimensions

Dimensions are the fundamental beginning point for building an online


analytical processing (OLAP) cube in Microsoft® SQL Server™ 2000 Analysis
Services. Cubes contain multiple dimensions, which may be either shared or
private, star or snowflake, regular or parent-child.
After completing this module, you will be able to:
! Understand dimension fundamentals.
! Know when to use shared and private dimensions.
! Describe the characteristics of standard dimensions.
! Add level properties to dimensions.
! Develop parent-child dimensions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


2 Module 4: Building Dimensions Using the Dimension Editor

# Understanding Dimension Basics


Topic Objective
To introduce the concepts of
dimensions, levels, and
members. ! Enabling Various Views
Lead-in ! Understanding Levels and Members
A dimension contains levels
and members organized into ! Describing Familial Relationships
hierarchies. It categorizes
the numeric measures ! Reviewing Analysis Services Limits
stored in a cube.

A dimension contains levels and members organized into hierarchies. It


categorizes the numeric measures stored in a cube. A dimension provides users
with a great number of combinations and intersections with which to analyze
data. Each dimension describes an aspect of the users’ business and provides
intuitive and simple access to data. You design and build each dimension based
upon the business processes required by users.
A cube requires that you define at least one dimension in its schema. Each cube
can have up to 128 dimensions, depending on the business needs of the user
community.
In OLAP cubes, dimensions:
! Provide a descriptive or analytical view of the key measures in the cube,
typically organized around one or more categories relevant to the business.
! Are shared across multiple cubes that may differ across user communities.
Examples of commonly shared dimensions are geography, product, time,
customer, and scenario.
! Contain varying degrees of summarization, called levels, by which data is
viewed. The levels, organized into hierarchies, are frequently described as
drill-down paths for the user in search of more specific answers.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 4: Building Dimensions Using the Dimension Editor 3

Enabling Various Views


Topic Objective Analysis Server
To illustrate how different
groups of users use
dimensions.
Lead-in
Each of the four groups
contains a different view of Finance
cube data defined by a user Operations
Profit
community. by Division Volume
by Country by Plant
by Month by Shift
Sales Marketing by Product
by Actual/Budget
Revenue Revenue by Day
by Product by Customer
by Region by Industry
by Sales Rep by Channel
by Quarter by Week

OLAP cubes answer business questions for summarized data—for example,


what were revenues for all drink products in the northeast region in the second
Delivery Tips quarter?
Describe each user
community as the slide The above illustration shows an Analysis Server and four cubes accessed by
builds the groups one by four separate user communities—Finance, Sales, Marketing, and Operations.
one. Each of the four groups views a different set of cube data because each group
has different business needs. The dimensions defined for each user community
Ask students to describe the
important business
categorize the measures of the cube. Every measure is analyzed in terms of
processes and underlying every dimension in the cube.
databases that they work
An important word used to introduce each dimension is the word by. For
with. Then ask the students
to describe the dimensions
example, the Marketing users need to see Revenue:
that would apply to the ! By Customer
processes or databases.
! By Industry
! By Channel
! By Week
Marketing users can report on Revenue as it applies to any of the above
dimensions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


4 Module 4: Building Dimensions Using the Dimension Editor

Understanding Levels and Members


Topic Objective
To review the terms level
and member and to explain
the importance of levels and
members in dimension
design.
Lead-in
Dimensions consist of
members, organized into
levels, and give users
access to data at different
levels of detail.
! Product Dimension
! Four Levels: All, Category, Sub-Category, Product
! Category Members: Bread, Dairy, Meat

Review dimension level and Dimensions consist of members organized into levels. This organization gives
members. Quiz students on users access to data at different levels of detail. The above illustration shows a
the levels and members. dimension, Product that contains the levels All, Category, Sub-Category, and
Product. Each level consists of members—for example, the Category level
consists of the members Bread, Dairy, and Meat.
When defining dimensions, you must understand which levels the users require.
In addition, you must determine the tables containing levels and members in the
relational data source.
In most cases, dimensions have different degrees of summarization or levels,
enabling drilling down and drilling up.
In a multidimensional database, levels:
! Define the hierarchy of a dimension.
! Are organized by degrees of summarization. For example, Country, State,
City, and Zip Code might each be levels in a Region dimension.
Users and their required business questions determine the number of
dimensions and the number of levels in a dimension.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 4: Building Dimensions Using the Dimension Editor 5

Describing Familial Relationships


Topic Objective
To define key terms related
to dimension familial Dimension
Ancestors
relationships.
of IL and MO
Lead-in Region
Parents
Users and OLAP developers
must be able to describe
Central
Descendants
members and their
relationships to other
IL of Region
members in dimensions. MO
Siblings
East Cousins
Children
NY
MA

Users and OLAP developers must be able to describe members and their
Delivery Tips
relationships to other members in dimensions. Analysis Services uses terms
Present this build slide by
introducing one familial term
such as parent, child, and sibling to describe relationships between members.
at a time. As each term Consider the following hierarchical structure:
appears, define the term
and describe how the term Region
applies to the members in Central
the example. IL
The dimension terms
MO
appear in the following
order: East
1. Dimension NY
2. Parents MA
3. Siblings
4. Children Following are definitions of relationships that apply to the above hierarchical
5. Ancestors of IL and MO structure:
6. Descendants of Region
! Dimension. The dimension in this example is Region.
7. Cousins
! Parents. A parent has at least one child member immediately below it.
Stress that members are Region is a parent of Central and East. Central is the parent of IL and
cousins only when they exist MO. East is the parent of NY and MA.
at the same relative position
below their parents. ! Siblings. A sibling is a member with the same parent as another child.
Central and East are siblings. In addition, IL and MO are siblings, and NY
Key Point and MA are siblings.
These familial terms are
used in most OLAP ! Children. A child is a member that has a parent immediately above it.
database tools, and not only Central and East are children of Region. The states are children of their
in Analysis Services. region parents.
! Ancestors. The ancestors of a member include its parent, grandparent, and
so on, continuing up the branch until the topmost member of the dimension
is reached. The ancestors of MO are Central and Region.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


6 Module 4: Building Dimensions Using the Dimension Editor

! Descendants. The descendants of a member include all members that exist


below that member in the hierarchy. For example, the descendants of
Region are all members in the dimension at all levels of detail.
! Cousins. Member 1 is a cousin of Member 2 if the following are true:
• Member 1 and Member 2 exist at the same level in a dimension.
• The parents of Member 1 and Member 2 are siblings.
• Member 1 and Member 2 exist at the same relative position below their
parents.
In the above example, IL and NY are cousins because they exist at the same
level, their parents are siblings, and they both are defined as the first child
below their parents.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 4: Building Dimensions Using the Dimension Editor 7

Reviewing Analysis Services Limits


Topic Objective Items Limits
To review all dimension and
level limits related to cube
building. Dimensions per database 65,535

Lead-in Levels per database 65,535


When designing dimensions
and cubes, it is important to
Dimensions per cube 128
understand the
programmable limits of
Analysis Services. Levels per cube 256

Levels per dimension 64

Members per parent 64,000

Length of dimension name 24 characters

When designing dimensions and cubes, you need to understand the


Delivery Tips programmable limits of Analysis Services. In most cases, the limits far exceed
Use the slide to present the
limits one at a time.
real-world requirements. However, cube requirements sometimes need changes
because of dimension and level limits.
Ask students if any of the
limits will cause problems Note Users typically cannot understand OLAP reports and front-end
for them. applications with more than six or seven dimensions represented. Therefore,
user confusion affects cube design more often than the Analysis Services
Students often mention the dimension limits.
dimension name length as a
potential limiting factor.
The following table lists some of the programmable limits of Analysis Services.
Items Limits

Dimensions per database 65,535


Levels per database 65,535
Dimensions per cube 128
Levels per cube 256
Levels per dimension 64
Members per parent 64,000
Length of dimension name 24 characters

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


8 Module 4: Building Dimensions Using the Dimension Editor

# Shared vs. Private Dimensions


Topic Objective
To introduce the concepts of
shared and private
dimensions. ! Working with Shared Dimensions
Lead-in ! Working with Private Dimensions
Dimensions are defined as
either shared or private at
the time they are created.

Dimensions are defined as either shared or private at the time they are created.
Understanding the difference between the two dimension types is crucial to
The goal of this section is to building practical and well-designed OLAP database models.
explain the differences
between shared and private This section describes the characteristics of shared and private dimensions and
dimensions, and for explains when to use each type when you design the cube dimensions.
students to understand
when to use one dimension
type versus the other.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 4: Building Dimensions Using the Dimension Editor 9

Working with Shared Dimensions


Topic Objective
To examine the
characteristics of shared
dimensions. ! Created Once and Shared by One or More Cubes in a
Lead-in Database
You define most dimensions
in cubes as shared. You
! Cannot Be Changed to Private
create, process, and ! Maintained in Dimension Editor
maintain shared dimensions
in one place, and this can ! Administered in One Place
help simplify dimension
administration and ! Cause All Cubes Using that Dimension to be
synchronization. Unavailable for Querying After Rebuilding Structure
! Identified by a Sharing Hand Icon:

You define most dimensions in cubes as shared. Any number of cubes in a


database can share these dimensions. Because you create, process, and maintain
shared dimensions in one place, shared dimensions simplify administration and
synchronization where dimensions are used across multiple cubes. There is no
major disadvantage to creating many shared dimensions.
The following list contains the characteristics of shared dimensions:
! You create shared dimensions once, and one or more cubes in a database
share them. You cannot share a dimension across multiple databases.

Note You can copy and paste shared dimensions to other databases,
assuming the new databases contain the dimension source table or tables.

! Once you define a dimension as shared, you cannot change it to private, and
vice versa.
! You maintain shared dimensions in the Dimension Editor, where you can
apply various dimension properties and actions.
! You modify shared dimensions in one place—the Shared Dimension folder
in Analysis Manager.
! When you rebuild a shared dimension, all cubes containing the dimension
become unavailable to clients. You must then reprocess the cubes before
users can continue to access cube data.

Important It may be unacceptable in the business environment for a cube to


become unavailable every time another user community updates a shared
dimension. If so, define the dimension as private. You process private
dimensions individually in their cubes, and therefore other cubes are not
affected.

! You identify shared dimensions in the Analysis Manager interface by the


sharing hand icon.
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
10 Module 4: Building Dimensions Using the Dimension Editor

Working with Private Dimensions


Topic Objective
To examine the
characteristics of private
dimensions. ! Created and Used within Single Cube
Lead-in
Private dimensions are ! Maintained in Cube Editor, Not Dimension Editor
dimensions used by only
! Cannot Be Changed to Shared
one cube.
! Rebuilt Automatically with Cube Process
! Identified by Dimension Icon:

Private dimensions are dimensions used by only one cube. You use private
Key Point dimensions when only one cube requires that particular view or dimension.
Define the dimensions as
private if it is unacceptable The following are characteristics of private dimensions:
for the cube to be
unavailable to the users due ! You create and use private dimensions within a single cube.
to another user group
rebuilding a common shared ! When maintaining private dimensions, you access the dimension properties
dimension. in the Cube Editor, not the Dimension Editor.
! After you define a dimension as private, you cannot change it to shared, and
Be sure to summarize vice versa.
shared and private
! You rebuild private dimensions automatically when the cube is processed.
dimensions at this point in
the lecture. Processing private dimensions does not affect other cubes.

Important Define the dimensions as private if it is unacceptable for the


cube to be unavailable to the users due to another user group rebuilding a
common shared dimension.

! You identify private dimensions in the Analysis Manager interface by the


dimension icon. Note the absence of a hand.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 4: Building Dimensions Using the Dimension Editor 11

Working with Standard Dimensions


Topic Objective
To define standard
dimensions and to illustrate USA Country
standard dimension
balanced levels.
Lead-in California Colorado Illinois
Define a dimension as State
standard when each level
corresponds to a column in
San Jose La Jolla Denver Chicago Peoria Springfield
the dimension table. City

! Each Level Corresponds to a Dimension Table Column


! All Members at a Given Level Have the Same Number of
Ancestors

Analysis Services dimensions retrieve members from one or more dimension


Delivery Tip tables. You define a dimension as standard when each level corresponds to a
Cover the information
column in the dimension table or to an expression based on a column. In the
presented in the student
manual by using the dimension in the above illustration, the three levels—Country, State, and
Geography dimension in City—correspond to dimension table columns in the source database.
the slide. Explain the
In a standard dimension, each member of a dimension hierarchy has the same
balanced hierarchy, and
how each level maps to a number of ancestors as any other member at the same level.
column in one or more For example, La Jolla has two ancestors, California and USA. Because this
tables.
dimension is a standard dimension, Chicago has two ancestors also, Illinois
and USA. Standard dimensions are considered balanced because all the
dimension branches have the same number of levels.
Standard dimensions are defined as being either star or snowflake schema
dimensions. A star schema dimension builds its structure from a single
dimension table. A snowflake schema dimension builds its structure from
multiple dimension tables.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


12 Module 4: Building Dimensions Using the Dimension Editor

Demonstration: Creating a Star Schema Dimension


Topic Objective
To demonstrate the
Dimension Editor and to
create a star schema
dimension.
Lead-in
In this demonstration, you
will learn how to create a
regular star schema
dimension by using the
Dimension Editor instead of
the Dimension Wizard.

You create dimensions quickly and easily by using the Dimension Wizard.
Delivery Tip While the Dimension Wizard is a useful tool for many situations, the
The steps for this
demonstration are included
Dimension Editor and the Cube Editor are the primary tools for defining and
in the Instructor Notes. modifying dimensions.
In this demonstration, you will learn how to create a standard star schema
Lab A, Creating a Standard
Dimension, repeats the
dimension by using the Dimension Editor instead of the Dimension Wizard.
demonstration steps. If
students follow along with
you in your demonstration,
let them know that they can
skip some of the procedures
in lab A.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 4: Building Dimensions Using the Dimension Editor 13

# Basic Level Properties


Topic Objective
To introduce some basic
level properties.
Lead-in ! Assigning Member Keys and Names
Now we will cover some ! Identifying Uniqueness of Members
basic dimension and level
properties that are available ! Creating Members from Expressions
in the Dimension Editor.
! Working with Ragged Dimensions
! Understanding Snowflake Dimensions
! Defining the All Level
! Specifying a Default Member

Tell students that they will Many properties exist to design and enhance dimensions. A few of the
get hands-on experience properties can be set in the Dimension Wizard as you initially create
with these properties in the dimensions. However, the Dimension Editor contains all properties available
first two labs. for dimensions and their levels.
Because the full range of capabilities are available, application designers spend
a significant amount of time in the Dimension Editor, as opposed to the
Dimension Wizard, working with these properties.
This section describes a few commonly used properties:
! Member Key and Member Name Columns
! Member Keys Unique and Member Names Unique properties
! Expressions used in the Member Key and Member Name Columns
! The Hide Member If property that is used to create ragged dimensions
! Snowflake dimensions
! The All Level property
! The Default Member property
You can find these properties in the Dimension Editor and use them to enhance
dimensions and levels.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


14 Module 4: Building Dimensions Using the Dimension Editor

Assigning Member Keys and Names


Topic Objective
To introduce the Member ! Defining the Member Key Column
Key Column and the
Member Name Column $ Determines the members included in a level
and explain how the two $ Usually comes from a single dimension table column
properties define the sort
order of members. ! Defining the Member Name Column
Lead-in $ Provides names for members at a level
Two important properties of
dimension levels are the $ Can be different from the Member Key Column
Member Key Column and
the Member Name ! Sorting Members in a Level
Column.
$ Order by key
$ Order by name
$ Order by member property

When you select dimension levels in the Dimension Editor and Dimension
Delivery Tips Wizard, Analysis Services keeps track of the columns used to define the levels.
Describe the Member Key
Column and Member
The Member Key Column and the Member Name Column define each
Name Column by going to dimension level. The two columns determine the population of levels with
the Dimension Editor and members and the appearance of members to users.
showing students the
properties and how to Defining the Member Key Column
update them.
On the Basic tab of the Properties pane, the Member Key Column identifies
Consider introducing these the members of a level by specifying where the key comes from in the source
topics in the previous relational database management system (RDBMS).
demonstration as you build
the State dimension. If you Characteristics of the Member Key Column include the following:
choose to deliver these
! The Member Key Column determines the members included in a level.
concepts in the previous
demonstration, use this slide ! The Member Key Column usually specifies an RDBMS column containing
to review the terms, asking member keys in table.column format.
students for their definitions.
! The Member Key Column can be any valid SQL expression involving one
or more columns from the same table. The expression must be understood
by the source RDBMS.
! When populating the children of a parent with members, the Analysis
Key Point Server uses the SQL command SELECT DISTINCT on the Member Key
When populating the
Column. Therefore, you do not see duplicate member values below the
children of a parent with
members, the Analysis
parents—you only see the distinct members.
Server uses the SQL ! For optimization reasons, the Member Key Column of the lowest level
command SELECT should be the dimension primary key—the numeric key that uniquely
DISTINCT on the Member defines each member in the dimension table. This key also acts as the
Key Column. Therefore, foreign key in the source fact table.
you do not see duplicate
member values below the
parents—you see only the
distinct members.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 4: Building Dimensions Using the Dimension Editor 15

Defining the Member Name Column


On the Basic tab of the Properties pane, you will find the Member Name
Column property. It contains the name of the RDBMS column that provides
member names for that level.
Characteristics of the Member Name Column include the following:
! By default, the Member Name Column is the same as the Member Key
Column.
! The Member Name Column is useful in situations where the Member Key
Column does not contain data that is meaningful to users.
For example, users are often more familiar with descriptions than with
codes. Therefore, if the Member Key Column contains codes, you update
the Member Name Column with descriptions. The users see only the
Member Name Column descriptions, and the codes are stored internally.
! The Member Name Column can be any valid SQL expression involving
one or more columns. The columns must be from the same table as the
Member Key Column, and the expression must be understood by the
source RDBMS.
For example, if a table named Customer contains the columns
Customer_ID and Customer_Name, you would probably rather see names
than identification numbers when you query the customer dimension. In this
case, the Member Key Column would be Customer_ID and the Member
Name Column would be Customer_Name.
The SQL Expressions for the properties in this example are shown in the
following table.

Property SQL Expression

Member Key Column “Customer”.”Customer_ID”


Member Name Column “Customer”.”Customer_Name”

Sorting Members in a Level


The Order By property on the Advanced tab of the Properties pane designates
whether dimension members are sorted in ascending order based on the
Member Key Column or the Member Name Column. The two options for
Order By settings are Key, indicating Member Key Column, and Name,
indicating Member Name Column.
If neither the Member Key Column nor the Member Name Column of a
dimension provides the correct sort order, you can use a third column to control
the sort order. Simply add that column as a member property to the level you
want to sort. Member properties for a level automatically appear in the Order
By property’s drop-down list.

Note For more information on member properties, see module 5, “Using


Advanced Dimension Settings,” in course 2074A, Designing and Implementing
OLAP Solutions with Microsoft SQL Server 2000.

By default, the setting of Order By is Name, which means that member names
determine the sort order of members in a level.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


16 Module 4: Building Dimensions Using the Dimension Editor

There are two main reasons to change the Order By setting:


! Even though the Member Key Column and the Member Name Column
are the same by default, you may create errors in sorting if the member key
is numeric and Order By is set to Name. If Order By is set to Name, the
level treats the data as text rather than numeric and sorts the members
accordingly.
! If the Member Name Column is different from the Member Key Column
and you want to sort items by the Member Key Column, you can change
the Order By setting to Key.
Perform the following steps to sort members by the Member Key Column:
1. Select the level in the dimension tree view.
2. In the Properties pane, click the Advanced tab.
3. Click the Order By box, and then click Key.

Tip If you build the dimension by using the Dimension Wizard, it gives you
the option to select any column from the dimension table to define the sort
order, and then the wizard automatically creates the member property for you.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 4: Building Dimensions Using the Dimension Editor 17

Identifying Uniqueness of Members


Topic Objective
To describe the two ! Member Keys Unique
settings, Member Keys
Unique and Member $ Works with the Member Key Column
Names Unique, that
determine the uniqueness of $ Is set as a dimension or level property
members in an entire
dimension or a single level.
$ Affects cube processing performance with True setting
Lead-in $ Cannot be set within a parent-child dimension
The Advanced tab of the
Properties pane contains ! Member Names Unique
two properties that
collaborate with the $ Works with the Member Name Column
Member Key Column and
$ Is set as a dimension or level property
the Member Name
Column—Member Keys $ Affects member naming in MDX with True setting
Unique and Member
Names Unique.

As a rule, two member keys that roll up to one parent must be distinct. Direct
siblings require unique keys. If you have a two-level hierarchy consisting of
city and country, you cannot have two Cairo children below Egypt.
However, member keys do not need to be unique across an entire level of a
dimension. For example, we may have two cities named Cairo, but they each
roll up to a unique county. For example, the level can contain Cairo, Egypt and
Cairo, USA.
The Advanced tab of the Properties pane contains two properties that work
with the Member Key Column and the Member Name Column
respectively—Member Keys Unique and Member Names Unique.

Member Keys Unique


Analysis Services allows non-unique keys for a level or a dimension.
The following are characteristics of the Member Keys Unique property:
! You can set the Member Keys Unique property for an entire dimension or
a particular level.
! Setting the property to Yes improves performance for cube processing,
particularly for the lowest level of a dimension.
! The Member Keys Unique property is not available for a parent-child
dimension—for the dimension or any level in the dimension—because
member keys must be unique in parent-child dimensions.
! The property is also unavailable for all first levels of a dimension. The
reason is that all first level members have either only one parent—All
dimension_name—or the members do not have a parent because the All
level is disabled.
! If you set a level as unique, and the data at the level is not unique, the
dimension is not valid and your dimension and cube fail to process.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


18 Module 4: Building Dimensions Using the Dimension Editor

! Analysis Server will not trap the mistake in the Dimension Editor unless
you browse the dimension. Therefore, it is recommended that you browse
the dimension when setting levels as unique to verify that the dimension is
valid.

Member Names Unique


In addition to the Member Key Column, the Member Name Column can also
be required to be unique.
The following are characteristics of the Member Names Unique property:
! You can set the Member Names Unique property for an entire dimension,
a particular level, or for direct siblings.
! When the Member Names Unique property of a level or a dimension is set
to Yes, the names in the defined levels are not fully qualified with all
ancestor names. The naming convention affects how you identify members
in MDX calculations and queries.

Important Having members with the same name can lead to confusion for
users. For example, if a user looks at a January report, and there are January
members in the years 2000, 2001, and 2002, the user does not know the year in
which January exists.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 4: Building Dimensions Using the Dimension Editor 19

Creating Members from Expressions


Topic Objective
To discuss expressions and
how they are used to define
members in dimensions. ! Add Flexibility When Defining Levels
Lead-in ! Are Created from One or More Columns in a Single
By using expressions for
Member Key Columns or
Table
Member Name Columns, ! Are Defined in the Member Key Column and Member
you add flexibility to the
design, addressing
Name Column in the Dimension Editor
shortcomings in the ! Act as RDBMS Pass-Through Functions
relational database
management system ! Must be Valid RDBMS Syntax
(RDBMS) data.

In many situations, the source RDBMS database does not format data perfectly
Delivery Tips for the dimensions or levels that you want to build in the cube. By creating
Focus on the rules
associated with creating
members from expressions, you can address shortcomings in the RDBMS data.
expressions for members. The following characteristics describe expressions used to create members:
Mention to students that the ! The creation of members from expressions adds flexibility to the design.
boxes in which you type
expressions are not user ! You create expressions from one or more columns in a single dimension
friendly. Use an editor, such table.
as Microsoft® Notepad, to ! You create expressions by typing them directly into the Member Key
create the expressions
Column and the Member Name Column boxes in the Dimension Editor.
before copying and pasting
them into the boxes in the The Dimension Editor does not provide an interface to graphically build
Dimension and Cube expressions. No interface exists in the Dimension Wizard to define a
Editors. dimension level from anything other than a single column.

Caution If you are changing an expression and a syntax error occurs, the
last valid Member Key Column or Member Name Column value
reappears, erasing the invalid expression.

! The expression processes as part of the SQL SELECT statement at


dimension processing time. This is known as a pass-through function.
! Because the expression is a pass-through function to the RDBMS system,
any SQL function valid for the SELECT statement and recognized by the
RDBMS system can be used as an expression.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


20 Module 4: Building Dimensions Using the Dimension Editor

Working with Ragged Dimensions


Topic Objective
To introduce ragged
hierarchies and how to All
define them in regular
dimensions. USA Israel Country
Lead-in
Many dimensions do not No
have the same number of
California Illinois
States State
levels at each dimension
branch. Ragged dimensions
contain branches with
San Jose La Jolla Chicago Tel Aviv Haifa City
varying depths.
! Variable Depth in Branches
! Level Property Hide Member If

Many dimensions do not have the same number of levels at each dimension
Delivery Tip branch. One reason for the varying depths of levels is that some branches may
Ask students if they can
think of other dimension
not have members that exist at all levels.
situations in which For example, the State dimension has the following levels:
hierarchies are ragged.
! Country
Point out that it is the
asymmetrical appearance of ! State
a dimension that makes it ! City
ragged, not the storage of a
dimension on the server. USA contains two states, California and Illinois, with the cities of the two
states existing at the City level. Alternatively, Israel does not contain any states
and only contains two cities, Tel Aviv and Haifa. In this example, the State
dimension is ragged because no states are found below Israel or above Tel
Aviv and Haifa.
A ragged dimension contains at least one member whose parent belongs to a
hierarchy that is more than one level above the child. Ragged dimensions
therefore contain branches with varying depths.
The property Hide Member If works in standard dimensions to give
dimensions a ragged appearance to users.
Key Point Members can be hidden if any of the following are true:
A ragged dimension
contains at least one ! The member is an only child with no name.
member whose logical ! The member is an only child with its parent’s name.
parent does not exist in the
level immediately above the ! The member has no name.
member. Ragged ! The member has its parent’s name.
dimensions therefore
contain branches with
varying depths.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 4: Building Dimensions Using the Dimension Editor 21

Understanding Snowflake Dimensions


Topic Objective
To describe and illustrate
snowflake dimensions. Dimension
Lead-in Tables
When a dimension in a
database originates from
more than one dimension
table, the dimension is
called a snowflake
dimension.

Fact Table

When a dimension in a database originates from more than one dimension


table, the dimension is called a snowflake dimension. A snowflake design looks
like a star design that contains dimension tables joined to other dimension
tables. In a single data warehouse, some dimensions use a star design while
others use a snowflake design.
In the above example, a single table defines the customer dimension while two
dimension tables—store and region—define the Store dimension, making it a
snowflake dimension.
You use the Dimension Wizard or the Dimension Editor to build dimensions
from a snowflake design. In both interfaces, you can choose multiple tables to
define the snowflake dimension and its levels.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


22 Module 4: Building Dimensions Using the Dimension Editor

Defining the All Level


Topic Objective
To introduce the concept of
the All level.
Lead-in ! Summarizes All Data at Top Level of Dimension
The All level, when included ! Is Included by Default
as part of a dimension’s
definition, is the highest ! Is Named All DimensionName by Default
level. It summarizes all
members in the top level of $ For example, All Product
the dimension.
! Can Be Turned Off within the Dimension Editor
! Cannot Be Defined by the Member Key Column or the
Member Name Column
! Can Be Renamed Using the All Caption Property

In Analysis Services, you have a special dimension level called the All level
Delivery Tip that is available in every dimension. The All level, when included as part of a
You may want to switch to
the Dimension Editor to
dimension’s definition, is the highest level.
illustrate the use of the All The following are characteristics of the All level:
level.
! The All level summarizes all members in the top level of the dimension, but
the Dimension Editor dimension tree does not display the All level in its list
of levels.
! The All level is included by default when you create a new dimension—that
is, the All Level property for the dimension is set to Yes.
! The default caption is All DimensionName. For example, in the Product
dimension, the All level is named All Product by default.
! You turn off the All level in the Dimension Editor if the summarized data
does not make sense. You may not want to use the All level when dealing
with scenario or time dimensions.
For example, Actual and Budget values should not be summarized to an All
level because these scenarios are discrete data sets that are not logically
added to one another.
! The Member Key Column and Member Name Column properties do not
apply to the All level of a dimension.
! The name for the All level member does not originate from the relational
data warehouse. However, you can change the name of the All level
member by using the All Caption property.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 4: Building Dimensions Using the Dimension Editor 23

Specifying a Default Member


Topic Objective
To discuss the default
member of a dimension and
to explain how to update its
value.
Lead-in
Each dimension has a
default member. You can
explicitly define the default
member for each dimension.

Each dimension has a default member. The default member provides


PivotTable® Service (PTS) with information when a report does not provide
enough information about a query’s dimension members. A query retrieves data
from the default member of a dimension if no other members are included from
that dimension.
In the simple browser included in Analysis Manager, all dimensions are always
included in a query—either as part of the data grid or as filter dimensions. In
more sophisticated browsers, such as the PivotTable list browser in Microsoft
Excel, you can omit a dimension from a query. In the queries that do not
contain all dimensions, the default member is necessary because all data values
require description by at least one member per dimension.
The standard default member is the All level member. However, you can
specify any default member you want. By using the Default Member property,
you can define another member from the dimension or you can define an
expression representing the default member by using multidimensional
expressions (MDX).

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


24 Module 4: Building Dimensions Using the Dimension Editor

Lab A: Creating a Standard Dimension


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will use the
Dimension Editor to add
levels to the State
dimension and to update
settings in the Properties
pane.

Explain the lab objectives.


Objectives
After completing this lab, you will be able to:
! Define a data source.
! Create a new dimension by using the Dimension Editor.
! Update the Member Key Column for a dimension.
! Change the sort order of a level.
! Add levels to a dimension.
! Turn a standard, balanced dimension into a standard, ragged dimension.

Estimated time to complete this lab: 15 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 4: Building Dimensions Using the Dimension Editor 25

Exercise 1
Creating the State Dimension
In this exercise, you will create the State dimension, update the State level
Member Key Column, and sort the level based upon the Member Key
Column. In addition, you will add levels and important level properties found
in the Dimension Editor.

! To create a new database and define a data source


1. Open Analysis Manager and double-click the local server.
2. In Analysis Manager, right-click the local server, click New Database, type
Module 04 in the Database name box, and then click OK.
3. Double-click Module 04 to expand the database.
4. Right-click the Data Sources folder and then click New Data Source.
5. On the Provider tab of the Data Link Properties dialog box, click
Microsoft OLE DB Provider for SQL Server, and then click Next.
6. Type localhost in the server name box, click Use Windows NT Integrated
security, click Module 04 in the Select the database on the server list, and
then click OK.

! To create a new dimension


1. In the Module 04 database, right-click the Shared Dimensions folder, point
to New Dimension, and then click Editor.
2. Click State as the dimension table in the Choose a Dimension Table dialog
box, and then click OK.
The left side of the Dimension Editor is divided into two panes. The upper
left pane contains the dimension tree that displays levels as you design the
dimension. The lower left pane contains dimension properties. If you click
the Properties button, the Properties pane disappears or reappears,
depending on whether the pane is showing after opening the Dimension
Editor.
3. In the Properties pane, the current name of the dimension is <New>. Type
State as the name and then press ENTER.
The name of the dimension appears in the dimension tree.
4. Drag State_Name from the State table in the Schema pane onto the name
of the State dimension in the dimension tree.
This creates a new level in the dimension.
5. Select the State Name level in the dimension tree, type State in the Name
box on the Properties pane, and then press ENTER.
6. Click the Data tab at the bottom of the Schema pane. Double-click All
State and view the members in the State dimension.
7. On the toolbar, click Save, and then close the Dimension Editor.

! To open the State dimension


• In the Module 04 database, double-click the Shared Dimensions folder,
right-click State, and then click Edit.
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
26 Module 4: Building Dimensions Using the Dimension Editor

! To update the Member Key Column


1. In the Dimension Editor, click the State level in the dimension tree, and
then click the Basic tab in the Properties pane.
Note that the Member Name Column property has the value
“dbo”.”State”.”State_Name”. The Member Name Column identifies the
names of the table and the column that provide the member names for the
level. The Member Key Column property has the same value.
2. Click the Member Key Column box, and then click the ellipsis (…) button.
3. In the Select Column dialog box, click State_ID, and then click OK.
4. Click the Data tab on the Schema pane, double-click All State, and then
review the names and the order of the members in the State level.
Note that the value of the Member Key Column property changes to
“dbo”.“State”.“State_ID,” but the member names displayed in the
Dimension Members pane do not change.
5. In the Properties pane, click the Advanced tab, and then scroll down
towards the bottom of the list of properties.
6. Click the Order By box, click Key, and then press ENTER.
7. View the State members in the Dimension Members pane.
Notice the change in sort order of the level.

! To add levels to the State dimension


1. In the Dimension Editor, click the Schema tab at the bottom of the
Dimension Members pane.
2. Drag the Country column from the State table onto the State level of the
dimension tree.
A new level, Country, appears just above the existing State level.
3. Drag the Region column from the State table onto the name of the
dimension.
4. When warned that Region contains fewer members than the State level,
click No to continue to put the new level at the bottom of the dimension
tree.
Analysis Manager warns you if an added level contains fewer members than
its parent level. You have the option to accept or decline the option of
moving the levels based upon the number of members.
5. In the dimension tree, drag the Region level on top of the State level.

Note Dropping a column onto the dimension name adds the column as the
lowest level of the dimension. Dropping a column onto an existing level
name adds the column as a new level immediately above the existing level.

6. Click the Data tab, and then expand all nodes of the State dimension tree.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 4: Building Dimensions Using the Dimension Editor 27

! To update the All level


1. In the dimension tree, click the State dimension.
2. On the Advanced tab of the Properties pane, change the All Caption
property setting from All State to North America, and then press ENTER.
3. On the Dimension Members pane, notice the North America member at the
top of the dimension hierarchy.

! To make the dimension ragged


1. Verify that North America is expanded to all levels and members of the
dimension.
2. Notice the duplication of Canada and Mexico in the hierarchy.
Both countries do not separate their states into regions in the dimension.
Therefore, both countries repeat their country names at the Region level.
3. In the dimension tree, click the Region level of the State dimension, and
then click the Advanced tab of the Properties pane.
4. Click the Hide Member If property box, click Only child with parent’s
name from the list, and then press ENTER.
5. On the Dimension Members pane, expand the North America node to
display the entire dimension hierarchy.
6. Notice the absence of the Canada and Mexico regions in the dimension
hierarchy.
7. Click Save to save the dimension.

Note Internally, the State dimension is still a standard, balanced dimension


as it was before. To the person that is using the dimension, however, it
appears that British Columbia has fewer ancestors than Washington.
Because of this update, the State dimension is now a ragged dimension.

8. Close the Dimension Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


28 Module 4: Building Dimensions Using the Dimension Editor

Lab B: Creating a Snowflake Dimension


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will use the
Dimension Editor to create a
snowflake dimension and to
update settings in the
Properties pane.

Objectives
Explain the lab objectives. After completing this lab, you will be able to:
! Create a snowflake dimension.
! Add levels to a snowflake dimension.
! Understand how the Member Key Column builds levels.
! Use an expression to define a level.
! Define the default member.

Lab Setup
To complete this lab, you must first:
! Complete lab A, Creating a Standard Dimension, found earlier in the
module.

Estimated time to complete this lab: 15 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 4: Building Dimensions Using the Dimension Editor 29

Exercise 1
Creating the Product Dimension
In this exercise, you will create a snowflake dimension through the Dimension
Editor. You will define multiple tables to build the dimension and will define
the levels for the Product dimension. In addition, you will use an expression to
define member names and will update the All Caption and the Default
Member properties.

! To create the Product dimension


1. In Analysis Manager, beneath the Module 04 database, right-click the
Shared Dimensions folder, point to New Dimension, and then click
Editor.
2. Click the Product table, and then click OK.

Tip When specifying the first table for a snowflake dimension, select either
the table for the lowest level or the table for the highest level. If you select a
table in the middle of the hierarchy, the Dimension Editor might not create
joins properly as you add tables. The Product table defines the lowest level
of the Product dimension.

3. On the Insert menu, click Tables to add the next tables.


4. Double-click the Product Subcategory table and the Product Category
table, and then click Close.
The Dimension Editor automatically joins tables if a column with the same
name appears in both tables. You can also add and delete joins graphically
in the Dimension Editor by using the mouse.
5. On the Basic tab of the Properties pane, type Product as the name of the
dimension, and then press ENTER.

! To add levels to Product


1. In the Schema pane, double-click the Product_ID column in the Product
table.

Note Double-clicking a column name in a table is equivalent to dragging


the column onto the dimension name in the dimension tree—that is, it adds
the column as a new bottom level.

2. In the Properties pane, change the name of the Product_ID level to


Product, and then press ENTER.
3. Drag the Subcategory column from the Product Subcategory table onto
the Product level in the dimension tree.

Tip The Dimension Editor does not automatically resize tables to fit table
and column names. You may need to resize the tables to determine the
names.

4. Drag the Category column from the Product Category table onto the
Subcategory level.
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
30 Module 4: Building Dimensions Using the Dimension Editor

5. At the bottom of the Schema pane, click the Data tab to preview the
dimension. Expand All Product, Bread, and Muffins.
6. Notice the Product level member names.
Are the names informative to users? You will update the Member Name
Column to make the member names more meaningful to users.

! To update the Product level member names.


1. Click the Product level, and then, in the Properties pane, change the
Member Name Column from “dbo”.”Product”.”Product_ID” to
“dbo”.”Product”.”Product_Name”
You receive an error in the Data pane. Product names are identical for
products with different product IDs. A dimension cannot contain multiple
siblings with the same name.
You will create an expression in the Member Name Column to
concatenate Product_ID and Product_Name. By combining the two
columns, you enforce that siblings have unique member names.
2. Change the Member Name Column value of the Product level to the
following expression:
"dbo"."Product"."Product_ID" + ' - ' +
"dbo"."Product"."Product_Name"

Tip If the expression you type contains incorrect syntax, the Dimension
Editor erases the syntax and the Member Name Column reverts to the
original expression. Therefore, before pressing ENTER, copy the new
expression to the clipboard or to Windows® Notepad.

You receive an error in the Data pane indicating a problem with data types.
The problem with the expression is that you cannot concatenate an integer
data type to a character data type. However, you can add a conversion
function to the expression, to convert both columns to character data.
3. Update the expression in the Member Name Column so that it contains the
following expression:
convert(char, "dbo"."Product"."Product_ID") + ' - ' +
"dbo"."Product"."Product_Name"

Here you surround Product_ID with the convert SQL Server function,
which converts the integer data to character data.
You can use SQL Server functions in the Member Name Column because
the data source of the cube is a SQL Server database.
4. Browse the Product dimension in the Dimension Members pane.
You do not receive an error. However, converting Product_ID to a
character data type added spaces to the end of Product_ID. You will update
the expression, adding a function to remove the empty spaces.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 4: Building Dimensions Using the Dimension Editor 31

5. Update the expression in the Member Name Column so that it contains the
following expression:
rtrim(convert(char, "dbo"."Product"."Product_ID")) + ' - '
+ "dbo"."Product"."Product_Name"

Here you surround the entire Product_ID expression with the rtrim SQL
Server function, which removes empty spaces from the right side of
Product_ID.
6. Expand the dimension to all descendants in the Dimension Members pane to
see the unique product names.

! To specify a default member


1. In the dimension tree, click the Product dimension, and then click the
Advanced tab of the Properties pane.
2. Click the Default Member box, and then click the ellipsis (…) button.
3. Expand All Product and Bread, click the Bagels member, and then click
OK.
When the Product dimension is included in a cube, Bagels is returned if no
other member is defined from the Product dimension in cube queries.
4. Click Save to save the dimension, and then close the Dimension Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


32 Module 4: Building Dimensions Using the Dimension Editor

# Working with Parent-Child Dimensions


Topic Objective
To introduce the concept of
parent-child dimensions.
Lead-in ! Overview of Parent-Child Dimensions
Parent-child dimensions ! Structure of a Parent-Child Dimension
give you the ability to create
dimensions from two- ! Members with Data
column dimension tables.
! Parent-Child Level Management
! Skipped Levels Column

Parent-child dimensions provide dimension and level flexibility for OLAP


cubes. Many dimension and cube features exist only when you use parent-child
dimensions.
In this section, you will learn about the structure and the use of parent-child
dimensions in OLAP applications.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 4: Building Dimensions Using the Dimension Editor 33

Overview of Parent-Child Dimensions


Topic Objective
To explain parent-child
dimension basics.
! Are Based on a Two Column Dimension Table
Lead-in
Now we will discuss the ! Contain Levels Created by Parent-Child
characteristics of parent-
Relationships
child dimensions.
! Contain Unbalanced Levels
! Are Created with the Dimension Wizard
! Can Slow Queries that Reference Them

Parent-child dimensions do not map their levels directly to dimension table


columns. Instead, they create their levels by mapping relationships between two
columns in a dimension table. The two columns designate the child member
key and the parent member key.
The child member key identifies each member in the parent-child dimension.
Analysis Services does not add a member to a parent-child dimension unless the
key of the member exists in the child member key column. The parent member
key identifies the parent of each child member. Together, the two columns
identify the members found in the dimension and the placement of each
member in the dimension hierarchy.

Note If a child member does not have a corresponding parent member, the
child member is placed at the top of the dimension hierarchy.

One important advantage to using parent-child dimensions is that they support


unbalanced hierarchies. A hierarchy is unbalanced if it has dimension branches
containing varying numbers of levels. Another advantage to using parent-child
dimensions is that they are considered changing dimensions. Therefore, you can
add and change members in the dimension without having to fully reprocess the
dimension.
The Dimension Editor does not allow you to create a parent-child dimension.
You must always use the Dimension Wizard to create a new parent-child
dimension. After you create a parent-child dimension, you can use the
Dimension Editor or the Cube Editor to modify its properties.
The one disadvantage to using a parent-child dimension is that aggregations are
not created for the members at the various levels in the dimension. Therefore,
queries that reference parent-child dimensions can be much slower than queries
referencing standard dimensions containing aggregations. Consider query
performance when deciding on dimension types and structure.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


34 Module 4: Building Dimensions Using the Dimension Editor

Structure of a Parent-Child Dimension


Topic Objective
To show the physical Employee Manager
structure of a parent-child Smith
dimension. Smith <none>

Lead-in Jones Smith


Here is an example of a Jones White White Smith
parent-child table.
Block Jones

Block Hart Knight Hart Jones


Knight Jones

Fox Hunt Fox Hart


Hunt Hart
Smart Hunt
Smart

In the preceding illustration, you see a parent-child dimension and its


Delivery Tip corresponding dimension table. To understand the process of creating a parent-
Present this topic by
stepping through the
child dimension from a two-column table, consider the following:
creation of the dimension by ! The dimension table contains two columns—Employee and Manager.
using the dimension table in
the preceding illustration. ! The Employee column defines the members included in the dimension.
! The Manager column defines where the members exist in the dimension. In
other words, the Manager column defines the dimension hierarchy.
! The employee Smith does not have a manager. Therefore, Smith exists at
the top of the dimension hierarchy.
! Smith is the manager of two employees—Jones and White. Therefore,
Smith has two children in the dimension.
! Five employees are not found in the Manager column—White, Block,
Knight, Fox, and Smart. These members exist at the bottom of their
dimension branches. Members at the bottom of branches are called leaf
members.
In the preceding illustration, both the child member key and the parent member
key use names to build the dimension structure. In most cases, however,
columns containing numeric keys define parent-child relationships. Therefore,
you can define a third column in the Dimension Wizard, member name, to
provide names for all the dimension members.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 4: Building Dimensions Using the Dimension Editor 35

Members with Data


Topic Objective
To introduce the Members
with Data property and
describe when to use it. ! In Standard Dimensions, Only Leaf Members Can
Lead-in Correspond to Fact Table Data
The Members with Data
property is only used in
! In Parent-Child Dimensions, Leaf and Upper Level
parent-child dimensions. Members Correspond to Fact Table Data
! The Members with Data Property Has Three Possible
Settings:
$ Leaf Members Only
$ Non-leaf Data Hidden
$ Non-leaf Data Visible

In a standard dimension, only the leaf-level members can correspond to values


Delivery Tips in the fact table. For example, in a Time dimension, you cannot have some
First, explain what it means
to have data associated with
rows in the fact table with monthly values and other rows with quarterly values.
non-leaf members. In a parent-child dimension, on the other hand, it is common to have values in
the fact table at both the leaf level and at a parent level.
Next, describe the three
options for the Members
For example, in the Module 04 database, Sheri Nowmer is the CEO of the
with Data level property. company, but she was directly responsible for many of the sales in the
SalesFact table, as well as being indirectly responsible for the sales of all those
Explain why you would use below her in the organization. Before processing a cube that has data for non-
one option versus another. leaf-level members, you must change a property of the dimension.
The Members with Data property is available only for parent-child
dimensions, and it has three possible settings:
1. Leaf Members Only—the default setting of the Members with Data
property. Data can only be associated with leaf members in the cube. When
a cube encounters data stored at higher levels, an error message indicates
that the fact table contains values for non-leaf level members.
2. Non-leaf Data Hidden—A cube fact table can contain data at non-leaf level
members and the data is added to the cube data. However, the member that
the non-leaf member data is associated with is not included in the dimension
hierarchy. Therefore, the total for a member may be greater than the sum of
its visible children.
3. Non-leaf Data Visible—A cube fact table can contain data at non-leaf level
members, and Analysis Services creates a new member for each parent to
store the value that is visible to users. The new member can display the
values linked to that member.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


36 Module 4: Building Dimensions Using the Dimension Editor

Parent-Child Level Management


Topic Objective
To emphasize the fact that
there are different ways to
display the levels in a
parent-child dimension.
Lead-in
Though the hierarchy for a
parent-child dimension
comes from one dimension
table, you do have options
when it comes to displaying
the levels.

The hierarchy for a parent-child dimension is derived from a single dimension


column. Because the levels defined in a parent-child dimension do not map
directly to separate columns, Analysis Services does not automatically assign
meaningful names to levels. For example, the level immediately below the All
level is named Level 02 by default in a parent-child dimension.
To change the level names in parent-child dimensions, use the Level Naming
Template dialog box. Access the dialog box by clicking the Advanced tab of
the Properties pane in the Dimension Editor and the Cube Editor for a particular
dimension. Then, click the Level Naming Template property.
In the Level Naming Template dialog box, you define as many levels as
necessary, giving each level a meaningful name. You name levels based on user
requirements and how you want the levels displayed in client applications.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 4: Building Dimensions Using the Dimension Editor 37

Skipped Levels Column


Topic Objective
To describe the Skipped
Levels Column property.
Lead-in ! Creates Ragged Hierarchies within Parent-Child
The Skipped Levels Dimensions
Column property allows you
to create ragged hierarchies
! Uses a Column in the Dimension Table that Contains the
in parent-child dimensions. Number of Levels to Skip
! Is Accessed from the Advanced Tab of the Properties
Pane

The Skipped Levels Column property allows you to create ragged hierarchies
in parent-child dimensions. As defined earlier in the module, a ragged
dimension contains at least one member whose parent belongs to a hierarchy
that is more than one level above the child. Ragged dimensions therefore
contain branches with varying depths.
When using the Skipped Levels Column, you define a column in the
dimension table that indicates the number of levels to skip between each
member and its parent. In a ragged parent-child dimension, extra levels are
added to a branch in the place of one or more parents in the dimension
hierarchy. This differs from ragged standard dimensions, where a parent is
hidden and members are removed from the dimension hierarchy.
You access the Skipped Levels Column property from the Advanced tab of
the Properties pane in the Dimension Editor or the Cube Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


38 Module 4: Building Dimensions Using the Dimension Editor

Lab C: Creating a Parent-Child Dimension


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will create
the Employee dimension,
and will update advanced
settings by using the Cube
Editor.

Objectives
Explain the lab objectives. After completing this lab, you will be able to:
! Create a parent-child dimension.
! Apply advanced properties to parent-child dimensions.
! Update the structure of a parent-child dimension table.

Prerequisites
Before working on this lab, you must first:
! Complete lab A, Creating a Standard Dimension, found earlier in the
module.
! Complete lab B, Creating a Snowflake Dimension, found earlier in the
module.

Estimated time to complete this lab: 30 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 4: Building Dimensions Using the Dimension Editor 39

Exercise 1
Creating the Employee Dimension
In this exercise, you will create the Employee dimension, and will update
advanced settings by using the Cube Editor.

! To create a simple cube


1. In Analysis Manager, expand Module 04, right-click the Cubes folder,
point to New Cube, and then click Wizard.
2. Click Next to skip the welcome page.
3. Click SalesFact as the fact table, and then click Next.
4. Double-click Sales_Dollars and Sales_Units to include the columns as
measures in the cube, and then click Next.
5. Click the double-arrow button (>>) to add all dimensions to the cube, and
then click Next.
6. Click Yes to count the fact table rows.
7. Name the cube Simple Sales, and then click Finish.
The Cube Editor opens.

! To create the Employee dimension


1. In the Cube Editor, right-click the Dimensions folder in the tree pane, and
then click New Dimension to start the Dimension Wizard.
2. Click Next to skip the welcome page.
3. Click the Parent-Child option, and then click Next.
4. Click the Employee dimension table, and then click Next.
5. Click Employee_ID in the Member key list, click Manager_ID in the
Parent key list, click Employee_Name in the Member name list, and then
click Next.
6. Click Next to skip the Select advanced options step.
7. Name the dimension Employee, clear the Share this dimension with other
cubes check box, and then click Finish.
You have created a private dimension named Employee.

! To allow for non-leaf-level data


1. In the cube tree, click the Employee dimension, click the Advanced tab of
the Properties pane, and then click the Members with Data property.
2. Click Non-leaf data visible as the value of the Members With Data
property.
3. Browse the Employee dimension in the Cube Editor.
The new members appear to hold the managers’ data. The new member
names are in parentheses. Because the total rows for the managers clearly
include the work “Total,” you want to simply display the employee name
for the new data fields. You can change the template to change how the new
member name appears.
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
40 Module 4: Building Dimensions Using the Dimension Editor

4. Clear the Data Member Caption template property, and then press
ENTER.
The managers’ data members now look very similar to those of the other
members.
5. Click Process Cube, click Yes to save the cube, click No to design storage,
and then click OK to fully process the cube.
6. When processing completes, close the Process window, click the All
Product member in the Product dimension, and then expand all levels of
the Employee dimension.
You can now easily compare Sheri Nowmer’s individual sales with those
of her entire group and with those of other managers and employees.

! To manager parent-child levels


1. In the cube tree, click the Employee dimension, click the Advanced tab of
the Properties pane, change the value of the All Level property to No, and
then press ENTER.
2. Browse the dimension and notice the removal of the All Employee member.
3. Expand the Employee dimension in the cube tree, and then click the
Employee Id Level.
4. Click the Advanced tab of the Properties pane, click the Level Naming
Template property, and then click the ellipsis (…) button.
5. Click the Name box to the right of the asterisk (*), and then type CEO
Do not click OK or press ENTER.
6. Click the Name box in the second row, and then type Manager
7. Click the Name box in the third row, and then type Supervisor
8. Click the Name box in the fourth row, and then type Individual
Contributor and then click OK.

! To browse the Employee levels


1. Browse the Employee dimension.
2. Double-click the CEO, Manager, and Supervisor headings to see the
entire hierarchy.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 4: Building Dimensions Using the Dimension Editor 41

! To skip dimension table columns


1. In the Cube Editor, click the Schema tab to display the source tables for the
cube.
2. Right-click the heading of the Employee table, and then click Browse Data.
3. Notice the Skipped_Levels column that contains integers indicating the
number of columns that members skip in the dimension hierarchy.
Darren Stanz and Brenda Blumberg are individual contributors in their
organization. They simply report directly to the CEO and Manager,
respectively. Therefore, they currently do not appear in the correct level in
the Employee dimension. Ideally, you want the employees to appear in the
Individual Contributor column. For Darren, that requires skipping two
levels, and for Brenda, it requires skipping one level.
The Skipped_Levels column contains a value of 2 for Darren Stanz, and a
value of 1 for Brenda Blumberg. Skipping those levels will move Darren
and Brenda to the appropriate level in the Employee dimension.
4. Close the Browse Data window, expand the Employee dimension, click the
Employee Id level, click the Advanced tab of the Properties pane, and then
click the Skipped Levels Column property.
5. Click the ellipsis (…) button.
6. In the Select Column box, click the Skipped_Levels column, and then
click OK.

! To process the cube


1. Click Process Cube, click Yes to save the cube, click No to design storage,
click Full Process, and then click OK to fully process the cube.
2. When the cube is finished processing, close the Process dialog box, click
the Data tab, and then expand the CEO, Manager, and Supervisor level
headings of the Employee dimension.

Note Be sure that you expand the dimension by double-clicking the level
headings, and not the members in the dimension. The cube browser does not
allow you to see Darren Stanz and Brenda Blumberg if you double-click
their parents; you must double-click the level headings from CEO down to
Supervisor.

3. Notice that Darren and Brenda now appear in the Individual Contributor
level, even though they report directly to their level managers.
In a parent-child dimension, skipping levels creates a ragged hierarchy.
4. Close the Cube Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


42 Module 4: Building Dimensions Using the Dimension Editor

Exercise 2
Updating a Parent-Child Table
In this exercise, you will update a table in the Module 04 database to include
correct parent-child level mappings.

! To review a Parent-Child dimension


1. Review the following ParentChild_Product dimension hierarchy:

A parent-child table defines the hierarchy of the ParentChild_Product


dimension.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 4: Building Dimensions Using the Dimension Editor 43

2. In the following table, fill in the Parent_ID column with the appropriate
Product IDs based upon the hierarchy in the preceding illustration.
You want to map each product to its parent, referencing the Product_ID of
the parent in the Parent_ID column. Use the above hierarchy to identify the
parent of each product.

Tip For the children of All ParentChild_Parent, define their Parent_ID


values equal to their own Product_ID values.

Product_ID Product_Name Parent_ID

320 Cola
73 Sliced Turkey
2 Beverages
60 Whole Milk
400 Honey Roasted
30 Deli Meats
1 Food
80 Milk
90 Muffins
279 Blueberry Muffins
56 2% Milk
310 Diet Cola
85 Cola
72 Corned Beef
425 Cajun

! To update the ParentChild_Product table


1. Click Start, point to Programs, point to Microsoft SQL Server, and then
click Enterprise Manager.
Enterprise Manager, the administrative interface for SQL Server 2000,
opens.
2. In Enterprise Manager, double-click Microsoft SQL Servers, double-click
SQL Server Group, double-click your local server, double-click the
Databases folder, and then double-click Module 04.
3. Click Tables and notice the tables that appear in the right pane.
4. Right-click the ParentChild_Product table, point to Open Table, and then
click Return all rows.
The ParentChild_Product table opens. You can make changes to the data
here.
5. In the Parent_ID column, replace each <NULL> value with the appropriate
parent ID, paying close attention to the ID values. Use the above table that
you updated with Parent_ID values.
6. After you are finished updating the table, close ParentChild_Product.
7. Close Enterprise Manager.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


44 Module 4: Building Dimensions Using the Dimension Editor

! To create the ParentChild_Product dimension


1. In Analysis Manager, expand the Module 04 database.
2. In the Module 04 database, create a new parent-child dimension by using
the Dimension Wizard.
3. Select the ParentChild_Product table as the dimension table.
4. Use the appropriate columns for the member key, the parent key, and the
member name columns.
5. Name the dimension ParentChild_Product.
6. Browse the new dimension, ParentChild_Product, and verify that its
hierarchy looks exactly like the preceding illustration.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 4: Building Dimensions Using the Dimension Editor 45

Review
Topic Objective
To reinforce module
objectives by reviewing key
points. ! Understanding Dimension Basics
Lead-in ! Shared vs. Private Dimensions
The review questions cover
some of the key concepts ! Working with Standard Dimensions
taught in the module.
! Basic Level Properties
! Working with Parent-Child Dimensions

1. What are levels? What are members?


Levels are the summarization categories defined when you create a
dimension. Members are the specific instances of those levels.

2. Where do you maintain shared dimensions in Analysis Manager? Where do


you maintain private dimensions?
You maintain shared dimensions in the Dimension Editor. You
maintain private dimensions in the Cube Editor.

3. Why would you describe a dimension as balanced?


You describe a dimension as balanced if each member of its hierarchy
contains the same number of ancestors as any other member at the
same level. In other words, all the dimension branches have the same
number of levels.

4. What is the All level? Describe a situation in which you would not use it.
The All level is the top summarization level of dimensions, which exists
by default. Turn off the All level when you do not want the first level
data summarized, as in the case of a Time dimension or a Scenario
dimension.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


46 Module 4: Building Dimensions Using the Dimension Editor

5. When using expressions to define Member Key Columns and Member


Name Columns, what rules must you apply to the expression for it to
perform properly?
You must create the expression from one or more columns in the
dimension table. Because it is a pass-through function to the RDBMS
system, the expression must be recognized by the RDBMS system and
must be an SQL function valid for the SELECT statement.

6. What are some of the advantages and disadvantages of using parent-child


dimensions?
Parent-child dimensions allow for unbalanced hierarchies. This is
beneficial for many financial reporting applications that use
unbalanced chart of accounts and organizational structures. In
addition, parent-child dimensions are automatically considered
changing dimensions and, therefore, member changes do not require a
full process. However, query performance can be slower with parent-
child dimensions because aggregates are not stored. Finally, using
parent-child dimensions you can load non-leaf level data into cubes.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using
Advanced Dimension
Settings
Contents

Overview 1
Working with Levels and Hierarchies 2
Working with Time Dimensions 10
Lab A: Creating Time Dimensions 18
Lab B: Creating Hierarchies from Single
Columns 22
Creating Custom Rollups 29
Lab C: Creating a Custom Rollup 34
Introducing Member Properties 37
Lab D: Creating Member Properties 42
Understanding Virtual Dimensions 44
Lab E: Creating Virtual Dimensions 50
Review 54
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, the 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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings iii

Instructor Notes
Presentation: There are several types of dimensions that can be created by using Microsoft®
50 Minutes SQL Server™ 2000 Analysis Services. In this module, you lead students through
a solutions-oriented discussion of various advanced dimension settings and
Labs: methods used to develop online analytical processing (OLAP) dimensions and
70 Minutes cubes. This module contains labs that give students hands-on experience with
various types of real-world dimensions.
After completing this module, students will be able to:
! Work with dimension levels and hierarchies.
! Understand and work with time dimensions.
! Create custom rollup dimensions.
! Define member properties at dimension levels.
! Create virtual dimensions from member properties and member levels.

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 Microsoft PowerPoint® file 2074A_05.ppt

Preparation Tasks
To prepare for this module, you should:
! Read all the student materials.
! Read the instructor notes and margin notes.
! Complete the demonstration.
! Practice the lecture presentation and demonstration.
! Complete the labs.
! 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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


iv Module 5: Using Advanced Dimension Settings

Demonstration: Creating Virtual Dimensions


Demonstration: To place a virtual dimension in a cube, you must perform the following tasks:
10 Minutes 1. Create the source member property, if the virtual dimension is based on a
member property.
2. Create a new virtual dimension.
3. Add the virtual dimension to the cube.
4. Process the cube.

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\L05\Module
05.CAB, click Open, and then click Restore.
2. After the database successfully restores, click Close.
3. Double-click Module 05 to expand the database.
4. Below Module 05, double-click Data Sources, right-click the Module 05
data source, and then click Edit.
5. Click the Connection tab of the Data Link Properties dialog box, and then
verify that localhost is selected in step 1.
6. In step 2, click Use Windows NT Integrated security.
7. In step 3, click Module 05 from the Select the database on the server list.
8. Click Test Connection and verify that the test succeeded, click OK, and
then click OK to close the Data Link Properties dialog box.

! To create a new member property


1. In Analysis Manager, expand the Module 05 database, expand the Shared
Dimensions folder, right-click Customers, and then click Edit.
2. In the Schema pane, right-click the Customer table, and then click Browse
Data.
3. Notice the gender column. You will create a new virtual dimension based
on gender, because users need to see customer by gender in their reports.
4. Close the Browse Data window.
5. Double-click the Name level, right-click the Member properties folder,
and then click New Member Property.
6. Click gender under the Customer table, and then click OK.
7. Click the Data tab, expand the Customers dimension to the lowest level,
and then click on a few leaf members to show the member property values
in the Member properties pane.
8. Click Save, and then close the Dimension Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings v

! To create a new virtual dimension


1. In the Module 05 database, right-click the Shared Dimensions folder, point
to New Dimension, and then click Wizard.
2. Click Next, click Virtual Dimension, and then click Next.
3. In the Available Dimensions pane, click Customers, notice Name.Gender
in the Member properties pane, and then click Next.
4. In the Available member properties pane, double-click Name.Gender, and
then click Next twice.
5. Type Gender in the Dimension name box, and then click Finish to open
the Dimension Editor.
6. Close the Dimension Editor.

! To create a new cube


1. In the Module 05 database, right-click the Cubes folder, point to New
Cube, click Wizard, and then click Next.
2. Click the custfact table, and then click Next.
3. Double-click store_sales and store_cost, and then click Next.
4. Double-click Customers, CustTime, and Gender, and then click Next.
5. Click Yes when the dialog asks to count fact table records.
6. Type Gender Cube in the Cube name box, and then click Finish.

! To browse the virtual dimension


1. In the Cube Editor, click the Tools menu, click Process Cube, and then
click No to process the cube without designing aggregations.
2. In the Process a Cube dialog box, click OK.
3. When the cube is finished processing, click Close.
4. Click the Data tab to browse the cube.
5. Pivot the Customers dimension so that it becomes the column dimension
and pivot the Gender dimension so that it becomes the row dimension.
6. Click Save, and then close the Cube Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


vi Module 5: Using Advanced Dimension Settings

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. Why do you need to disable the counting of members when creating
dimensions?
Some dimensions are so large that Analysis Manager cannot
successfully count the members at all the levels. Analysis Manager can
close down while attempting to count millions of members. Therefore,
in some instances you need to manually enter the member counts due to
the technical restriction in Analysis Manager when working with
extremely large dimensions.
2. How do front-end applications display dimensions containing multiple
hierarchies?
The front-end applications that developers use most often to browse
cubes, namely Microsoft Excel 2000 and the Cube Browser, do not
display multiple hierarchies in the same way that most third-party
applications display them. Excel 2000 and the Cube Browser treat each
hierarchy as a separate, independent dimension. However, most third-
party applications direct the user to select one hierarchy per dimension
at any one time to browse cube data. Therefore, the users never view
multiple hierarchies together on the same report.
3. How much detail do you typically define in a Time dimension?
All Time dimensions vary in the level of detail that they store. OLAP
systems tend to store data at a more summarized level than operational
systems. Therefore, a common hierarchical structure in Time
dimensions includes Year, Quarter, and Month. However, many
companies track daily sales in OLAP cubes and therefore store data
down to the Day level. Manufacturing systems exist that define Time
down to the Minute level. The levels defined in a Time dimension
depend on the reporting and processing requirements of the cube.
4. How slow are queries that use virtual dimensions?
Query performance depends on a variety of factors, including cube
complexity, the number of members in a virtual dimension, the amount
of data accessed by the query, and even network traffic. Therefore, you
must test the performance of queries that incorporate virtual
dimensions to ensure that the response times are not excessively slow.
Virtual dimensions in Analysis Services have improved since their
initial release in SQL Server [version 7.0] OLAP Services. Nevertheless,
you should always test performance before releasing cubes to users.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings vii

Module Strategy
Use the following strategy to present this module:
! Working with Levels and Hierarchies
Explain the importance of levels in the hierarchical structure of a dimension.
Define the various level settings and describe how these settings enhance
levels and hierarchies. Define the hierarchies and describe how to create
multiple hierarchies in a single dimension. Describe the ways to create
grouping levels in dimensions containing large amounts of members.
! Working with Time Dimensions
Explain the importance of Time dimensions in OLAP cubes. Describe the
characteristics of Time dimensions and explain how to create them. Discuss
various Time dimension properties and why they are used. Explain what a
fiscal date hierarchy is and when it used. Finally, describe how to use a
string to define a Time dimension.
! Creating Custom Rollups
Define custom rollups and describe how they are used to model hierarchical
calculations in dimensions. Introduce the use of unary operators, and
describe the different operators and their behaviors. Finish the section by
describing how to employ custom rollups in a dimension and the restrictions
related to creating them in cubes.
! Introducing Member Properties
Introduce the use of member properties in dimensions. Describe the
characteristics of member properties and explain the steps of creating and
previewing a new member property.
! Understanding Virtual Cube Dimensions
Begin the section by defining virtual dimensions. Explain when they are
used and how they are created. Compare virtual dimensions to regular
dimensions and discuss when each type of dimension should be used.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 1

Overview
Topic Objective
To provide an overview of
the module topics and ! Working with Levels and Hierarchies
objectives.
Lead-in ! Working with Time Dimensions
In this module, you will learn ! Creating Custom Rollups
about advanced dimension
types and settings. ! Introducing Member Properties
! Understanding Virtual Dimensions

There are several types of dimensions that can be created by using Microsoft®
SQL Server™ 2000 Analysis Services. This module consists of a solutions-
oriented discussion of various advanced dimension settings and methods used
to develop online analytical processing (OLAP) dimensions and cubes. This
module contains labs that give you hands-on experience with various types of
real-world dimensions.
After completing this module, you will be able to:
! Work with dimension levels and hierarchies.
! Understand and work with time dimensions.
! Create custom rollup dimensions.
! Define member properties at dimension levels.
! Create virtual dimensions from member properties and member levels.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


2 Module 5: Using Advanced Dimension Settings

# Working with Levels and Hierarchies


Topic Objective
To introduce the concept of
levels and hierarchies.
Lead-in ! Applying Level Settings
In this section, we will ! Defining a Hierarchy
discuss important settings
and processes that enhance ! Creating Multiple Hierarchies
levels and hierarchies.
! Grouping Members into Levels

Creating levels in dimensions establishes the hierarchical structure of


dimensions. Levels exist in each dimension and determine the detail and
summary data stored in cubes. In this section, you will learn about the
following topics that pertain to levels and hierarchies:
! Advanced settings that apply to levels and dimensions.
! The definition of a hierarchy and how levels define hierarchies.
! The process for creating multiple hierarchies in a dimension.
! The Grouping property that creates member groupings in dimensions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 3

Applying Level Settings


Topic Objective
To describe level settings
and tips for using each of
them effectively. ! Member Count
Lead-in ! Key Data Size
As you click each level in a
dimension, you have an ! Key Data Type
assortment of level
properties available that ! Level Type
enhance various
characteristics of levels. ! Visible

As you click each level in a dimension, you have an assortment of level


Delivery Tip properties available that enhance various characteristics of levels. Each property
Open the Dimension Editor
and give an informal
applies to a level and influences how members in a level are stored and
demonstration, clicking displayed.
through each of the
properties to show students Member Count
how to access properties.
By default, Analysis Manager counts the members of a level when you create
the level. This count is important both for the aggregation design algorithm and
in setting up proper hierarchies.
Performing the count can be time-consuming when defining a large dimension
with many members. Therefore, you have the ability to disable the count for
dimensions. You can disable the count in either of two ways:
! Clear the Count level members automatically check box in the Dimension
Wizard.
! Right-click the server and click Properties. On the General tab, clear the
Enable dimension level counting check box.
You can determine what the count is for any given level of a dimension by
looking at the Member Count property on the Advanced tab of the Properties
pane. If the count is zero, then the count is disabled.
If you disable the count, you do not have the ability to browse the dimension in
the Dimension Editor, and you cannot include the dimension in a cube.
Analysis Manager gives you the option of counting members when the counts
are required. In addition, you can count the members by clicking the Tools
menu and then clicking Count Dimension Members in the Dimension Editor,
or you can manually type in an estimated count for the members in that level.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


4 Module 5: Using Advanced Dimension Settings

Key Data Size


The Key Data Size property records the size in bytes of the columns that store
member keys.
Because dimension storage is typically minimal in Analysis Services, it is
usually unnecessary for you to update the Key Data Size to optimize cube
performance. However, in dimensions containing millions of members, allocate
the lowest satisfactory amount for the Key Data Size of the levels of the
dimensions.

Key Data Type


The Key Data Type property records the data type of the columns that define
member keys. The property is set initially when you create the levels of a
dimension.
If you change the Member Key Column of a particular level, verify that the
Key Data Type updates to the new data type of the column. You receive errors
when processing the dimension if the data type of the Member Key Column
does not match the Key Data Type setting.

Level Type
The Level Type property is set for each level in a dimension and describes the
type of each level. Most of the available settings for the Level Type property
apply to Time dimensions. By default, the Level Type of a level is set to
Regular.
Some examples of level types are the following:
! Years
! Quarters
! Months
! Organizational Unit
! Country
The Level Type property does not affect how the levels of a dimension are
stored or processed. However, some front-end applications use the Level Type
property in presenting levels. In addition, some multidimensional expressions
(MDX) functions use the Time level type when performing calculations such as
year to date and quarter to date totals.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 5

Visible
The Visible property indicates whether a level is visible or not to users as they
browse the cube. By default, the property is True. When the Visible property of
a level is False, users cannot see the level, but MDX statements can access the
level and members of the level.
Change the Visible property of a level to False in the following scenarios:
! You want to use a level in calculations but you do not want users to browse
the level in front-end applications.
! You want to temporarily remove a level of a dimension. You can set the
Visible property to False, and can then change it back to True without
removing the level entirely.
! You want to hide a level created with the Grouping property to overcome
the 64,000 children limitation. In this case, the level exists to overcome the
limitation, and you do not want users to see the fabricated level.

Note The Grouping property is described in detail later in this module.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


6 Module 5: Using Advanced Dimension Settings

Defining a Hierarchy
Topic Objective
To define the term
hierarchy.
! A Hierarchy Is a Set of Members and Levels within a
Lead-in Dimension
The term hierarchy refers to
the set of members in a ! By Default, a Dimension Contains One Hierarchy
dimension and the levels to
which the members belong. ! Analysis Services Supports a Variety of Hierarchies
$ Regular hierarchies, which are balanced
$ Parent-child hierarchies, which are unbalanced
$ Ragged hierarchies, which can occur in both regular and
parent-child hierarchies
! A Dimension Can Contain Multiple Hierarchies

In the Analysis Services documentation and in the common OLAP vernacular,


Delivery Tip the terms dimension and hierarchy are used interchangeably. However, to
Tell students that if they
have created dimensions in
Analysis Server, there is a subtle difference in the meaning of the two terms.
the past, they have already The term hierarchy refers to the set of members in a dimension and the levels to
created hierarchies, possibly
which the members belong. By default, a dimension contains one hierarchy.
without knowing it. When
you create a dimension, you
The default hierarchy is defined when you assigned the levels and the Member
define the default hierarchy Key Columns in a dimension.
for that dimension.
Analysis Services supports a variety of hierarchies, including:
! Regular hierarchies, which are balanced dimensions by definition.
! Parent-child hierarchies, which are unbalanced hierarchies by definition.
! Ragged hierarchies, which are supported in regular and parent-child
hierarchies.
Analysis Services supports multiple hierarchies in a single dimension. In other
words, you can define multiple groupings of members in a single dimension.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 7

Creating Multiple Hierarchies


Topic Objective
To describe how to create Department Dimension
multiple hierarchies in a
single dimension. Department.Region

Lead-in Region 1
Department A
Creating multiple hierarchies Department B
in a dimension is very
straightforward in Analysis Region 2 Two Hierarchies
Department C
Services. Department D
Department.Management
Manager 1
Department A
Department C
Department D
Manager 2
Department B

Explain how the Creating multiple hierarchies in a dimension is very straightforward in Analysis
Department dimension Services. If you have the skills to create multiple dimensions in an OLAP
summarizes the leaf-level database, you have the skills to create multiple hierarchies in a dimension.
members in two
independent ways. To create multiple hierarchies in one dimension, perform the following steps in
the Dimension Wizard:
Ask students if they can
think of a use for multiple 1. For each hierarchy, create a new dimension.
hierarchies in their own 2. At the final step of the wizard, name each dimension and select the Create a
companies.
hierarchy of a dimension check box. Type the hierarchy name and click
Finish. The final name format is DimensionName.HierarchyName.

Note You can create a hierarchy by using the Dimension Editor. Simply
name the dimension with the format DimensionName.HierarchyName.

3. Add the two hierarchies to the cube as if they were separate dimensions.
4. View the hierarchies in the cube. The way the front end displays the
hierarchies depends on the front-end application and how it handles multiple
hierarchies in a dimension.

The two department hierarchies in the slide illustration are named


Department.Region and Department.Management. The Department.Region
hierarchy contains two levels—Region and Department. The
Department.Management hierarchy contains two levels, also—Manager and
Department. Both hierarchies contain the same number of departments.
However, the departments consolidate differently based on their Region and
Manager parents.

Note If you create a dimension name without a period, the dimension has one
unnamed hierarchy.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


8 Module 5: Using Advanced Dimension Settings

Grouping Members into Levels


Large Level
Topic Objective
To describe how to create
intermediate parents to
Grouping Level
group members of a A–G
particular level.
Lead-in
In a dimensional structure,
there can be no more than
64,000 direct children. In All H–O
other words, a single parent
is limited to 64,000 children.

O–Z

In a dimensional structure, there can be no more than 64,000 direct children. In


Delivery Tips other words, a single parent is limited to 64,000 children. Practically speaking,
Be aware that this slide is a
build slide.
many client applications have a difficult time displaying 64,000 direct siblings.
In addition, users do not want to see thousands of children when they drill down
First, introduce the large on a parent.
level that does not contain
higher classification in the Using the Grouping Property
dimension table. Next, build
the Grouping Level, and The level property Grouping solves the potential problem of the 64,000
tell students that the children limitation. Grouping creates intermediate parents in the level. The
Grouping Level can be children are broken into meaningful hierarchies, which makes the members at
created by setting the the level more easily understood by users and eliminates the problem of having
Grouping property, or by more than 64,000 children per parent.
creating expressions in
Member Key and Member
Name Columns.
Note You have no direct control over the number of groups created by
automatic grouping. Automatic grouping creates approximately the same
Tell students that they will number of groups as there are members in each group by using the square root
create both types of levels in of the number of members. This strategy enables grouping to automatically
the upcoming labs. handle dimensions with over four billion members (64,000 groups with 64,000
members each). If you want to control the groups, create expressions for the
Member Key Column and Member Name Column properties.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 9

Using Expressions to Group Members


You can use the flexible nature of the Member Key Column to group
members into separate clusters. You create expressions in the Member Key
Column to derive a hierarchy from a single relational database management
system (RDBMS) column.
For example, suppose you create a customer dimension from visitors to a Web
site. The system does not contain any information about the customer other than
name and e-mail address. In addition, the number of customers exceeds 64,000.
The grouping of the first letter of the customer’s name can be used to add an
arbitrary level to the hierarchy.
The following table contains two columns—the first column contains the first
letter of the customer name, and the second column contains the customer
name. The users see the two-level structure when they drill down into the
Customer dimension.
First letter of name Customer name

C
Castillo
D
Derry
De Carlo
Dumin
H
Hance
Hunt
M
Masters
Mehlert

If your customer table does not contain a column with the first letter of the
customer name, but it does contain the column Customer_Name, you can
create the two-level hierarchy by performing the following steps:
1. Add two levels to the dimension, both based on the Customer_Name
column.
2. In the top level, update the Member Key Column and the Member Name
Column so that they contain the following expression:
Left("Customer"."Customer_Name", 1)

Note The syntax of the expression may vary, depending on the data source
of the dimension.

3. The bottom level uses the Customer_Name column to define the Member
Key Column.
4. When users drill down into the dimension, they see a top level containing
first letters of customer names, and the bottom level containing customers
below each associated letter.
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
10 Module 5: Using Advanced Dimension Settings

# Working with Time Dimensions


Topic Objective
To introduce the concept of
Time dimensions.
Lead-in ! Using the Dimension Wizard to Create Dates
Nearly every OLAP ! Using a Separate Table for Dates
database has a Time
dimension. ! Setting Time Dimension Properties
! Creating a Fiscal Date Hierarchy
! Building a Date Hierarchy from a String

Nearly every OLAP database has a Time dimension. Often, a Time dimension
contains months as the lowest level of detail—aggregated into quarters and
years. Sometimes, a Time dimension contains days at the lowest level of detail.
On occasion, particularly if you are monitoring a manufacturing operation, a
Time dimension has minutes or even seconds as the lowest level of detail.
Whatever the level of detail, a Time dimension has certain unique qualities. In
this section, you will learn about the characteristics of Time dimensions and
how to create them in OLAP cubes.
The following specific topics are covered:
! Creating dates by using the Dimension Wizard.
! Using a separate dimension table for dates.
! Setting Time dimension properties.
! Creating a fiscal date hierarchy.
! Building a hierarchy from a string.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 11

Using the Dimension Wizard to Create Dates


Topic Objective
To describe the benefits of
using the Dimension Wizard
when creating Time ! When Possible, It Is Best Practice to Use the Dimension
dimensions. Wizard When Creating Time Dimensions
Lead-in
The Dimension Wizard can
! Contains Built-In Intelligence
construct an entire hierarchy ! Defines Entire Hierarchy From a Single Date/Time
from a single Date/Time
column.
Column
! Uses Appropriate Functions Depending on Data Source
! Is Available for Modification in the Dimension Editor
After Initially Created

If it is possible with your required Time levels, the best practice is to create a
Key Point new Time dimension by using the Dimension Wizard instead of the Dimension
When you create a new
Time dimension, the best
Editor. The Dimension Wizard constructs an entire hierarchy from a single
practice is to create it by Date/Time column and uses built-in intelligence to define the levels.
using the Dimension Wizard
Any valid SQL statement can be used for the Member Key Column and the
instead of the Dimension
Editor.
Member Name Column. The Dimension Wizard automatically uses
appropriate data source functions in the Member Key and Member Name
Columns to create the levels.
The following table contains expressions that are automatically created for a
SQL Server 2000 data source by using the Dimension Wizard.

Level Key Expression

Year DatePart(year,"dbo"."TimeMonth"."Month")

Quarter DatePart(quarter,"dbo"."TimeMonth"."Month")
Month DatePart(month,"dbo"."TimeMonth"."Month")

After you create a Time dimension in the Dimension Wizard, you can modify it
by using the Dimension Editor. For example, if you want to see the day name as
Month – Day, you can concatenate the month and day expressions in the
Member Name Column of the day level.
The DatePart function used in the preceding example is not a standard
relational database function—it is a function supported by SQL Server and
Microsoft Access. When working with other supported RDBMS sources, the
Dimension Wizard generates a correct expression for that RDBMS.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


12 Module 5: Using Advanced Dimension Settings

Using a Separate Table for Dates


Topic Objective
To explain the benefits of
creating a separate date
dimension table in the cube ! Contains Additional Date Properties
data source.
! Reduces Storage Space
Lead-in
When you design a data ! Is Used with Multiple Fact Tables
warehouse to use with
Analysis Services, it is
generally a best practice to
create a separate dimension
table for dates rather than
use a Date/Time column in
the fact table.

When you design a data warehouse to use with Analysis Services, it is generally
a best practice to create a separate dimension table for dates rather than use a
Date/Time column in the fact table.
As with other dimension tables, you use an integer key to join the date
dimension table with the fact table. Creating a separate date dimension table has
certain advantages over storing a Date/Time column in the fact table.

Contains Additional Date Properties


One advantage of creating a separate date dimension table is that a date
dimension table can contain additional properties for a date, such as the season
for a month or a holiday flag for a day.
In addition, some organizations define fiscal months and quarters by arbitrarily
assigning four weeks to the first two months of a quarter and five weeks to the
third month, or five weeks to the first month of a quarter and four weeks to the
second and third months. In this case, an expression cannot derive the fiscal
month or quarter from a Date/Time column, but a date dimension table could
easily store the fiscal month and quarter values.

Reduces Storage Space


A separate date dimension usually reduces total storage space for a warehouse.
A Date/Time column requires eight bytes, while an integer key typically
requires four bytes. If a fact table contains millions, or even thousands, of
records, the savings from a smaller key column in the fact table more than
offsets the size of a date dimension table containing only a few hundred
records.
In addition, designing and processing a dimension based on a table with only a
few records is much faster than extracting dimension values from a large fact
table.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 13

Is Used with Multiple Fact Tables


A separate date dimension table can be used with more than one fact table. This
allows you to create a single, shared date dimension for multiple cubes. A
shared dimension allows you to create a virtual cube to compare measures from
multiple cubes.

Note For more information about virtual cubes, see module 12, “Working with
Virtual Cubes,” in course 2074A, Designing and Implementing OLAP Solutions
with Microsoft SQL Server 2000.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


14 Module 5: Using Advanced Dimension Settings

Setting Time Dimension Properties


Topic Objective
To describe Time dimension
properties and explain why
they are used in cubes. ! Some MDX Functions Use Time Dimension Properties
Lead-in ! Third-Party Products Use Time Properties
By flagging certain
dimensions as Time, and ! Several Time Dimension Level Properties Exist
certain levels in a dimension
as specific units of time, you ! The Type Property Has No Effect on the Analysis Server
can take advantage of time-
intelligent MDX functions.

Time periods typically occur in regular intervals. Each hour contains 60


minutes, each day contains 24 hours, each quarter contains 3 months, each year
contains 4 quarters, and so forth.
This repetitive nature of time periods encourages certain standard analysis
questions such as:
! How does the current month compare to the same month of last year?
! How does the current quarter compare to the prior quarter?
The MDX language contains functions that make it easy to answer these types
of questions. By flagging certain dimensions as Time, and certain levels in a
dimension as specific units of time, you can take advantage of these time-
intelligent MDX functions.
Many user interface products from third parties take advantage of Analysis
Services Time dimension and level properties. Depending on the product, Time
dimensions display differently than other dimensions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 15

In addition to the Time dimension type, the following types are available for
levels in Time dimensions:
! Years
! Half-Years
! Quarters
! Months
! Weeks
! Days
! Hours
! Minutes
! Seconds
! Time-Undefined
The Type property of a dimension and the Level Type property of a level are
significant only when dealing with a Time dimension. Even in a Time
dimension, these properties are not critical.

Note The Type property of a dimension or a level has no direct effect on the
Analysis Server. The Type property is available for a client application to
inspect and for certain MDX functions. However, the server does not behave
differently when a dimension or level has a Time value for the Type property.
You can change the Type property of a Time dimension to Standard or that of
a Product dimension to Time. It does not matter to the server.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


16 Module 5: Using Advanced Dimension Settings

Creating a Fiscal Date Hierarchy


Topic Objective
To describe the need for
fiscal date hierarchies.
Lead-in ! May Not Begin on January 1
One irregularity that ! Is Used for Internal Reporting Purposes
frequently arises when
dealing with time is that ! Causes the Need for Multiple Hierarchies within a Time
many organizations use a Dimension
fiscal year—when the
starting day of the year is $ Fiscal date hierarchy
not January 1.
$ Calendar date hierarchy

One irregularity that frequently arises when dealing with time is that many
Delivery Tips organizations use a fiscal year in which the starting day of the year is not
Tell students that they will
be creating a fiscal
January 1.
hierarchy in the lab. Sometimes, a company uses a fiscal year for internal reporting purposes but
must still use a calendar year when communicating with customers. The same
Ask students if they use
multiple time hierarchies in
lowest level data—for example, March 1, 2000—could be the first month of a
their own reporting systems. fiscal year and the third month of the calendar year.
To choose which way to display that lowest level date, you must use two
different hierarchies. Analysis Services allows you to define separate
hierarchies when you create the dimension. Because you cannot rename an
existing shared dimension, you must plan for multiple hierarchies before
creating the dimension.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 17

Building a Date Hierarchy from a String


Topic Objective
To describe the issue of
using strings to define Time
dimensions. ! May Not Be Able to Create New Tables within the Data
Lead-in Warehouse
You do not always have
control over the source
! Can Use Dates Stored as Strings
relational database ! Can Use Expressions to Define Time Dimensions
management system
(RDBMS) that defines the
dimensions and cubes.

You do not always have control over the source RDBMS that defines the
Delivery Tips dimensions and cubes. Often, you are provided with the data warehouse and
For more information about
using expressions to define
you must work with it without having the flexibility of creating new tables to
dimensions, see module 4, define dimensions and cubes.
“Building Dimensions Using
When building a Time hierarchy from a Date/Time column, you can use
the Dimension Editor,” in
course 2074A, Designing
Analysis Manager’s built-in date intelligence to define Time dimension levels
and Implementing OLAP and members. However, in many systems, dates are stored as strings and no
Solutions with Microsoft Date/Time columns exist from which to define Time dimension levels.
SQL Server 2000.
When you only have string columns to build Time dimensions, you can use
Tell students that they will expressions in the Member Key Column and Member Name Column to
be creating a Time define the levels and members. In addition, you can update the dimension and
dimension by using level Type properties to specify the Time dimensions.
expressions in the lab.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


18 Module 5: Using Advanced Dimension Settings

Lab A: Creating Time Dimensions


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will use the
Dimension Wizard and the
Dimension Editor to create
Time dimensions.

Objectives
Explain the lab objectives. After completing this lab, you will be able to:
! Create a Time dimension by using the Dimension Wizard.
! Add a hierarchy to an existing dimension.

Prerequisites
Before working on this lab, you must have:
! Experience working with the Dimension Editor.
! An understanding of dimension, level, and member properties.

Estimated time to complete this lab: 15 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 19

Exercise 1
Creating the Time.Calendar Dimension
In this exercise, you will create a calendar Time dimension hierarchy by using
the Dimension Wizard to define levels. You will also see how the Dimension
Wizard uses expressions in the Member Name Column and Member Key
Column properties to create a hierarchy from a single date value.

! 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\L05\Module
05.CAB, click Open, and then click Restore.
2. After the database successfully restores, click Close.
3. Double-click Module 05 to expand the database.
4. Below Module 05, double-click Data Sources, right-click the Module 05
data source, and then click Edit.
5. Click the Connection tab of the Data Link Properties dialog box, and then
verify that localhost is selected in step 1.
6. In step 2, click Use Windows NT Integrated security.
7. In step 3, click Module 05 from the Select the database on the server list.
8. Click Test Connection and verify that the test succeeded, click OK, and
then click OK to close the Data Link Properties dialog box.

! To create the Time dimension


1. In Analysis Manager, beneath Module 05, right-click the Shared
Dimensions folder, point to New Dimension, and then click Wizard.
2. Click Next, click Star Schema: A single dimension table, and then click
Next.
3. Click the TimeMonth table, and then click Next.
4. Click Time dimension, and then click Next.
5. In the Select time levels list, click Year, Quarter, Month, and then click
Next. Click Next to skip the Select advanced options step.
6. Type Time as the name of the dimension, select the Create a hierarchy of
a dimension check box, and then type Calendar in the Hierarchy name
box that appears.
7. Click Finish to create the dimension.
The Dimension Wizard leaves you in the Dimension Editor with a new
dimension named Time.Calendar. Because the wizard already created and
saved the dimension, you cannot change its name in the Properties pane.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


20 Module 5: Using Advanced Dimension Settings

! To view the Time dimension


1. In the Dimension Editor, browse the Time.Calendar dimension in the Data
pane.
2. Click the Time.Calendar dimension in the dimension tree, and then click
the Advanced tab in the Properties pane.
The value of the Type property is Time.
3. Change the name of the Year level to Calendar Year, the name of the
Quarter level to Calendar Quarter, and the name of the Month level to
Calendar Month.
4. Click the Advanced tab and notice the value of the Level Type property as
you click the various levels.
The Dimension Wizard sets the value of each Level Type to match the type
of time data stored in the level.
5. Click the Calendar Year level, and then click the Basic tab of the
Properties pane. Compare the values of the Member Key Column and the
Member Name Column properties.
Both are the same, and both contain the expression that extracts the four-
digit year from a Date/Time column:
DatePart(year,"dbo"."TimeMonth"."Month")

6. Click the Calendar Month level, and compare the values of the Member
Key Column and the Member Name Column properties.
The expression for the Member Key Column is:
DatePart(month,"dbo"."TimeMonth"."Month")

The expression for the Member Name Column is:


convert(CHAR, DateName(month,"dbo"."TimeMonth"."Month"))

7. Click the Calendar Quarter level, and look at the expression for the
Member Name Column.
'Quarter ' + convert(CHAR,
DatePart(quarter,"dbo"."TimeMonth"."Month"))

8. Change the expression in the Member Name Column to display only Qtr
as a prefix instead of Quarter. Press ENTER, and then browse the dimension
to see the revised member names.
9. Click Save, and then close the Dimension Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 21

Exercise 2
Creating the Time.Fiscal Dimension
In this exercise, you will create a fiscal year hierarchy by using the Dimension
Wizard to define the levels and members. This hierarchy, when added to a cube
containing the Time.Calendar hierarchy, will give you another way to
summarize monthly data. You will perform the same steps in as in Exercise 1,
but will give this hierarchy the name required to include the hierarchy in the
existing Time dimension.

! To create the Time.Fiscal dimension


1. In Analysis Manager, beneath Module 05, right-click the Shared
Dimensions folder, point to New Dimension, and then click Wizard.
2. Click Next, click Star Schema: A single dimension table, and then click
Next.
3. Click the TimeMonth table, and then click Next.
4. Click Time dimension and then click Next.
5. In the Select time levels list, click Year, Quarter, Month.
6. Click March as the starting month for the year, and then click Next twice.
7. Type Time as the name of the dimension, select the Create a hierarchy of
a dimension check box, and then type Fiscal in the Hierarchy name box
that appears.
8. Click Finish to create the dimension.
This creates a second hierarchy for the Time dimension.

! To update the Time.Fiscal dimension


1. In the Dimension Editor, browse the Time.Fiscal dimension in the Data
pane.
2. Click the Time.Fiscal dimension in the dimension tree, and then click the
Advanced tab in the Properties pane. Change the Type property to
Standard.
You want to make the Time.Calendar hierarchy the default Time
hierarchy. Therefore, you set the Time.Fiscal dimension type to Standard.
3. Change the name of the Year level to Fiscal Year, the name of the Quarter
level to Fiscal Quarter, and the name of the Month level to Fiscal Month.
4. In the Dimension Members pane, expand All Time, 2001, and Quarter 4.
The months of the quarter appear, with December correctly preceding
January.
5. Click Save to save the Time.Fiscal dimension, and then close the
Dimension Editor to return to the Analysis Manager console view.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


22 Module 5: Using Advanced Dimension Settings

Lab B: Creating Hierarchies from Single Columns


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will use
expressions and the
Grouping property to create
multilevel hierarchies from
single columns.

Objectives
Explain the lab objectives. After completing this lab, you will be able to:
! Create a Time dimension by using the Dimension Editor and expressions.
! Creating a level by using the Grouping property.

Prerequisites
Before working on this lab, you must have:
! Experience working with the Dimension Editor.
! An understanding of dimension, level, and member properties.

Lab Setup
To complete this lab, you must first complete lab A, Creating Time
Dimensions, found earlier in the module.

Estimated time to complete this lab: 25 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 23

Exercise 1
Creating the TextTime Dimension
In this exercise, you will create a Time dimension by using the Dimension
Editor to create the hierarchy of levels. By using a text column instead of a
Date/Time column, you will define three time levels. You will update the
Member Key Column and the Member Name Column and will use various
SQL Server string functions. Finally, you will update the appropriate dimension
and level properties, defining the dimension as a Time dimension.

! To create the TextTime dimension


1. In Analysis Manager, beneath Module 05, create a new dimension by using
the Dimension Editor.
2. Click TextTime in the Choose a Dimension Table dialog box and then
click OK.
3. Name the dimension TextTime.
4. In the Schema pane, browse the data in the TextTime table. Notice the one
column text-based format.
You will define three new levels based on the column. The level names are
Year, Quarter, and Period.
5. Close the Browse Data window.

! To create three dimension levels


1. In the TextTime table, double-click the Date column three times.
Notice the three levels in the TextTime dimension tree: Date, Date 1, and
Date 2. Analysis Services automatically adds integers to the end of a level
name having the same name as another level.
2. From the top level to the bottom level, rename the levels Year, Quarter,
and Period.
3. In the Data pane, preview the dimension and expand the dimension to the
Period level.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


24 Module 5: Using Advanced Dimension Settings

! To update the Year level


1. Using the Left string function, update the Member Name Column of the
Year level to extract the four leftmost characters from the column.
Use the following expression in the Member Name Column:
Left("dbo"."TextTime"."Date", 4)

2. Press ENTER. Notice the error you receive when attempting to browse the
dimension in the Data pane.
Why is the expression causing an error in the dimension?
The Year level is created from the Member Key Column. After the
Member Key Column builds the level, the Member Name Column
attempts to name every member in the level. When the Member Key
Column is defined as "dbo"."TextTime"."Date", the Year level
contains 24 members, because the Date table contains 24 distinct records.
Twelve of the members are periods found in 2000 and the other twelve
members are periods found in 2001.
When the Member Name Column attempts to name the 24 members by
using the expression Left("dbo"."TextTime"."Date", 4), it extracts
the first four characters of each member. The characters are either 2000 or
2001, depending on the year of the period. Because the Year level members
have one parent, All TextTime, all members must be unique at the level.
Therefore, applying the expression to the Member Name Column causes
you to receive the uniqueness error, due to the level containing twelve 2000
members and twelve 2001 members.
3. Change the Member Name Column to the original value,
“dbo”.”TextTime”.”Date”, by copying and pasting the expression from
the Member Key Column.
4. Preview the dimension in the Dimension Members pane. Notice the 24
members in the Year level.
5. Update the Member Key Column of the Year level with the following
expression:
Left("dbo"."TextTime"."Date", 4)

6. Preview the dimension. Notice the two members and their member names.
The level contains two members—one beginning with 2000 and the other
beginning with 2001. However, the member names do not reflect the new
expression. Why is the member name incorrect?
The Member Name Column is still basing the member name directly from
the Date column. Therefore, you must update the Member Name Column
value also.
7. Update the Member Name Column with the expression
Left("dbo"."TextTime"."Date", 4) by copying and pasting the
expression from the Member Key Column.
8. Preview the dimension and notice the correct member names.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 25

! To update the Quarter level


1. Browse the TextTime table to determine the position of the Quarter
characters.
2. Using the Right string function, determine the expression that you will use
to update the Quarter level Member Key Column and Member Name
Column.

Tip The Right string function returns the part of a character string starting
a specified number of characters from the right. The format of the Right
string function is Right (character_expression, integer_expression).

Right("dbo"."TextTime"."Date", 2)
____________________________________________________________

3. Update the Member Key Column and Member Name Column, and then
preview the dimension to verify that the member names are correct at the
Quarter level.
You should see Q1, Q2, Q3, and Q4 beneath the Year members 2000 and
2001.

! To update the Period level


1. Using the Substring function, update the Member Key Column and the
Member Name Column of the Period level to extract the two period
characters from the column.
Use the following expression in the Member Key Column and the
Member Name Column:
Substring("dbo"."TextTime"."Date", 6, 2)

2. In the Dimension Members pane, preview the dimension and expand the
dimension to the Period level. Notice the member names, 01 through 12, in
both years.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


26 Module 5: Using Advanced Dimension Settings

! To finish the TextTime dimension


1. Notice the Quarter level members and the Period level members in the two
years.
Currently, the members in the Quarter and Period levels are not unique.
For example, both of the years 2000 and 2001 contain Q1, Q2, and so on.
To ensure that users of the cube are not confused when viewing quarters and
periods, you will update the Quarter and Period members so that they
designate the proper year.
2. On the Basic tab, update the Member Name Column for the Quarter and
Period levels by adding the following to the beginning of each column’s
expression:
Left("dbo"."TextTime"."Date", 4) + ' - ' +

For example, the Quarter level Member Name Column will use the
following expression:
Left("dbo"."TextTime"."Date", 4) + ' - ' +
Right("dbo"."TextTime"."Date", 2)

3. Change the Member Names Unique properties to True for the Quarter
and Period levels.
4. Preview the dimension in the Dimension Members pane, expanding the
dimension to the Period level.
5. Change the dimension Type property from Standard to Time.
6. Change the Year, Quarter, and Period Level Type properties to Years,
Quarters, and Months, respectively.
7. Change the dimension All Level property value to No.
8. Preview the dimension in the Dimension Members pane.
9. Save the dimension and then close the Dimension Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 27

Exercise 2
Creating the Grouping_Customer Dimension
In this exercise, you will create a dimension with two levels from one column,
Customer_Name. You will create a cube that uses a single table as both the
fact table and the dimension table. The table contains sales dollars and sales
units for customers, but does not contain any means for classifying those
customers. To make the customer dimension simple to navigate, you will use
the Grouping property to create a grouping level.

! To create a new cube


1. In Analysis Manager, beneath Module 05, right-click the Cubes folder,
point to New Cube, and then click Editor.
2. Click the Grouping_Customer table, click OK, and then click Yes to count
the fact table records.
The Grouping_Customer table acts as the fact table and the dimension
table for the cube.
3. In the Cube Editor, drag Sales_Dollars and Sales_Units to the Measures
folder.
4. Drag the Customer_Name column to the Dimensions folder.
Customer Name is a private dimension in the new cube, containing one
level, Customer Name.
5. Drag the Customer_Name column on top of the Customer Name
dimension, adding another level to the dimension.

! To update the Customer Name dimension


1. In the dimension tree, expand the Customer Name dimension, and notice
the two levels, Customer Name and Customer Name 1.
2. Rename the Customer Name dimension Grouping Customer.
3. Rename the Customer Name and Customer Name 1 levels Customer
Group and Customer, respectively.
4. Click the Customer Group level, click the Advanced tab of the Properties
pane, change the Grouping property value to Automatic, and then press
ENTER.
5. Click Yes to accept the changes to the dimension that enable dimension
level grouping.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


28 Module 5: Using Advanced Dimension Settings

! To process the cube and browse results


1. From the Tools menu, click Process Cube.
2. Click Yes to save the cube, name the cube Grouping Cube, and then click
OK.
3. Click No to avoid the design of aggregations, and then click OK to process
the cube.
4. After the cube finishes processing, in the Process dialog box, click Close.
5. Click the Data tab in the Schema pane.
6. Browse the cube, drilling down into the Grouping Customer dimension.
Notice the groups automatically created at cube processing. The customers
are grouped in customer sections and provide users with an easy way to
navigate the several thousand customers.
7. Close the Cube Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 29

# Creating Custom Rollups


Topic Objective
To introduce the concept of
custom rollups.
Lead-in ! Using Custom Rollup Operators
Analysis Services provides ! Creating Custom Rollups
many tools that simplify the
modeling of financial
applications.

Many companies build financial applications that use OLAP technology.


Typical OLAP financial applications include financial reporting, financial
consolidations, forecasting, and budgeting.
Analysis Services provides many features that simplify the modeling of
financial applications. The most important of these features is the ability to
define calculations based on a calculation hierarchy.
This section defines and describes custom rollups and how they are used to
model hierarchical calculations in dimensions. The following topics are
discussed:
! Using custom rollup operators.
! Creating custom rollups.
!

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


30 Module 5: Using Advanced Dimension Settings

Using Custom Rollup Operators


Topic Objective
To introduce the use of
unary operators and custom
rollups in dimensions.
Lead-in
A very important feature of
Analysis Services is the
ability to model financial
calculations easily in a
dimension.

An important feature of Analysis Services is the ability to model financial


Delivery Tip calculations easily in a dimension. A hierarchy in a dimension has two
After explaining the
calculation logic of unary
purposes:
operators, quiz students on ! It defines the drill-down path for users to analyze data.
the calculation definitions in
the preceding illustration. ! It defines the calculations applied to each of the members in relation to one
another.
You can create specialized hierarchical paths known as Custom Rollups. You
define Custom Rollups by using Custom Rollup Operators.
For example, to properly aggregate values in the Account dimension in the
preceding illustration, each member of the dimension requires its own
aggregation rule:
! The rule for Net Sales is to add its value to its siblings’ values to create the
value for Net Income.
! The rule for Total Expense is to subtract its value from Net Sales to create
the value for Net Income.
! The rule for Assets is to ignore its value in its parent’s aggregation.
Include a column in the dimension table that specifies a unique rule for each
member. The aggregation rule consists of a single-character code, called a
unary operator. The unary operators are simple arithmetic operators.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 31

The following table lists unary operators and their behaviors with siblings.
Operator Behavior

Plus (+) The member value is added to the total value of the above siblings.
Minus (-) The member value is subtracted from the total value of the above
siblings.
Asterisk (*) The member value is multiplied by the total value of the above
siblings.
Slash (/) The total value of the above siblings is divided by the member
value.
Tilde (~) The member value is ignored for aggregation purposes.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


32 Module 5: Using Advanced Dimension Settings

Creating Custom Rollups


Topic Objective ! Change Unary Operators Property to True
To describe the process of
creating custom rollups. ! Define a Dimension Table Column that Provides Custom
Lead-in
Rollup Operators
When you create ! Order Members to Define the Calculation Order
dimensions that contain
custom rollups, a series of ! Update Unary Operator Column with Custom Rollup
settings is applied to the Operators
dimension to enable the
rollups. $ In Dimension Editor, if write-enabled
$ In source database, if not write-enabled
! Can Be Enabled within Shared and Private Dimensions
! Do Not Work in a Cube Using the Distinct Count
Aggregate Function

When you create dimensions that contain custom rollups, you apply a variety of
Key Point settings to enable the rollups and to conform to special conditions. The settings
Write-enabled dimensions
are parent-child dimensions
are as follows:
that allow users to update ! You set the level property Unary Operators to True to enable custom
the contents of a dimension
rollups in a dimension. You can find this property on the Advanced tab of
and see immediate results
in their cubes. For more
the Properties pane in the Dimension Editor. The property is also available
information on write-enabled in the Dimension Wizard when you create a parent-child dimension.
dimensions, see SQL ! After setting the Unary Operators property to True, you define the column
Server Books Online. where the Custom Rollup Operators are found. Either the Unary Operator
column already exists in the dimension table, or you create a new column
that acts as the Unary Operator column.
If the column is created in Analysis Manager, you must have write-access to
the dimension table in the source data warehouse.
! The order of the unary calculations is based on the order of members in the
specified level. Therefore, it is important that you determine not only the
correct unary operators for each member, but also the order that the
calculations perform in the dimension level. Order the members
accordingly.
! The Unary Operator column must contain the appropriate custom rollup
operators. You define the operators either through the Dimension Editor if
the dimension is write-enabled, or through updating the column outside of
Analysis Manager if the dimension is not write-enabled.

Note Write-enabled dimensions are parent-child dimensions that allow


users to update the contents of a dimension and see immediate results in
their cubes. For more information on write-enabled dimensions, see SQL
Server Books Online.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 33

! You can create custom rollups in shared and private dimensions.


! If you use the Discount Count aggregate function for a measure in the
cube, you cannot incorporate a dimension that uses custom rollups in the
same cube. However, you can create any calculated member in a cube that
contains custom rollup dimensions.

Note For more information on calculated members, see module 11,


“Implementing Calculations Using MDX,” in course 2074A, Designing and
Implementing OLAP Solutions with Microsoft SQL Server 2000.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


34 Module 5: Using Advanced Dimension Settings

Lab C: Creating a Custom Rollup


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will create a
dimension containing profit
and loss by using a custom
rollup.

Explain the lab objective. Objectives


After completing this lab, you will be able to create a parent-child
dimension that contains a custom rollup.

Prerequisites
Before working on this lab, you must have:
! Experience working with the Dimension Wizard and the Dimension Editor.
! Knowledge about parent-child dimensions.

Lab Setup
To complete this lab, you must first complete:
! Lab A, Creating Time Dimensions, found earlier in the module.
! Lab B, Creating Hierarchies from Single Columns, found earlier in the
module.

Estimated time to complete this lab: 10 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 35

Exercise 1
Creating the Account Dimension
In this exercise, you will create a parent-child dimension that contains a custom
member rollup. You will begin by creating the dimension in the Dimension
Wizard and then finish by updating properties in the Dimension Editor.

! To create the Account dimension


1. In Analysis Manager, beneath the Module 05 database, right-click the
Shared Dimensions folder, point to New Dimension, and then click
Wizard.
2. Click Next to skip the welcome page.
3. Click Parent-Child to define the dimension type, click Next, click the
Account table, and then click Next.
4. In the Member key list, click Account_ID. In the Parent key list, click
Parent_ID.
5. In the Member name list, click Account, and then click Next twice.
6. Type Account as the name of the dimension, and then click Finish to open
the Dimension Editor.

! To update the Account dimension


1. In the Dimension Editor, click the Data tab to browse the Account
dimension. Drill down to the bottom of the Account dimension.
2. Notice the drill-down path and determine the calculations currently applied
to each of the members.
Because you have not yet defined a custom rollup, all members aggregate to
their parents. For example, Net Profit is equal to Expenses plus Gross
Profit.
In addition, All Account has only one child, Net Profit. The All Account
member is redundant and should be disabled.
3. In the dimension tree, click the Account dimension, click the Advanced tab
of the Properties pane, and then change the All Level property to No.
4. Click the Type property, and then click Accounts in the list.

Note The dimension type has no effect on the Analysis Server, but a client
application may take advantage of the information when it presents the
dimension to users.

5. In the Dimension Members pane, notice the order of members in the


hierarchy.
How are members sorted in each level?
Members are sorted alphabetically based on the Member Name Column.
Because unary calculation order is based on member order, you will update
the Sort Order property to sort members based on the Member Key
Column, which defines the proper calculation order.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


36 Module 5: Using Advanced Dimension Settings

6. In the Dimension tree, expand the Account dimension, and then click the
Account Id level. Change the level’s Order By property to Key and then
press ENTER.
7. Browse the dimension in the Dimension Members pane. Notice the member
order, which is now sorted by Account Id.

! To use custom rollup operators


1. In the Dimension Editor, click the Schema tab at the bottom of the
Dimension Members pane.
2. Right-click the top of the Accounts table, and then click Browse Data.
3. In the Operator column, browse the field values. Notice the unary operators
that exist for each Accounts member.
The unary operators define the calculation requirements for each Accounts
member.
4. Close the Browse Data window.
5. In the dimension tree, click the Account Id level, and then scroll to the
bottom of the Advanced tab of the Properties pane. Click the Unary
Operators property, and then click the ellipsis (…) button.
6. Select the Enable unary operators check box, click Use an existing
column, click Operator from the Existing column list, and then click OK.
7. Click the Data tab to browse the Account dimension. Drill down to the
bottom of the Account dimension and notice the newly created unary
operators that define the calculation logic of the members.
8. Click Save and then close the Dimension Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 37

# Introducing Member Properties


Topic Objective
To introduce the concept of
member properties.
Lead-in ! Defining Member Properties
In this section, you will learn ! Describing Member Properties
about member properties
and how to define them in ! Using Member Properties
dimensions.

Dimension tables contain attributes that describe members. For example, a


clothing product table might include clothing descriptors, such as size, color,
and department.
Member properties give you the opportunity to use these member attributes to
enhance analysis. In this section, you will learn about member properties and
how to define them in dimensions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


38 Module 5: Using Advanced Dimension Settings

Defining Member Properties


Topic Objective
To provide an overview of
member properties.
Lead-in ! Dimension Member Attributes
A member property is an ! Information Needed for Analysis that Does Not Make
attribute associated with
members of a given
Sense as a New Dimension or Level
dimension level. ! A Starting Point for Creating Virtual Dimensions

A member property is an attribute associated with members of a given


dimension level.
Consider a Product dimension table containing six columns:
! Movie_ID
! Movie_Name
! Genre
! Lead_Actor
! Lead_Actress
! Length
The Lead_Actor, Lead_Actress, and Length columns might be interesting to
users, but not interesting enough to warrant new dimensions or new levels in
existing dimensions. You can incorporate this type of information into an
OLAP cube in the form of member properties.
From member properties come virtual dimensions, which expose member
properties to client applications, acting as if they were actual members in a
standard dimension.

Note Virtual dimensions are described in detail later in this module.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 39

Describing Member Properties


Topic Objective
To define characteristics of
member properties.
! Come from a Column in the Same Dimension Table as
Lead-in the Members
A member property is an
attribute of a dimension ! Do Not Affect Cube Size
member. It provides cube
users with added ! Do Not Significantly Affect Cube Processing Times
information about the
member and with the ability ! Do Not Affect Query Performance for Queries that Do
to perform special-case Not Reference Them
analysis without affecting
cube size. ! Are Used in MDX Queries for Analysis
! Are Stored in Dimension Structure Files

A member property is an attribute of a dimension member. It provides cube


Key Point users with added information about the member and with the ability to perform
Member properties do not
significantly affect the
special-case analysis without affecting cube size.
performance of cube and The following are characteristics of member properties:
dimension processing
operations. ! Values for member properties must come from a column in the same
dimension table as the associated members.
! Member properties do not affect cube size.
! Member properties do not significantly affect the performance of cube and
dimension processing operations.
! Member properties do not affect query performance for queries that do not
reference them.
! You can use member properties in MDX queries, providing additional
analytical options.
! Regardless of storage mode, Analysis Server stores member properties in
the dimension structure files. Accordingly, the sizes of these files are
impacted.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


40 Module 5: Using Advanced Dimension Settings

Using Member Properties


Topic Objective
To explain the mechanics of
working with member
properties. ! Associating Member Properties with Levels
Lead-in ! Creating Member Properties
Member properties are
associated with dimension ! Previewing Member Properties
levels. You create them in
the Dimension and Cube ! Using SQL Expressions
Editors.

Member properties are associated with dimension levels, and you create them in
the Dimension and Cube Editors. The interfaces for creating member properties
are simple and straightforward.

Associating Member Properties with Levels


It is important to note that you define member properties for a specific level in a
hierarchy. The definition of a member property applies to all members of that
level.
A level can have more than one member property associated with it. However,
for each member property, a one-to-one relationship must exist between the
member and the member property value. It is important that you understand this
constraint before attempting to create member properties by using denormalized
dimension tables.

Caution Before creating a member property in a dimension level containing


non-unique members, verify that each member has only one member property
value per member property. If you associate a member property with the wrong
level, the Dimension Editor does not give you an error, but the member
property data will be incorrect.

Delivery Tip Creating Member Properties


Use the Dimension Editor to
You create member properties in the Dimension Editor for shared dimensions,
demonstrate the simple
steps of creating member
and in the Cube Editor for private dimensions.
properties. Perform the following steps to create a member property:
1. In the dimension tree, expand the appropriate level. The Member properties
folder appears.
2. Right-click the Member properties folder, click New Member Property,
click the column defining the member property, and then click OK.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 41

Previewing Member Properties


When you preview dimension data for a dimension with member properties
defined for one or more levels, a Member properties pane displays. It shows
member properties for the selected member. You can also preview member
properties in the cube browser by right-clicking members.

Using SQL Expressions


As with all other cube objects that have a source column property, you can enter
SQL expressions as source columns for member properties. These are the
conditions:
! The column must come from the same dimension table as the level
members.
! The expression is passed to the source RDBMS and must be valid for that
particular RDBMS.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


42 Module 5: Using Advanced Dimension Settings

Lab D: Creating Member Properties


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will create
two member properties in
the Product dimension.

Explain the lab objectives. Objectives


After completing this lab, you will be able to:
! Create member properties in dimensions.
! Preview member properties.

Lab Setup
To complete this lab, you must first complete:
! Lab A, Creating Time Dimensions, found earlier in the module.
! Lab B, Creating Hierarchies from Single Columns, found earlier in the
module.
! Lab C, Creating a Custom Rollup, found earlier in the module.

Estimated time to complete this lab: 10 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 43

Exercise 1
Creating Product Dimension Member Properties
In this exercise, you will create two member properties, Price and Category
Manager. They exist at separate levels in the Product dimension. You will
create and preview the member properties in the Dimension Editor.

! To create the Price member property


1. In Analysis Manager, expand Module 05, expand the Shared Dimensions
folder, right-click Product, and then click Edit.
2. In the dimension tree, expand the Product level so that the Member
properties folder appears below it.
The member property Brand Name exists for the Product level. You will
add another member property to the level.
3. Drag the Price column from the Product table onto the Member properties
folder for the Product level.
4. Click the Data tab, and in the Dimension Members pane, expand All
Product, Bread, and Bagels. Click the 1218 – Bagels member to see its
price displayed in the Member properties pane.
You can now reference Price values in cube calculations. By adding Price
as a member property, you can use its values in the cube even though it does
not exist in the cube fact table.

! To create the Category Manager member property


1. In the dimension tree, click the Subcategory level.
2. On the Insert menu, click Member Property.
3. In the Insert Member Property dialog box, double-click
Category_Manager.
4. In the Dimension Members pane, expand the All Product and Bread
members, and then click Bagels.
You can see the manager name Sheri Nowmer in the Member properties
pane.
5. Click Save to save the Product dimension.
6. Close the Dimension Editor.

Note You can create a member property at any level. A member property
applies to the single level. If products and families also had managers, you
would need to create a separate member property for each level.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


44 Module 5: Using Advanced Dimension Settings

# Understanding Virtual Dimensions


Topic Objective
To introduce the concept of
virtual dimensions.
Lead-in ! Defining Virtual Dimensions
A virtual dimension is a ! Placing Virtual Dimensions in Cubes
logical dimension based on
either a member property of ! Using Virtual Dimensions
another dimension or a level
in a dimension.

A virtual dimension is a logical dimension based on either a member property


of another dimension or a level in a dimension. You create virtual dimensions
to reduce cube storage and to reduce cube processing time.
In this section, you will learn about virtual dimensions and their use in cubes.
The following topics will be discussed:
! Defining virtual dimensions
! Placing virtual dimensions in cubes
! Using virtual dimensions

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 45

Defining Virtual Dimensions


Topic Objective
To define virtual dimensions
and their characteristics.
Lead-in ! Are Based on Levels and Member Properties of Other
Let us discuss some Dimensions
characteristics of virtual
dimensions.
! Appear as Regular Dimensions to Users
! Can Contain Multiple Levels
! Can Contain Member Properties
! Do Not Have Aggregations
! Do Not Increase Cube Storage and Processing Time
! Increase Query Times for Queries that Reference Them

When deciding on dimension types for the cubes, you must understand the
benefits of using virtual dimensions versus regular dimensions. The following
are characteristics of virtual dimensions:
! Virtual dimensions are based on member properties and levels of physical
dimensions.
! From the user’s point of view, a virtual dimension is no different from a
physical dimension. Users view and manipulate virtual dimensions just like
any other dimension.
! Virtual dimensions can contain multiple levels defined in their structure.
! Virtual dimensions can contain member properties associated with their
levels.
! Analysis Services does not create aggregations for virtual dimensions.
! Virtual dimensions do not affect cube storage or cube processing time.
! Virtual dimensions increase query times for queries that reference them.
This is because aggregations are not created for virtual dimension members
at cube processing time. However, virtual dimensions do not affect queries
that do not reference them.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


46 Module 5: Using Advanced Dimension Settings

Placing Virtual Dimensions in Cubes


Topic Objective
To define a few
requirements associated
with adding a virtual ! The Member Property Must Exist Prior to Creating the
dimension to a cube. Virtual Dimension
Lead-in
The process of creating
! The Source Dimension Must Exist within the Cube
virtual dimensions and ! Virtual Dimensions Are Added in the Same Way as
adding them to cubes is
simple if you are aware of a
Regular Dimensions
few related issues.

The process of creating virtual dimensions and adding them to cubes is


uncomplicated if you are aware of a few related issues:
! Before you can create a virtual dimension based on a member property, the
member property must exist. You create member properties in the
Dimension Editor for shared dimensions and in the Cube Editor for private
dimensions.
! You cannot add a virtual dimension to a cube unless the source dimension
that supplies the member property or level is also included in the cube.
! You add virtual dimensions to cubes in the same way you add physical
dimensions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 47

Using Virtual Dimensions


Topic Objective
To describe situations in ! When to Create a Virtual Dimension
which you create a virtual
$ Cube processing times are a problem
dimension versus situations
in which you create a $ Cube storage is a problem
regular dimension.
$ A minority of users require a dimension
Lead-in
Virtual dimensions are very ! When to Create a Regular Dimension
useful, but may not always
provide the best solution for $ Cube processing times are not a problem
the users.
$ Cube storage is not a problem
$ Query times must be fully optimized
$ The dimension requires features not available in virtual
dimensions

Virtual dimensions are very useful, but may not always provide the best
Delivery Tip solution for the users. You must determine the most optimal situations in which
Use this slide to summarize
the discussion of virtual
to use virtual dimensions in cubes.
dimensions. Students
should understand when to When to Create a Virtual Dimension
use and when not to use
The following list describes situations in which you create a new virtual
virtual dimensions in a cube.
dimension for the cube:
! Cube Processing Times Are a Problem. You can reduce cube processing
times by using virtual dimensions instead of regular dimensions. No data or
aggregations are produced for virtual dimensions and therefore cube-
processing times are not impacted by the addition of virtual dimensions to
the schema of a cube.
! Cube Storage Is a Problem. Virtual dimensions do not add data or
aggregations to a cube. Therefore, the addition of a virtual dimension to the
cube schema does not affect cube size.
! A Minority of Users Require a Dimension. If only a few users need to see
information by a particular variable—for example, customer data by
gender—then that variable is a good candidate for a virtual dimension.
Virtual dimensions can cause slow queries, depending on the number of
members found in the virtual dimension and on the number of members in the
source dimension. However, the only queries impacted by virtual dimensions
are those queries that include the virtual dimension.
In the above gender example, gender reports may be slow for the few users
accessing them, but no reports for the other users are impacted.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


48 Module 5: Using Advanced Dimension Settings

When to Create a Regular Dimension


The following list describes situations in which you create a regular
dimension—versus a virtual dimension—for a cube.
! Cube Processing Times Are Not a Problem. If the cube processing times are
very short, create a regular dimension and see how adding it to the cube
impacts processing time.
! Cube Storage Is Not a Problem. Cube processing problems are much more
common and difficult to deal with than cube storage problems. However, if
you do not have problems with cube processing times and storage, create
regular dimensions instead of virtual dimensions.
! Query Times Must Be Fully Optimized. Query time performance is most
often the most important gauge of a successful OLAP cube. In most cases,
users demand the fastest queries possible. If using a regular dimension
improves query performance considerably, and cube processing and storage
does not pose a problem, define the dimension as regular.
! The Dimension Requires Features Not Available in Virtual Dimensions. A
number of dimension features are not available when you define a
dimension as virtual. For example, if you need to create a dimension based
on a parent-child dimension table, you must create it as a regular dimension.
You need to understand the requirements of the dimension and whether or
not it is supported as a virtual dimension.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 49

Demonstration: Creating Virtual Dimensions


Topic Objective
To demonstrate how to
create a virtual dimension.
Lead-in
In this demonstration, you
will learn how to create a
virtual dimension and how to
add it to a cube.

Delivery Tips To place a virtual dimension in a cube, you must perform the following steps:
The steps for this 1. Create the source member property, if the virtual dimension is based on a
demonstration are included
member property,
in the Instructor Notes.
2. Create a new virtual dimension.
Tell students that they will
be performing the same
3. Add the virtual dimension to the cube.
exercise themselves in the 4. Process the cube.
next lab. Therefore, if they
follow along with your In this demonstration, you will learn how to create a virtual dimension and how
demonstration, they can
to add it to a cube.
skip the repeated
procedures in the lab.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


50 Module 5: Using Advanced Dimension Settings

Lab E: Creating Virtual Dimensions


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will create
two more virtual dimensions
in the Module 05 database.

Objectives
Explain the lab objectives. After completing this lab, you will be able to:
! Create a virtual dimension based on a member property.
! Create a virtual dimension based on a level in a dimension.

Lab Setup
To complete this lab, you must first complete:
! Lab A, Creating Time Dimensions, found earlier in the module.
! Lab B, Creating Hierarchies from Single Columns, found earlier in the
module.
! Lab C, Creating a Custom Rollup, found earlier in the module.
! Lab D, Creating Member Properties, found earlier in the module.

Estimated time to complete this lab: 10 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 51

Exercise 1
Creating the Gender Dimension
In this exercise, you will create a virtual dimension based on a member property
defined in the Customer dimension. You will create a new member property,
Gender, and will create a new virtual dimension from Gender. Finally, you
will create a new cube and will add the Customer and Gender dimensions to
its schema.

! To create a new member property


1. In Analysis Manager, expand the Module 05 database, expand the Shared
Dimensions folder, right-click Customers, and then click Edit.
2. In the Schema pane, right-click the top of the customer table, and then
click Browse Data.
3. Notice the gender column. You are going to create a new virtual dimension
based on gender, because users need to see customer by gender in their
reports.
4. Close the Browse Data window.
5. Double-click the Name level, right-click the Member properties folder,
and then click New Member Property.
6. Click gender under the Customer table, and then click OK.
7. Click the Data tab, expand the Customers dimension to the lowest level,
and then click on a few leaf members to show the member property values
in the Member properties pane.
8. Click Save, and then close the Dimension Editor.

! To create a new virtual dimension


1. In the Module 05 database, right-click the Shared Dimensions folder, point
to New Dimension, and then click Wizard.
2. Click Next, click Virtual Dimension, and then click Next.
3. In the Available Dimensions pane, click Customers, notice Name.Gender
in the Member properties pane, and then click Next.
4. In the Available member properties pane, double-click Name.Gender, and
then click Next twice.
5. Type Gender in the Dimension name box, and then click Finish to open
the Dimension Editor.
6. Close the Dimension Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


52 Module 5: Using Advanced Dimension Settings

! To create a new cube


1. In the Module 05 database, right-click the Cubes folder, point to New
Cube, click Wizard, and then click Next.
2. Click the custfact table, and then click Next.
3. Double-click store_sales and store_cost, and then click Next.
4. Double-click Customers, CustTime, and Gender, and then click Next.
5. Click Yes when the dialog asks to count fact table records.
6. Type Gender Cube in the Cube name box, and then click Finish.

! To browse the virtual dimension


1. In the Cube Editor, click the Tools menu, click Process Cube, and then
click No to process the cube without designing aggregations.
2. In the Process a Cube dialog box, click OK.
3. When the cube is finished processing, click Close.
4. Click the Data tab to browse the Gender Cube.
5. Pivot the Customers dimension so that it becomes the column dimension,
and pivot the Gender dimension so that it becomes the row dimension.
6. Click Save, and then close the Cube Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 53

Exercise 2
Creating the Quarter Dimension
In this exercise, you will create a virtual dimension based on a level in the
BrandTime dimension. You will then add the virtual dimension to the Brand
cube to see how you can split a dimension across separate axes in a report by
using virtual dimensions.

! To create a new virtual dimension


1. In the Module 05 database, right-click the Shared Dimensions folder, point
to New Dimension, and then click Wizard.
2. Click Next, click the Virtual Dimension option, and then click Next.
3. Select the Display member keys and names check box, click BrandTime
in the Available Dimensions pane, and then click Next.
4. Double-click Quarter. <Name> in the Available member properties pane,
and then click Next twice.
5. Type Quarter in the Dimension name box, and then click Finish to open
the Dimension Editor.
6. Close the Dimension Editor.

! To add Quarter to the Brand Cube


1. In the Module 05 database, expand the Cubes folder, right-click Brand
Cube, and then click Edit.
2. Right-click the Dimensions folder and then click Existing Dimensions.
3. Double-click Quarter and then click OK.
4. Click the Tools menu, click Process Cube, and then click Yes when the
dialog asks if you want to continue.
5. Click No to process the cube without designing aggregations.
6. Click OK in the Process a Cube dialog box.
7. When the cube is finished processing, click Close.
8. Click the Data tab to browse the Brand Cube.
9. In the Product list, click the All Product member.
10. Pivot the Quarter dimension so that it becomes the column dimension and
pivot the BrandTime dimension so that it becomes the row dimension.
You will notice that the two dimensions give you the ability to view the date
information across multiple axes.
11. Click Save, and then close the Cube Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


54 Module 5: Using Advanced Dimension Settings

Review
Topic Objective
To reinforce module
objectives by reviewing key
points. ! Working with Levels and Hierarchies
Lead-in ! Working with Time Dimensions
The review questions cover
some of the key concepts ! Creating Custom Rollups
taught in the module.
! Introducing Member Properties
! Understanding Virtual Dimensions

1. What naming convention is used to differentiate multiple hierarchies in a


dimension?
Multiple hierarchies in a dimension have the naming convention of
DimensionName.HierarchyName.

2. Describe some reasons to create a separate date dimension table in the data
warehouse source.
A separate date dimension table can contain time-related properties to
enhance analysis. In addition, using a separate table reduces overall
storage space. Finally, a separate date dimension table facilitates the
creation of a shared date dimension used in multiple cubes.

3. When can you not use a custom rollup in a dimension?


You cannot create a custom rollup dimension in a cube that uses the
Distinct Count aggregation method.

4. How do virtual dimensions affect query performance?


When you do not reference them in a query, virtual dimensions do not
affect query performance. However, you will have performance
penalties in queries that reference virtual dimensions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 5: Using Advanced Dimension Settings 55

5. What are positive and negative characteristics of virtual dimensions?


Virtual dimensions do not increase cube size or processing time.
However, they are slower when referenced in queries, and they do not
contain all functionality included with regular dimensions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 6: Working with
Cubes and Measures

Contents

Overview 1
Introduction to Cubes 2
Working with Cubes 5
Introduction to Measures 11
Lab A: Creating Cubes with the Cube Editor 15
Working with Measures 19
Defining Cube Properties 28
Using the Disabled Property 30
Lab B: Using Properties in the Cube Editor 32
Review 35
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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 6: Working with Cubes and Measures iii

Instructor Notes
Presentation: Other modules in this course review the mechanics for creating different types
60 Minutes of dimensions and how to solve common online analytical processing (OLAP)
design issues. Though dimensions are fundamental to multidimensional
Labs: reporting, the database cube combines dimensions with measures to answer
30 Minutes complex business questions. In this module, students use the Cube Editor in
Microsoft® SQL Server™ 2000 Analysis Services to create and manipulate
cubes, add measures and dimensions, and assign properties to improve cubes.
After completing this module, students will be able to:
! Define the required components of cubes.
! Create cubes by using the Cube Editor.
! Describe the characteristics of measures.
! Assign properties to measures.
! Modify cube properties by using the Cube Editor.
! Disable levels of shared dimensions.

Materials and Preparation


This section provides the materials and preparation tasks that you need to teach
this module.

Required Materials
To teach this module, you need Microsoft PowerPoint® file 2074A_06.ppt

Preparation Tasks
To prepare for this module, you should:
! Read all of the student materials.
! Read the instructor notes and margin notes.
! Practice the lecture presentation and demonstration.
! Complete the lab.
! 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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


iv Module 6: Working with Cubes and Measures

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. Will the Validate Cube Structure tool in the Cube Editor find most
problems with a cube?
The Validate Cube Structure tool does not find most problems
associated with a cube. It notifies you if a cube does not contain at least
one measure and at least one dimension. In addition, it notifies you if
not all tables in the cube schema are joined to at least one other table.
However, most errors in a cube are found in the underlying data in the
fact table and dimension tables. Therefore, the only method of ensuring
that the cube is complete and error-free is to process the cube, to watch
for errors in the Process dialog box, and to verify correct data values
within a cube browser.
2. How can you move easily from the Cube Editor to the Dimension Editor to
update shared dimensions?
There is no way to easily move from the Cube Editor to the Dimension
Editor. You must first close the Cube Editor and then open the
Dimension Editor for that dimension. In addition, you cannot minimize
the Cube Editor or any windows in Analysis Manager.
3. How do you add a measure to a cube when the measure is not in the fact
table?
All measures must be found in the fact table defined in the cube
schema. If your cube requires a measure from another fact table, you
can create a view in the relational database management system
(RDBMS) and build a cube directly from the view. You can also create
another cube with the same dimensions and then create a virtual cube
that combines the measures of the two cubes and their shared
dimensions.
4. How do you model measures that require a hierarchy, such as a chart of
accounts?
Because the measures dimension is flat, you cannot create a hierarchy
by defining the accounts as measures. However, you can model the
accounts as a parent-child dimension. If you are defining typical
measures as members in a dimension, you can create a single measure,
Amount, because cubes require at least one measure. Then, you use a
custom roll-up to assign various aggregations to each of the accounts in
the parent-child dimension.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 6: Working with Cubes and Measures v

Module Strategy
Use the following strategy to present this module:
! Introduction to Cubes
Explain the characteristics of cubes. Discuss the programmatic limitations
associated with cubes and measures.
! Working with Cubes
Describe the Cube Editor interface and give an informal demonstration of
each of the Cube Editor areas. Explain the steps involved in creating a new
cube by using the Cube Editor. Describe the differences between defining
private and shared dimensions in a cube.
! Introduction to Measures
Define the characteristics of measures. Explain the process of adding new
members to a cube, deleting measures from a cube, and modifying measures
in the Cube Editor. Finish the discussion with lab A, in which students
create simple cubes, add dimensions and measures, and view properties in
the Cube Editor.
! Working with Measures
Describe each of the measure properties found in the Cube Editor. Explain
each of the Aggregate Function properties and give examples of when to
use Sum, Count, Min, Max, and Distinct Count. Define derived measures
and discuss their limitations in creating calculations.
! Defining Cube Properties
Explain each of the cube properties available in the Cube Editor. Discuss the
real-world application of each property.
! Using the Disabled Property
Explain the Disabled property used in the Cube Editor to disable dimension
levels. Finish the module with lab B, which highlights several measure,
dimension, and cube properties.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 6: Working with Cubes and Measures 1

Overview
Topic Objective
To provide an overview of
the module topics and
objectives. ! Introduction to Cubes
Lead-in ! Working with Cubes
In this module, you will learn
about the Cube Editor and ! Introduction to Measures
how it can be used to create
and manipulate cubes, add ! Working with Measures
measures and dimensions,
and assign properties to ! Defining Cube Properties
improve cubes.
! Using the Disabled Property

It is important to understand the mechanics of creating dimensions, but


dimensions are useful only when incorporated into a cube. The database cube
combines dimensions with measures to answer complex business questions. In
this module, you use the Cube Editor to create and manipulate cubes, add
measures and dimensions, and assign properties to improve cubes.
After completing this module, you will be able to:
! Define the required components of cubes.
! Create cubes by using the Cube Editor.
! Describe the characteristics of measures.
! Assign properties to measures.
! Modify cube properties by using the Cube Editor.
! Disable levels of shared dimensions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


2 Module 6: Working with Cubes and Measures

# Introduction to Cubes
Topic Objective
To introduce the concept of
cubes.
Lead-in ! Characteristics of Cubes
In this section, you learn the ! Analysis Services Limitations
characteristics of cubes and
the limitations associated
with cubes and measures.

An online analytical processing (OLAP) cube uses dimension hierarchies to


summarize measures from a fact table. A cube must always have at least one
dimension, at least one measure, and one fact table that is the data source of the
cube. To efficiently design cubes that meet your business needs, you need to
understand the requirements related to cubes and measures and the design limits
of Microsoft® SQL Server™ 2000 Analysis Services. This section describes the
characteristics of cubes and the limitations associated with cubes and measures.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 6: Working with Cubes and Measures 3

Characteristics of Cubes
Topic Objective
To describe the fundamental
characteristics of cubes.
Lead-in ! Combine Dimensions and Measures
Now let us discuss the ! Provide the Mechanism for Uniform and Rapid Query
fundamental characteristics
of cubes.
Response
! Are Subsets of Data from a Data Warehouse that Are
Converted to Multidimensional Structures
! Contain Precalculated Summaries of Data Called
Aggregations
! Contain up to 128 Dimensions

Users interact with OLAP databases by connecting to and manipulating cubes.


Delivery Tip The following are important characteristics of cubes:
Point out that cubes can
store data directly in the ! Cubes combine dimensions and measures into one logical storage medium.
RDBMS. The slide mentions
the most common method of ! Cubes provide the mechanism for rapid and uniform response to complex
storing cube data in queries by users.
multidimensional structures,
! Cubes usually contain subsets of data pulled from a data warehouse at the
but there are other options
for storing cube data in
lowest level that are then organized into multidimensional structures and
Analysis Services. aggregated into more summarized levels.

Note Relational OLAP (ROLAP) cubes store data in a collection of tables


found in the source relational database management system (RDBMS).
ROLAP cubes store their data in tables, but they have the option to store
dimension data in multidimensional structures.

! Cubes contain summaries of data called aggregations, which precalculate


according to the aggregation design of the cube.
! Despite their three-dimensional description, cubes typically contain many
dimensions, with the programmed limitation of Analysis Services being 128
dimensions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


4 Module 6: Working with Cubes and Measures

Analysis Services Limits


Topic Objective
To describe the
programmed limits Item Limit
associated with cubes and
measures in Analysis
Dimensions per cube 128
Services.
Lead-in Levels per cube 256
When designing cubes and
measures, you need to
Measures per cube 1,024
understand the
programmable limits of
Analysis Services. Calculated members per cube 65,535

Record size for cube’s source 64 kilobytes


database table

When designing cubes and measures, you need to know the programmable
Delivery Tips limits of Analysis Services. In most cases, the limits far exceed real-world
Review each of the limits,
using the slide to illustrate
requirements. However, cube and measure requirements sometimes require
the discussion. changes because of the limitations.
The following table lists some published limits of Analysis Services.
Ask students whether any
limit might be a problem for Item Limit
them when they design
cubes for their business Dimensions per cube 128
needs.
Levels per cube 256
Measures per cube 1,024
Calculated members per cube 65,535
Record size for cube’s source database 64 kilobytes
table

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 6: Working with Cubes and Measures 5

# Working with Cubes


Topic Objective
To introduce the basics of
working with cubes.
Lead-in ! Working with the Cube Editor
In this section, you explore ! Creating a New Cube
the basic elements of the
Cube Editor and learn how ! Setting Dimension Properties
to use it to create and edit
cubes.

The Cube Editor is one of the primary interfaces for refining and changing
cubes and dimensions. In this section, you explore the basic elements of the
Cube Editor and learn how to use it to create and edit cubes.
You can quickly build a cube by using the Cube Wizard. However, many of the
properties available in the Cube Editor are not available in the Cube Wizard. If
you create a cube by using the Cube Wizard, you will probably use the Cube
Editor later to refine the cube and measures.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


6 Module 6: Working with Cubes and Measures

Working with the Cube Editor


Topic Objective
To describe how to work
with the Cube Editor.
Lead-in ! Accessing the Cube Editor
If you are familiar with the ! Cube Editor Elements
Dimension Editor, the Cube
Editor is a very
straightforward interface for
working with cubes and
measures.

If you are familiar with the Dimension Editor, the Cube Editor is a very
Delivery Tip straightforward interface for working with cubes and measures.
Open the Cube Editor for a
cube in Analysis Manager
and demonstrate the Accessing the Cube Editor
interface described on this Analysis Manager is an easily navigated interface. Because of the context-
page.
sensitive menus, you typically right-click the object you want to modify or
define and then choose the proper menu option. You can access the Cube Editor
in three ways:
! The Cube Editor automatically opens after the last step of the Cube Wizard.
! In Analysis Manager, right-click the Cubes folder, click New Cube, and
then click Editor.
! In Analysis Manager, right-click the cube, and then click Edit.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 6: Working with Cubes and Measures 7

Cube Editor Elements


The Cube Editor is similar to the Dimension Editor. The left pane contains a
tree pane at the top, which shows the components of the cube. The left pane
also has a Properties pane at the bottom that contains properties for the cube, its
dimensions, and its dimension levels.
The Cube Editor includes the following major screen elements:
! Tree pane. Displays folders for dimensions, measures, calculated members,
actions, and named sets. Right-click the items in the tree pane to display the
context-sensitive menus.
! Properties pane. The Properties button toggles the display of the Properties
pane. The Properties pane contains property settings for the selected item in
the tree pane
Properties differ based on the type of item selected. For example, measures
have different properties from dimensions.
! Schema pane. The pane on the right displays the underlying RDBMS
schema when the Schema tab is clicked.
! Preview pane. When you click the Data tab, the pane on the right displays a
cube browser, which allows cube viewing.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


8 Module 6: Working with Cubes and Measures

Creating a New Cube


Topic Objective
To describe the process of
creating a new cube by
using the Cube Editor. 1. Access the Cube Editor
Lead-in 2. Choose a Fact Table
The following steps take you
through the process of 3. Select the Measures
creating a new cube by
using the Cube Editor. 4. Insert Shared Dimensions
5. Create Private Dimensions
6. Validate the Cube Structure
7. Save and Name the Cube

The Cube Wizard provides you with a systematic interface for creating new
Key Point cubes. Creating cubes through the Cube Editor is also very straightforward. The
The Validate Cube
Structure tool confirms that
following steps take you through the process of creating a new cube by using
the cube contains at least the Cube Editor:
one measure and at least
1. Right-click the Cubes folder, click New Cube, and then click Editor.
one dimension, and that all
tables included in the cube 2. Choose a fact table from the data source.
schema have legitimate
joins.
3. Select the measures for the cube from the fact table in one of three ways:
• Drag the selected numeric fields from the fact table to the Measures
folder in the tree pane.
• On the Insert menu, click Measure, and then select each measure
individually.
• Click Insert Measure, and then select each measure individually.
4. Insert the shared dimensions into the cube:
• Either right-click the Dimensions folder, and then click Existing
Dimensions, or click Insert Dimension.
• Add the shared dimensions to the cube by moving them from the
Shared dimensions list to the Cube dimensions list.

Note The Cube Editor adds any tables used to build a shared dimension to
the cube schema when you insert an existing shared dimension. If the
dimension key found in the dimension table has the same name as the
dimension key found in the fact table, a join is created automatically. If the
Cube Editor does not create the join automatically, you can create a join
manually by dragging the key from the dimension table to the key in the fact
table.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 6: Working with Cubes and Measures 9

5. Create private dimensions in the cube:


• If the dimension table does not exist in the schema, click Insert Table to
add the source table to the schema.
• Drag the columns that provide the private dimension levels to the
Dimensions folder.
• If further levels are required, either drag additional columns from the
dimension table to the private dimension or right-click the private
dimension and click New Level.

Important Adding, deleting, or modifying shared or private dimensions in a


production cube is a major procedure. In doing so, you must redesign cube
storage, redesign aggregations, and reprocess the cube.

6. On the Tools menu, click Validate Cube Structure to verify that all joins
and measures are accurate.

Note The Validate Cube Structure tool confirms that the cube contains at
least one measure and at least one dimension, and that all tables included in
the cube schema are joined to at least one other table.

7. Save and name the cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


10 Module 6: Working with Cubes and Measures

Setting Dimension Properties


Topic Objective
To describe the process of
setting properties for private
and shared dimensions and ! Setting Properties for Private Dimensions
to compare the two types of
dimensions. $ Administration occurs in the Cube Editor
Lead-in $ Any level property can be modified
You set dimension
properties in the Dimension ! Setting Properties for Shared Dimensions
Editor or the Cube Editor.
The editor you use depends $ Properties apply to all cubes that contain the dimension
on whether the dimension is
private or shared. $ Administration occurs in the Dimension Editor

You set dimension properties in the Dimension Editor or the Cube Editor. The
editor you use depends on whether the dimension is private or shared.

Setting Properties for Private Dimensions


With a private dimension, you use the Cube Editor, not the Dimension Editor,
to edit all of the dimension properties. You use the Cube Editor’s Properties
pane to change the properties such as the dimension name and the dimension
type.
If a particular level in a private dimension is selected, you can modify all of the
level properties, such as Member Key Column, Member Name Column,
Member Keys Unique, and so on.

Setting Properties for Shared Dimensions


With the exception of properties such as disabling levels and setting
aggregation usage, the properties for shared dimensions are disabled. Because
these properties apply to the entire dimension in all cubes and not only to the
dimension in the single cube, shared dimension administration occurs in the
Dimension Editor.
The Member Key Column is also accessible in the Cube Editor. You update
the Member Key Column of some shared dimension levels to optimize cube
processing.

Note For more information about optimizing cube processing by updating the
Member Key Column, see module 9, “Processing Dimensions and Cubes,” in
course 2074A, Designing and Implementing OLAP Solutions with Microsoft
SQL Server 2000.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 6: Working with Cubes and Measures 11

# Introduction to Measures
Topic Objective
To introduce the concept of
measures.
Lead-in ! Defining Measures
Measures are the numeric ! Adding, Deleting, and Modifying Measures
data of primary interest to
the users of a cube.
Understanding the
characteristics and
mechanics of measures is
fundamental to working with
cubes

Measures are the numeric data of primary interest to the users of a cube.
Understanding the characteristics and mechanics of measures is fundamental to
working with cubes.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


12 Module 6: Working with Cubes and Measures

Defining Measures
Topic Objective
To define several
characteristics of measures
and the measures ! Measures ! The Measures Dimension
dimension.
$ Must be numeric $ Is flat
Lead-in
$ Must originate from the fact $ Is limited to 1,024 members
All cubes by definition
table
contain a measures $ Is always private
dimension. The measures $ Force the redesign of
dimension is different from aggregations when added,
other dimensions in several deleted, or modified
respects.
$ Are aggregated across all
dimensions
$ Consume disk space

All cubes by definition contain a measures dimension. The measures in a cube


Delivery Tip appear as members of the measures dimension. The measures dimension is
The slide bullet “Is always
private” may be confusing
different from other dimensions in several respects.
for students. If so, explain
that measures are not Measures
shared across multiple
The following items are characteristics of measures:
cubes, similar to private
dimensions. ! A measure must be numeric. In other words, a measure is always
quantitative in nature, such as the number of units, average price, or dollars.
! A measure must originate from columns in the fact table.
! When you add, delete, or modify a measure in a cube, the aggregations of
the cube must be redesigned.
! Each measure is aggregated uniformly across all other dimensions by one of
the five aggregate functions.

Note Custom rollups, custom rollup formulas, and custom member


formulas allow you to define members that override the default aggregation
functions of measures. For more information on these topics, see module 5,
“Using Advanced Dimension Settings,” and module 11, “Implementing
Calculations Using MDX,” in course 2074A, Designing and Implementing
OLAP Solutions with Microsoft SQL Server 2000.

! Measures are stored in the cube and consume disk space after the cube is
processed.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 6: Working with Cubes and Measures 13

The Measures Dimension


The following items are characteristics of the measures dimension:
! The measures dimension is flat—there are no levels in the dimension.
! The measures dimension is limited to 1,024 members, each of which maps
directly to one or more columns in the source fact table.
! You do not share measures across multiple cubes. The measures dimension
is always private.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


14 Module 6: Working with Cubes and Measures

Adding, Deleting, and Modifying Measures


Topic Objective
To describe how to add,
delete, and modify
measures by using the ! Adding a Measure to a Cube
Cube Editor.
! Deleting a Measure from a Cube
Lead-in
After a cube is defined, the ! Modifying a Measure in a Cube
only way to add, delete, or
modify a measure is by
using the Cube Editor.

The Cube Wizard walks you through the steps required to create a cube. Once a
Key Point cube is defined, however, the only way to add, delete, or modify a measure is
Adding, deleting, or
modifying measures in a
by using the Cube Editor.
production cube is a major
procedure. In doing so, you Adding a Measure to a Cube
must redesign cube storage,
To add a measure to a cube by using the Cube Editor, perform the following
redesign aggregations, and
reprocess the cube.
steps:
1. In the Cube Editor, right-click the Measures folder, and then click New
Measure.
2. Select a column from the fact table.

Deleting a Measure from a Cube


To delete a measure from a cube, perform the following step:
Delivery Tip
Open the Cube Editor and ! In the Cube Editor, right-click the measure and click Delete.
demonstrate how to add,
delete, and modify
measures in cubes. Modifying a Measure in a Cube
To modify a measure in a cube, perform the following steps:
1. Click the measure in the tree pane of the Cube Editor.
2. Edit the properties of the measure in the Properties pane.

Important Adding, deleting, or modifying measures in a production cube is a


major procedure. In doing so, you must redesign cube storage, redesign
aggregations, and reprocess the cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 6: Working with Cubes and Measures 15

Lab A: Creating Cubes with the Cube Editor


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will create
two cubes by using the
Cube Editor.

Explain the lab objectives.


Objectives
After students complete the After completing this lab, you will be able to:
lab, ask the students what
Sales Dollars values they ! Create a new cube by using the Cube Editor.
record for both exercises in ! Add measures and dimensions to a cube.
the lab.

Prerequisites
Before working on this lab, you must have:
! Experience working with dimensions.
! An understanding of dimensions, cubes, and measures.

Estimated time to complete this lab: 10 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


16 Module 6: Working with Cubes and Measures

Exercise 1
Creating a Simple Cube
In this exercise, you will create a basic cube, adding a single measure and one
private dimension by using the Cube Editor. You also will create a valid cube
and browse the resulting data.

! 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\L06\Module
06.CAB, and then click OK.
2. To expand the database, double-click Module 06.
3. Double-click the Data Sources folder below Module 06, right-click the
Module 06 data source, and then click Edit.
4. Click the Connection tab of the Data Link Properties dialog box, and then
verify that localhost is selected in the list of servers in step 1.
5. In step 2, verify that Use Windows NT Integrated security is selected.
6. In step 3, verify that Module 06 is selected.
7. Click Test Connection and verify that the test succeeded. Click OK twice.

! To create a new cube


1. In Analysis Manager, in the Module 06 database, right-click the Cubes
folder, click New Cube, and then click Editor.
The Cube Editor opens and you see the Choose a fact table dialog box.
2. Click Salesfact, and then click OK. Click Yes to count the fact table
records.
You see the Salesfact table in the Schema pane on the right side of the Cube
Editor.
3. Drag Sales_Dollars from the Salesfact table to the Measures folder in the
Cube Editor tree pane.
4. Double-click State_ID in the Salesfact table.
5. In the Map the Column dialog box, click Dimension, and then click OK.
You see a new dimension beneath the Dimensions folder—State Id. Notice
that there is not a hand beneath the arrows on the icon for the State Id
dimension. This indicates that State Id is a private dimension.
6. Click the State Id dimension, and change the dimension name to State in
the Basic tab of the Properties pane.
7. Expand the State dimension and notice the one level in the dimension—
State Id. Change the name of the level to State.
8. Notice that the other properties in the Basic and Advanced tabs in the
Properties pane can be modified.
You can change the properties of State because you defined it as a private
dimension.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 6: Working with Cubes and Measures 17

! To process, save, and browse the cube


1. In the Cube Editor, click the Data tab and browse the new cube.
The data in the browser is sample data generated by the Cube Editor.
2. To verify that the cube contains all required components, on the Tools
menu, click Validate Cube Structure, and then click OK.
3. On the Tools menu, click Process Cube, click Yes to save the cube, and
then name the cube Simple Cube. Click OK.
4. When asked if you want to design aggregations, click No, and then click
OK.
5. Close the Process dialog box.
6. Browse the cube in the Data pane. What is the Sales Dollars value for State
Id 6?
$5,208.15
____________________________________________________________

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


18 Module 6: Working with Cubes and Measures

Exercise 2
Creating the Sales Cube
In this exercise, you will create another cube—Sales. In this cube, you will add
dimensions already defined in the Module 06 database. You finish by
processing and browsing the cube to test for correct data.

! To create the new cube


1. In the upper right corner of the Cube Editor, click the Cube list, and then
click New.
2. Click Salesfact, and then click OK. To count the fact table records, click
Yes.
3. Add the Sales_Dollars and Sales_Units measures to the cube.
4. Right-click the Dimensions folder and click Existing Dimensions.
5. Click the double arrow button (>>) to add all dimensions to the Cube
dimensions list, and then click OK.
Notice that all dimensions are added to the Dimensions folder in the tree
pane. In addition, notice the dimension tables in the Schema pane. When
you add a shared dimension to a cube, its dimension tables are automatically
added to the cube schema.
6. Expand the Product dimension, and notice the properties in the Basic and
Advanced tabs for each of the levels in the Product dimension.
Most properties are disabled because Product is a shared dimension. To
update the properties of a shared dimension, leave the Cube Editor and edit
the dimension by using the Dimension Editor.

! To process, save, and browse the cube


1. In the Cube Editor, click the Data tab and browse sample data in the new
cube.
2. To verify that the cube contains all required components and joins, on the
Tools menu, click Validate Cube Structure. Click OK.
3. On the Tools menu, click Process Cube. Click Yes to save the cube, and
then name the cube Sales. Click OK.
4. Click No to avoid the design of aggregations, and then click OK.
5. Close the Process dialog box.
6. Browse the cube in the Data pane. What is the calendar year January 2000
Sales Dollars value for Bread in the USA?
$486.58
____________________________________________________________

7. Save the cube, and then close the Cube Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 6: Working with Cubes and Measures 19

# Working with Measures


Topic Objective
To introduce the mechanics
of working with measures.
Lead-in ! Defining Measure Properties
In this section, you will learn ! Aggregating Measures
about basic measure
properties, the Aggregate ! Working with Derived Measures
Function property, and the
use of derived measures in
cubes.

When you create a measure in a cube, you must determine the basic properties
and the Aggregate Function property to assign the measure. In addition, you
can update the Source Column of the measure to create a derived measure in
specific circumstances.
In this section, you will learn about:
! Defining measure properties.
! Aggregating measures.
! Working with derived measures.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


20 Module 6: Working with Cubes and Measures

Defining Measure Properties


Topic Objective
To describe the measure
properties available in the
Cube Editor. ! Name and Description
Lead-in ! Source Column
The properties of a measure
provide a wide range of ! Formatting Measures
functions. For example, you
can change the aggregation ! Visible Measures
method and the display
format of a measure. This ! Data Type
section reviews the
available measure
properties.

When you add new measures to a cube, the Cube Editor sets the properties of
Delivery Tip the measure to a default setting. In most instances, you do not change the
Open the Cube Editor and
review each property as you
default setting of a measure.
describe it. The properties of a measure provide a wide range of functions. For example,
you can change the aggregation method and the display format of a measure.
Measure properties include the following.

Name and Description


The Name property on the Basic tab of the Properties pane contains the name
of the measure. The Name property defaults to the name of the column from
which the measure originates, and uses the following rules:
! Spaces replace underscores. For example, Unit_Sales in the source column
becomes Unit Sales in the cube.
! The same measure can be added multiple times to a cube. If this occurs, the
Cube Editor automatically appends an integer to the name of the measure.
For example, adding the Unit_Sales source column to the cube three times
creates the measures Unit Sales, Unit Sales 1, and Unit Sales 2.

You change the name from the default name by clicking the measure you want
to update, and then by typing the new name in the Name property on the
Properties pane.
By default, the Description property is blank. Updating the description field
adds descriptive information accessible by front-end applications.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 6: Working with Cubes and Measures 21

Source Column
The Source Column on the Basic tab of the Properties pane identifies the
column that provides the measure from the source RDBMS fact table.
The following items are characteristics of the Source Column property:
! The property typically specifies an RDBMS column containing source
columns in “Fact table”.“Column” format.
! Source Column must originate from a numeric data type, except when the
Count or the Distinct Count aggregation methods are used. If the Count or
the Distinct Count methods are used, the source column can be a string.
Point out that the situations ! Source Column can consist of any valid SQL expression involving one or
in which you use more columns from the fact table, similar to the Member Key Column and
expressions for the source the Member Name Column for dimension levels. However, because of
column of a measure are aggregation behavior and the handling of null values in the RDBMS, you
discussed later in this use expressions for the source column of a measure only in very specific
module. situations.

Formatting Measures
The Display Format property on the Advanced tab of the Properties pane is
used to change the format for displaying a measure.
There are two ways to enter a format for displaying a measure:
! A format can be selected from the Display Format property list.
! If the required format is not in the list, it can be typed in manually. If the
client application recognizes the entered format, the measure appears in the
applied format. For example, to display data for a measure rounded to the
nearest thousandth, type #,#.000 in the Display Format property. Some
client interfaces recognize this format and display the measure correctly.

Visible Measures
By default, measures you create in a cube are visible. However, Analysis
Services allows you to designate a measure as invisible. An invisible measure is
not available to client software. You designate a measure as invisible by setting
the Visible property to False. For example, you may want to use the measure
Count as an intermediate value for creating a calculated measure, Average
Units, but you do not want Count to appear in the list of available measures in
a client application. In this situation, set the Visible property of Count to False.
The Visible property is set on the Advanced tab in the Properties pane. When
this property is set to False, the measure is hidden from clients, including
custom applications.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


22 Module 6: Working with Cubes and Measures

For example, suppose you want to calculate average shipment days:


! Average is not one of the five aggregation functions available. However,
averages are easily computed by taking the sum of a specific measure and
dividing it by the count of the same measure.
! You can define Summed Shipment Days as a measure defined by using the
Count aggregation method. You can use it in a calculation to calculate the
measure, Avg Shipment Days.
! You can now browse the data. You do not want the Summed Shipment
Days measure to appear in the client interface. Therefore, you can set the
Visible property of Summed Shipment Days to False.
! The Summed Shipment Days measure is used to define the Avg Shipment
Days measure, but users do not see it in their cubes.

Data Type
The Data Type property is available from the Advanced tab of the Properties
pane. Because measures are numeric, all available Data Type fields are
numeric.
The following characteristics are true of the Data Type property:
! When you create a measure, Analysis Manager attempts to set the Data
Type property according to the data type of the column in the data source.
! When specifying the data type for a measure, be certain that the data type
can accommodate the measure at its aggregated level. The cube editor will
not warn you if this data type is too small for the measure.
! If the data type is too small, an error will occur during processing of the
cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 6: Working with Cubes and Measures 23

Aggregating Measures
Topic Objective
To describe the five
Aggregate Function
property settings applied to ! Sum—The Summation of a Measure
measures.
! Count—The Number of Measures
Lead-in
Whether precalculated or ! Min—The Minimum Value of a Measure
calculated at query time, five
types of Aggregate ! Max—The Maximum Value of a Measure
Functions exist for
measures. They are Sum, ! Distinct Count—The Number of Unique Measures
Count, Min, Max, and
Distinct Count.

When you browse a cube and drill up the levels in a dimension, the cube
Delivery Tips browser displays values aggregated to each of the levels. By default, the
Discuss real-world
examples of when you use
measures are summed, which means that lower-level values are summed
each Aggregate Function together to obtain higher-level values. Measures that are summed have the
setting. Aggregate Function of Sum.

Ask students if they can give


Measures are uniformly aggregated across all other dimensions in the cube. The
examples of measures aggregated values are either precalculated or calculated at query time as the
requiring each of the user navigates to the levels.
Aggregate Functions.
Whether precalculated or calculated at query time, five types of Aggregate
Functions exist for measures. They are Sum, Count, Min, Max, and Distinct
Count. The following text describes each of the Aggregate Functions.

Sum—The Summation of a Measure


A new measure has the Aggregate Function property set to Sum by default,
unless the field from which it originates is a string, in which case the default is
Count. When the Aggregate Function of a measure is Sum, the measure adds
across all other dimensions.
For example, when you define Unit Sales as a Sum measure:
! Unit Sales for each year equals the sum of Units Sales for the four quarters
in each year.
! Unit Sales for each quarter equals the sum of Unit Sales for all of its
months.
! Unit Sales for All Customers equals the sum of Unit Sales for each
individual customer.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


24 Module 6: Working with Cubes and Measures

Count—The Number of Measures


A new measure created from a string field has the Aggregate Function
property set to Count by default.
A Count measure calculates its value by tallying the number of non-empty
occurrences of the source field in the fact table. For example, if the measure is a
Count measure on the field Product_ID, it counts the product Ids in the fact
table across all other dimensions. This is useful for answering questions such as
how many products are sold to customer Beverly Baker in June.

Tip Use the Count Aggregate Function to create a calculation that computes
an average. For example, to calculate the average price of products, divide the
total price by the count of the number of products in the fact table.

Min—The Minimum Value of a Measure


A measure with the Aggregate Function property set to Min returns the lowest
value from a range of values. For example, the Min function can be used to
identify the shortest wait time by product by hour by customer.

Max—The Maximum Value of a Measure


A measure with the Aggregate Function property set to Max returns the
highest value from a range of values. For example, the Max function can be
used to identify the highest cost by product by customer.

Distinct Count—The Number of Unique Measures


The Distinct Count Aggregate Function identifies the number of unique
occurrences of a source field in the fact table.
For example, you can count the number of customers buying products in a
period by using the Count function. However, customers may have multiple
purchases, and the Count function records every fact table occurrence,
recording multiple customers if the customer makes multiple purchases. In
contrast, the Distinct Count function records only unique occurrences, and
therefore does not take the number of purchases into consideration when
counting customers.
There are a few restrictions regarding the use of the Distinct Count function:
! You cannot create a measure that uses the Distinct Count function when
your cube contains custom rollups or custom member formulas.

Note Custom rollups, custom rollup formulas, and custom member


formulas allow you to define members that override the default aggregation
functions of measures. For more information on these topics, see module 5,
“Using Advanced Dimension Settings,” and module 11, “Implementing
Calculations Using MDX,” in course 2074A, Designing and Implementing
OLAP Solutions with Microsoft SQL Server 2000.

! A cube can contain only one Distinct Count measure.

Tip Virtual cubes can contain multiple Distinct Count measures and can

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 6: Working with Cubes and Measures 25

include dimensions that use custom rollups or custom member formulas


with Distinct Count measures.

! Analysis Services cannot fully precalculate cubes containing Distinct


Count measures because they are nonadditive measures. Therefore, it is
recommended that you separate Distinct Count measures into separate
cubes so that other measures can take advantage of full precalculation in
other cubes. You can then create virtual cubes that combine multiple source
cubes.

Note For more information about virtual cubes, see module 12, “Working
with Virtual Cubes,” in course 2074A, Designing and Implementing OLAP
Solutions with Microsoft SQL Server 2000.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


26 Module 6: Working with Cubes and Measures

Working with Derived Measures


Topic Objective
To define derived measures
and to learn how to use
them in Analysis Services ! Use SQL Expressions in the Source Column
cubes.
! Must Be Valid Expressions within the RDBMS
Lead-in
You can create a derived ! Caution: Should Only Be Used with Min or Max in
measure from one or more Multiplication or Division Calculations
fact table columns by using
an SQL expression. $ Do not process nulls correctly in additive expressions
$ Create incorrect summary values with the Sum
Aggregate Function

Similar to using expressions in the Member Key Column and Member Name
Column to create a dimension, you can create a derived measure from one or
more fact table columns by using an SQL expression. Derived measures are
stored and treated like other measures, but they originate from an expression
performed before the data is loaded and stored in the OLAP cube.
The expression entered in the Source Column passes through to the RDBMS
as part of an SQL SELECT statement. The expression must be valid for the
RDBMS used as the source database of the cube.

Key Point Because of calculation and aggregation behavior, it is recommended that you
It is recommended that you use derived measures only with a multiplication or division expression that uses
use derived measures only the Min or Max Aggregate Function.
with a multiplication or The following reasons explain why a derived measure can produce incorrect
division expression that
results:
uses the Min or Max
Aggregate Function. ! Because of the RDBMS null behavior, expressions that add or subtract fact
table columns can produce incorrect results. Consider a situation when you
define a measure, Total Expenses, as a derived measure that adds two fact
table columns, Coop Expenses and House Expenses. If either Coop
Expenses or House Expenses is null, the value for Total Expenses is null,
even if the other expense contains a value.
! The null behavior does not produce errors in multiplication or division
expressions. For example, if you multiply or divide a null by a value, the
result is null, which is the behavior produced by a derived measure.
However, derived measures calculate before cube aggregations, and
therefore the values at summarized levels are incorrect if you use the Sum
Aggregate Function.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 6: Working with Cubes and Measures 27

! Consider the following cube report created by using a derived measure,


Average Price, that equals Total Price divided by Total Units.

Time members Total price Total units Average price

January $50.00 25 $2.00


February $60.00 30 $2.00
March $50.00 25 $2.00
Quarter 1 $160.00 80 $6.00

If you create Average Price as a derived measure, the expression first


calculates the Average Price of the months. Next, Analysis Services
aggregates the measure across the Time dimension, producing an Average
Price of $6.00 for Quarter 1. The Average Price for Quarter 1 should be
$2.00, or $160.00 divided by 80, so the derived measure produces incorrect
values at summary levels.
! The one method of creating a valid derived measure is to calculate a
minimum or maximum value of a multiplication or division expression. For
example, if you want to return the minimum average price across all
periods, create a derived measure equal to Total Price divided by Total
Units. You then define the Aggregate Function as Min. In this case, you
do not have problems with null values or incorrect aggregations.

Tip The inflexibility of derived measures is not limiting to cube design,


because you can create up to 65,535 calculated members in a single cube. For
more information about calculated members, see module 11, “Implementing
Calculations Using MDX,” in course 2074A, Designing and Implementing
OLAP Solutions with Microsoft SQL Server 2000.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


28 Module 6: Working with Cubes and Measures

Defining Cube Properties


Topic Objective
To define fundamental cube
properties.
Lead-in ! Fact Table Size
Each cube contains a ! Aggregation Prefix
variety of properties that you
can set to define its storage ! Visible Property
and appearance, and the
way users interact with its ! Default Measure
data.

Each cube contains a variety of properties that can be set to define its storage,
Key Points appearance, and how users interact with its data. You access the properties of a
Analysis Services uses the
Fact Table Size to design
cube by clicking on the cube in the tree pane, and then clicking the Properties
aggregations in the cube. pane of the Cube Editor. The following properties are useful when designing,
creating, and modifying cubes in the Cube Editor.
For the cube property
Aggregation Prefix to work Fact Table Size
properly, you must first
update your partition The Fact Table Size property records the number of records found in the fact
Aggregation Prefix table defined in the schema of the cube. The property is set initially when you
property. To append the add the fact table to the cube schema. Analysis Manager asks if you want it to
cube Aggregation Prefix to count the records for you. The results of its count are placed in the Fact Table
cube aggregation tables, the Size property.
partition Aggregation
Prefix must begin with a Analysis Services uses the Fact Table Size to design aggregations in the cube.
plus sign (+). If you decline to count the number of records when you define your cube,
ensure that you update the Fact Table Size with an accurate value before
designing aggregations for your cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 6: Working with Cubes and Measures 29

Aggregation Prefix
The Aggregation Prefix property determines the string prefix added to the
beginning of aggregation tables in ROLAP cubes. For example, in a ROLAP
cube with an Aggregation Prefix of Sales_Agg, all aggregation tables created
in the ROLAP cube RDBMS will have names that begin with Sales_Agg.
The purpose of using the Aggregation Prefix is to help database administrators
track aggregation tables in the RDBMS.

Tip For the cube property Aggregation Prefix to work properly, you first must
update your partition Aggregation Prefix property. To append the cube
Aggregation Prefix to cube aggregation tables, the partition Aggregation
Prefix must begin with a plus sign (+). For more information about partitions,
see module 10, “Managing Partitions,” in course 2074A, Designing and
Implementing OLAP Solutions with Microsoft SQL Server 2000.

Visible Property
The Visible property determines if the cube is visible or not to users logging in
to the Analysis Server. By default, the Visible property is True.
When you set the Visible property of a cube to False, users cannot access the
cube in front-end applications. However, OLAP administrators can still access
the cube and the cube data in Analysis Manager.
Setting the Visible property to False is a simple way to limit user access to
cubes without having to update security. This is useful in a development or
testing environment, or when the cube administrator makes changes to the cube
structure.

Note The Visible property of a cube does not affect virtual cubes sourced from
the cube. Therefore, if you set the Visible property of a cube to False, users can
still access virtual cubes created from the invisible cube.

Default Measure
The Default Measure property defines the measure retrieved by the cube if no
measure is explicitly defined in a cube query. The Default Measure property is
similar to the Default Member property defined for each dimension.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


30 Module 6: Working with Cubes and Measures

Using the Disabled Property


Topic Objective
To describe the Disabled
property and to explain its
use in the Cube Editor. ! Is Only Available within the Cube Editor
Lead-in ! Prevents Users from Viewing the Level and All
The Disabled property is a
property of a level, but it
Descendant Levels
exists only in the Cube ! Does Not Store Data for the Level within the Cube
Editor. It determines
whether a dimension level is ! Is Used within Shared Dimensions
included in a cube.
! Is Different from the Visible Property

The Disabled property is a property of a level.


The following are characteristics of the Disabled property:
! It exists only in the Cube Editor.
! It determines whether a dimension level is included in a cube. Disabling a
level does not simply hide the level from view. It completely removes that
level and all levels below it from the dimension in the cube.
! It removes all associated data from cube storage.
! You disable levels in the Cube Editor. Though the Disabled level property
is available for both shared and private dimensions, it only makes sense to
disable a level for a shared dimension. In the case that you do not want a
private dimension to contain a particular level, you exclude the level from
the private dimension entirely.

Perform the following steps to disable a level:


1. From the tree pane in the Cube Editor, expand the dimension for which you
will be disabling a level. This allows you to see all of the levels for the
dimension
2. Click the level that you want to disable.
3. In the Properties pane, click the Advanced tab.
4. Change the Disabled property value to Yes. The selected level and all
descendant levels are disabled.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 6: Working with Cubes and Measures 31

The Disabled level property differs from the Visible level property in two
ways:
! Levels that are disabled do not store data in the cube and are not visible to
users. Levels with Visible properties set to False do store data in the cube,
but their data is not visible to users.
! Disabling a level completely removes the disabled level and all levels below
it from the dimension in the cube. However, you can set the Visible
property of a level to False and the levels below the changed level remain
visible to clients. Therefore, you can use the Visible property to skip
dimension levels for users in client applications.

Note For more information on the Visible level property, see module 5,
“Using Advanced Dimension Settings,” in course 2074A, Designing and
Implementing OLAP Solutions with Microsoft SQL Server 2000.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


32 Module 6: Working with Cubes and Measures

Lab B: Using Properties in the Cube Editor


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will update
the Sales cube and use
various measure and
dimension properties to
modify the cube.

Explain the lab objectives.


Objectives
After completing this lab, you will be able to:
! Create derived measures.
! Use various Aggregate Functions.
! Understand the difference between the Count and the Distinct Count
Aggregate Functions.
! Create an internal measure.
! Disable dimension levels in a cube.

Lab Setup
To complete this lab, you need to have successfully completed lab A, Creating
Cubes with the Cube Editor, in this module.

Estimated time to complete this lab: 20 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 6: Working with Cubes and Measures 33

Exercise 1
Updating the Sales Cube
In this exercise, you will update the Sales cube created in lab A, Creating Cubes
with the Cube Editor. You will add new measures, create derived measures, and
apply various properties to measures and dimension levels.

! To create the Bad Price derived measure


1. In the Module 06 database, expand the Cubes folder, right-click Sales, and
then click Edit.
2. Drag Sales_Dollars from the Salesfact table to the Measures folder in the
tree pane.
Notice that the measure Sales Dollars 1 is added to the cube measures.
3. Change the name of Sales Dollars 1 to Bad Price.
4. In the Source Column property, change the column name to the expression:
"dbo"."SalesFact"."Sales_Dollars" /
"dbo"."SalesFact"."Sales_Units"

5. Click the Advanced tab of the Properties pane and verify that the Data
Type and Display Format properties are set to Currency.
6. After saving the cube, process the cube, do not design aggregations, and
browse the cube in the Data pane.
7. Notice the value of Bad Price for North American Bread.
It should be $2.11. However, the value of Bad Price is $4,914.29.
Because the Aggregate Function setting for Bad Price is Sum, the lowest
level Bad Price values are being summarized at all levels of all dimensions.
This highlights the problem with creating derived measures that use the
Sum Aggregate Function.

! To create the Minimum Price derived measure


1. In the Cube Editor, add Sales_Dollars as a measure.
2. Name the new measure Minimum Price.
3. Change the Source Column property to the following expression:
"dbo"."SalesFact"."Sales_Dollars" /
"dbo"."SalesFact"."Sales_Units"

4. Change the Aggregate Function property to Min.


5. Verify that the Data Type and Display Format properties are set to
Currency.
6. After saving the cube, process the cube, do not design aggregations, and
browse the cube in the Data pane.
7. Notice that Minimum Price correctly displays the minimum price for
products in the appropriate product categories.
This highlights the fact that derived measures can be used successfully to
calculate minimum or maximum values.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


34 Module 6: Working with Cubes and Measures

! To add the Product Count and Unique Product Count measures


1. In the Cube Editor, add the Product_ID column in the fact table as a new
measure.
2. Name the measure Product Count.
3. Change the Aggregate Function property to Count.
4. Add the Product_ID column again as a new measure.
5. Name the measure Unique Product Count.
6. Change the Aggregate Function property to Distinct Count.
7. After saving the cube, process the cube, do not design aggregations, and
browse the cube in the Data pane.
Notice the difference between the values of the two measures. The Product
Count value for the All Product member is 6023. The Unique Product
Count for the All Product member is 200.
8. Click the Sales cube in the tree pane, click the Advanced tab in the
Properties pane, and notice the Fact Table Size property value.
The value is 6023, the same as the Product Count value for All Product.
This highlights that the Count Aggregate Function is counting the total
number of records for the defined key Product_ID. Alternatively, the
Unique Product Count value is 200, or the number of unique product
occurrences in the Salesfact table.

! To update the Visible property for Product Count


1. Change the Visible property of the Product Count measure to False.
2. Click the Data tab and notice that Product Count is no longer in the list of
measures of the cube.
The Product Count measure is no longer visible in client applications.
However, it can be referenced in calculated members, thereby providing an
intermediate value for calculations.

! To disable dimension levels


1. Expand the Product dimension.
2. Click the Subcategory level, click the Advanced tab of the Properties pane,
and change the Disabled property to Yes.
3. Click the Product level and notice the Disabled property value.
Disabling the Subcategory level automatically disables all levels below
Subcategory.
4. Browse the cube in the Data pane. Attempt to drill down in the Product
dimension.
Notice that the Subcategory and Product levels are not available for
queries.
5. Save the Sales cube, and then close the Cube Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 6: Working with Cubes and Measures 35

Review
Topic Objective
To reinforce module
objectives by reviewing key
points. ! Introduction to Cubes
Lead-in ! Working with Cubes
The review questions cover
some of the key concepts ! Introduction to Measures
taught in the module.
! Working with Measures
! Defining Cube Properties
! Using the Disabled Property

1. How many measures can reside in one cube?


A cube can contain 1,024 measures.

2. What are three reasons that the structure of a cube produces errors when you
validate the cube?
You receive errors if the cube does not contain at least one measure, if
the cube does not contain at least one dimension, and if problems exist
with joins between the fact table and dimension tables in the cube
schema.

3. What are three fundamental characteristics of a measure?


A measure must be numeric, a measure must come from the fact table,
and a measure aggregates uniformly across all dimensions in the cube.

4. Give an example of when to change the Visible property of a measure to


False.
Change the Visible property of a measure to False when a calculation
requires an intermediate amount and the amount should not appear in
client applications.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


36 Module 6: Working with Cubes and Measures

5. Why is the Fact Table Size important?


Analysis Services uses the Fact Table Size to determine the optimal
aggregation design for a cube.

6. Give an example of when to disable a level in a dimension. Where do you


disable dimension levels?
Disable a level when you use a shared dimension in a cube that does not
use all of its levels. You disable levels on the Advanced tab of the
Properties pane of the Cube Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 7: Case
Study—Creating the
Store Expense Cube
Contents

Overview 1
Building the Store Expense Cube 2
Lab A: Building the Store Expense Cube 7
Updating the Store Expense Cube 12
Lab B: Modifying the Store Expense Cube 13
Review 20
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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 7: Case Study—Creating the Store Expense Cube iii

Instructor Notes
Presentation: In this module, students apply concepts they have learned in modules 1 through
30 Minutes 6 in course 2074A, Designing and Implementing OLAP Solutions Using
Microsoft SQL Server 2000. Students will use various cube and dimension
Labs: techniques to build an online analytical processing (OLAP) cube for store
60 Minutes expenses 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 then must 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.
! Update dimensions and add new dimensions to a cube.

Materials and Preparation


This section provides the required materials and preparation tasks that are
needed to teach this module.

Required Materials
To teach this module, you need the following materials:
! Microsoft PowerPoint® file 2074A_07.ppt

Preparation Tasks
To prepare for this module, you should:
! Read all of the student materials.
! Read the instructor notes and margin notes.
! Complete all of the demonstrations.
! Practice the lecture presentation and demonstrations.
! Complete the labs.
! 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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


iv Module 7: Case Study—Creating the Store Expense Cube

Demonstration: Reviewing Lab A


Demonstration: In this demonstration, you will view and discuss the solutions of lab A.

10 Minutes The following demonstration procedures provide information that will not fit in
the margin notes or are 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, find and click the file
C:\Moc\2074A\Labfiles\L07\Answers\Module 07A.CAB, click Open, and
then click Restore.
2. Expand the Module 07A database, double-click the Data Sources folder,
right-click the Module 07 data source, and then click Edit.
3. Verify that localhost is selected in step 1 and that Module 07 is selected in
step 3. Click OK.

! To view the Store Expense cube


1. Expand the Cubes folder, right-click Store Expense, and then click Edit.
2. Point out that the cube contains the dimensions shown in the following
table.
Dimension Dimension type

Scenario Shared
Time Private
Store Shared
Store Manager Private
Account Shared
Department Shared

3. Mention that the in real-world OLAP databases, Time dimensions usually


are defined as shared dimensions used within multiple cubes. The lab
contains a private Time dimension to challenge students by presenting a
different method for creating a Time dimension.
4. Highlight the fact that the cube contains one measure—Amount.
5. 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.
6. Drill down on the Account dimension and verify that students have the
correct members in the correct order.
7. Save the Store Expense cube and close the Cube Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 7: Case Study—Creating the Store Expense Cube v

Demonstration: Reviewing Lab B


In this demonstration, you will view and discuss the solutions of lab B.

Demonstration: The following demonstration procedures provide information that will not fit in
the margin notes or are not appropriate for student notes.
10 Minutes
! 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, find and click the file
C:\Moc\2074A\Labfiles\L07\Answers\Module 07B.CAB, click Open, and
then click Restore.
2. Expand the Module 07B database, double-click the Data Sources folder,
right-click the Module 07 data source, and then click Edit.
3. Verify that localhost is selected in step 1 and that Module 07 is selected in
step 3. Click OK.

! To view the Store Expense cube


1. Expand the Cubes folder, right-click Store Expense, and then click Edit.
2. Point out that the cube contains the dimensions shown in the following
table.
Dimension Dimension type

Scenario Shared
Time Private
Store Shared
Store Manager Private
Account Shared
Department Shared
Store Type Virtual

3. Browse the cube, and notice the Scenario dimension.


The Scenario dimension does not contain the All Scenario member.
4. Notice the Time dimension. It does not contain the All Time member.
5. Pivot the Store dimension to the row area in the browser.
6. Double-click the Store Country level heading, double-click the Store State
level heading, and notice that the Mexico state is hidden.
7. Drill down to the Store Name level and notice the names of the stores.
They contain both the city name and the store name.
8. Browse the Store Manager dimension, and notice the First Letter level
that groups the store managers by the first letter of their names.
9. In the Store Manager dimension, notice that no null member names exist at
the First Letter level. All null member names are hidden.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


vi Module 7: Case Study—Creating the Store Expense Cube

! To view Store Type and Account


1. In the Cube Editor, browse the Store Type dimension and verify that it
contains seven members, including the All Store Type member.
2. Pivot the Account dimension to the row area, expand the dimension to all
levels, right-click the members, and click Member Properties to view the
unary operators for each member.
3. Point out that the Account dimension does not contain the All Account
member.
4. Point out that the members in the Account dimension are not sorted in
alphanumeric order based on the Account description.
5. Ask students if they received the same values in the lab when they were
asked to verify cube results.
6. Save the Store Expense cube and close the Cube Editor.
.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 7: Case Study—Creating the Store Expense Cube vii

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. Where in Analysis Manager do you make changes to existing dimensions?
Where you update existing dimensions depends on the type of
dimension that requires modification. You modify shared dimensions in
the Dimension Editor. You modify private dimensions in the Cube
Editor.
2. Why do you want a dimension to be balanced in structure?
When a dimension is balanced, you take advantage of precalculations
for cube aggregations. Therefore, user queries execute faster than if the
queries were made against dimensions without precalculated
aggregations.
Balanced dimensions contain the same number of levels in each
dimension branch. You create a balanced dimension by defining a
standard dimension (not a parent-child dimension) when you create it
in the Dimension Wizard or the Dimension Editor.
Unbalanced dimensions must be defined as parent-child dimensions,
and do not have the same number of levels in each dimension branch.
Parent-child dimensions provide flexibility in dimension structure,
allowing for complex hierarchies such as charts of accounts and
organizational structures. However, query performance can be slower
when you use parent-child dimensions than when you use standard
dimensions, because aggregates are not stored for parent-child
dimensions.
3. In lab B, why do students process the Store dimension after updating the
Member Name Column of the Store Name level?
Students process and rebuild the Store dimension after the update of
the Member Name Column because change to the dimension structure
affects the processing of the cube. Without the rebuild, cube processing
fails in the Store Expense cube. The dimension does not force a rebuild
at cube processing time, which is why students rebuild the dimension in
the Dimension Editor.
If Store were a private dimension, the dimension processes
automatically at cube processing time. However, because Store is a
shared dimension, the students must explicitly process the dimension
themselves.
The students do not process the other shared dimensions, Scenario and
Account. Analysis Manager detects the changes made to the Scenario
and Account structures, and the dimensions process automatically
when the cube is processed.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


viii Module 7: Case Study—Creating the Store Expense Cube

4. When creating a level from an expression, why must both the Member Key
Column and the Member Name Column include the expression?
The Member Key Column includes the expression because it builds the
level and the members in the level based upon the expression.
The Member Name Column includes the expression because it names
each of the members based on the expression.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 7: Case Study—Creating the Store Expense Cube ix

Module Strategy
Use the following strategy to present this module:
! Building the Store Expense Cube
Introduce the Store Expense data source schema. Briefly describe the
dimensions and levels that are created in lab A. Describe the use of the one
measure, Amount, in the Store Expense cube. After students complete lab
A, open the archived OLAP database and explain the Store Expense cube.
! Updating the Store Expense Cube
Explain to students that they will modify the Store Expense cube in lab B.
After students complete lab B, open the archived OLAP database and
explain the Store Expense cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 7: Case Study—Creating the Store Expense Cube 1

Overview
Topic Objective
To provide an overview of
the module topics and
objectives. ! Building the Store Expense Cube
Lead-in ! Updating the Store Expense Cube
In this module, you will
apply what you learned
about the topics covered in
modules 1 through 6 of
course 2074A, Designing
and Implementing OLAP
Solutions Using Microsoft
SQL Server 2000 by
creating a cube and several
dimensions from start to
finish.

In this module, you will apply what you learned about the topics covered in
modules 1 through 6 in course 2074A, Designing and Implementing OLAP
Solutions with Microsoft SQL Server 2000, by creating an online analytical
processing (OLAP) cube and several dimensions from start to finish.
After completing this module, you will be able to:
! Create a cube based on user requirements.
! Update dimensions and add new dimensions to a cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


2 Module 7: Case Study—Creating the Store Expense Cube

# Building the Store Expense Cube


Topic Objective
To introduce the first section
of the module, which
introduces the database, ! Defining the Store Expense Schema
dimensions, and levels in
the Store Expense cube. ! Introducing the Dimensions and Levels
Lead-in ! Analyzing the Measures
In this section, you will learn
about the database that you
use to build the Store
Expense cube. In addition,
you will learn about the
dimensions and measures
of the cube.

Discuss the business You will build the Store Expense cube to analyze expenses for stores. The
reason for implementing the expenses exist for all stores in each of the store geographies. You will track
Store Expense cube. expenses by store managers to determine the amount that each manager spends.
In addition, you will determine expenses by store departments.
Expenses are stored in two years: 2000 and 2001. For now, all the data that
exists in the database corresponds to current year actual expenses. However, in
the future, the Store Expense cube will be used to create the expense budget.
Therefore, budget and forecast members exist in the Scenario dimension to
store the budgets.
In the future, Net Sales values will be used to calculate Net Income from Total
Expenses. However, the current database does not contain Net Sales values.
Therefore, the Net Income values will be negative.
In this section, you will learn about the schema of the database used to create
the Store Expense cube by using Microsoft® SQL Server™ 2000 Analysis
Services. In addition, you will learn about the dimensions and measures that
you will create in the Store Expense cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 7: Case Study—Creating the Store Expense Cube 3

Defining the Store Expense Schema


Topic Objective
To introduce the Store
Expense schema that
students use to build the
Store Expense cube.
Lead-in
You will be creating the
Store Expense cube by
using the tables in the
Module 07 SQL Server
2000 database.

The Module 07 SQL Server 2000 database contains tables that you will use to
Delivery Tip create the Store Expense cube.
Deliver this page either by
using the slide directly or by You will use the following tables to build the cube:
opening the diagram Store
Expense Schema in SQL ! expense_fact
Server Enterprise Manager.
! account
! scenario
! store
! position
! department

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


4 Module 7: Case Study—Creating the Store Expense Cube

Introducing the Dimensions and Levels


Topic Objective
To introduce the dimensions
and levels created in the
Store Expense cube. ! Scenario
Lead-in ! Time
You will create six
dimensions in the Store ! Store
Expense cube.
! Store Manager
! Account
! Department

You will create six dimensions in the Store Expense cube. Before creating
Delivery Tips each dimension, you will determine the source table and the levels that are
For classes with more
experienced students,
required to build the dimension.
briefly highlight the fact that
they will be creating several Scenario
dimensions in lab A. Do not
Define the shared Scenario dimension by using the scenario table. The
cover the dimension
structures in detail.
Scenario dimension contains four members in one level. The member names
are:
For less advanced classes,
! Adjustment for Budget input
use this page as an
opportunity to prepare ! Current Year’s Actuals
students for the lab by
discussing each of the ! Current Year’s Budget
dimensions in detail. ! Forecast

Time
Define the private Time dimension by using the expense_fact table. The Time
dimension contains three levels:
! Year
! Quarter
! Month
Verify that the Time dimension levels are specified with the proper Level Type
properties.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 7: Case Study—Creating the Store Expense Cube 5

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

Store Manager
Define the private Store Manager dimension by using the store table. The
Store Manager dimension contains one level.

Account
Define the shared Account dimension by using the account table. The Account
dimension contains levels defined by the parent-child structure found in the
account table.

Department
Define the shared Department dimension by using the tables position and
department. The Department dimension contains three levels:
! Area
! Department
! Position
Use the descriptions of Department and Position to define the member names.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


6 Module 7: Case Study—Creating the Store Expense Cube

Analyzing the Measures


Topic Objective
To describe the use of
measures in the Store
Expense cube.
Lead-in
You will create one measure
in the Store Expense cube
named Amount.

Measure

You will create one measure in the Store Expense cube named Amount. You
create only one measure because the Account dimension contains various
expense and revenue accounts that aggregate based on a rollup column.
The amount column in the expense_fact table is the source of the Amount
measure. You define the measure when you initially create the Store Expense
cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 7: Case Study—Creating the Store Expense Cube 7

Lab A: Building the Store Expense Cube


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will create a
new cube, Store Expense,
from start to finish.

Explain the lab objectives.


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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


8 Module 7: Case Study—Creating the Store Expense Cube

For More Information


This module uses the Analysis Manager to create a new cube with several
dimensions. For more information, see the following references.

The Dimension Editor


For more information about 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 with Microsoft SQL Server 2000.

The Cube Editor


For more information about using the Cube Editor interface, see module 6,
"Working with Cubes and Measures," in course 2074A, Designing and
Implementing OLAP Solutions with Microsoft SQL Server 2000.

Estimated time to complete this lab: 30 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 7: Case Study—Creating the Store Expense Cube 9

Exercise 1
Creating the Store Expense Cube
In this exercise, you will create a new cube, Store Expense, which contains six
dimensions with varying specifications, levels, and structures. You will process
the cube and 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 More Information section of the lab.
If you still cannot determine the proper steps for a single procedure, refer to the
corresponding answer files, which are located in:
C:\Moc\2074A\Labfiles\L07\Answers

! To create a new database


1. In Analysis Manager, create a new database, and then name the database
Module 07.
2. Create a new data source in Module 07, and then connect to the SQL Server
2000 database, Module 07.

! To create a new cube


1. In the Module 07 OLAP database, create a new cube containing one
measure, Amount, and containing the following six dimensions:
• Scenario
• Time
• Store
• Store Manager
• Account
• Department

Tip To determine the tables and columns to include in the dimensions,


browse the dimension tables in either Analysis Manager or SQL Server
Enterprise Manager.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


10 Module 7: Case Study—Creating the Store Expense Cube

Use the following table to create the dimensions with various dimension
specifications.
Dimension Name Dimension Type Levels/Members

Scenario Shared One level with four


members: Adjustment for
Budget input, Current
Year’s Actuals, Current
Year’s Budget, Forecast
Time Private Three levels: Year,
Quarter, Month
Store Shared Four levels: Store
Country, Store State,
Store City, Store Name
Store Manager Private One level: Store Manager
Account Shared Parent-child hierarchy
with Account Description
member names
Department Shared Three levels: Area,
Department, Position

2. Name the cube Store Expense.


3. Process the cube, without defining aggregations or storage mode.

! To verify cube results


1. In the cube browser, verify that you retrieve $2,527.11 for the following
member combination:
• Current Year’s Actuals
• Davis store manager
• Permanent Store Positions department
• WA stores
• Quarter 1, 2000
• Net Income
• Amount
2. Save the Store Expense cube, and then close the Cube Editor or Cube
Browser, depending on the currently opened window.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 7: Case Study—Creating the Store Expense Cube 11

Demonstration: Reviewing 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 In this demonstration, you will view and discuss the solutions of lab A.
demonstration are included
in the Instructor Notes.

Encourage students to
follow along with the
demonstration by comparing
their Store Expense cube
to the archived version that
you demonstrate.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


12 Module 7: Case Study—Creating the Store Expense Cube

Updating the Store Expense Cube


Topic Objective
To describe the
modifications that students ! Updating the Dimensions
will make to the Store
Expense cube. $ Scenario
Lead-in $ Time
In lab B, you will make
several modifications to the $ Store
Store Expense cube.
$ Store Manager
$ Account
! Creating the Dimension
$ Store Type

In lab B, you will make several modifications to the Store Expense cube. You
will make changes to the following dimensions:
! Scenario
! Time
! Store
! Store Manager
! Account
You will update each dimension in either the Dimension Editor or the Cube
Editor, depending on whether the dimension is shared or private. You will
determine the location for updating dimensions. In addition, you will determine
the appropriate properties to change to perform several of the dimension, level,
and member modifications.
Finally, you will create a new dimension, Store Type, which will be a virtual
dimension. You will need to recall the steps for creating virtual dimensions and
for adding virtual dimensions to a cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 7: Case Study—Creating the Store Expense Cube 13

Lab B: Modifying the Store Expense Cube


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will modify
the Store Expense cube by
updating cube dimensions.

Explain the lab objectives.


Objectives
After completing this lab, you will be able to:
! Make changes to existing dimensions.
! Add dimensions to 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.

Lab Setup
To complete this lab, you need to first complete lab A, Building the Store
Expense Cube, found earlier in the module.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


14 Module 7: Case Study—Creating the Store Expense Cube

For More Information


This module uses the Analysis Manager to create a new cube with several
dimensions. For more information, see the following references.

The Dimension Editor


For more information about 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 with Microsoft SQL Server 2000.

The Cube Editor


For more information about using the Cube Editor interface, see module 6,
"Working with Cubes and Measures," in course 2074A, Designing and
Implementing OLAP Solutions with Microsoft SQL Server 2000.

Estimated time to complete this lab: 30 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 7: Case Study—Creating the Store Expense Cube 15

Exercise 1
Modifying the Store Expense Cube
In this exercise, you will update the Store Expense cube, adding a new
dimension, modifying existing dimensions, and verifying results.
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 More Information section of the lab.
If you still cannot determine the proper steps for a single procedure, refer to the
corresponding answer files, which are located in:
C:\Moc\2074A\Labfiles\L07\Answers

! To update the Scenario dimension


1. In the Module 07 database in Analysis Manager, expand the Shared
Dimensions folder, right-click Scenario, and then click Browse Dimension
Data.
2. Notice the member All Scenario.
It does not make sense to have an All member in the Scenario dimension,
because the four Scenario members do not add up to a meaningful value.
3. Remove the All Scenario member from the Scenario dimension.

! To update the Time dimension


• Remove the All Time member from the Time dimension.

! To update the Store dimension


1. Open the Dimension Editor for the dimension Store.
2. Browse the dimension in the Data pane and then notice the two Mexico
members:

The Store dimension does not organize Mexico into states or provinces.
Therefore, the member Mexico repeats in the Store State level to verify that
the dimension is balanced.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


16 Module 7: Case Study—Creating the Store Expense Cube

3. Apply a level property to suppress the second Mexico in the Store


dimension.

Tip The Dimension Editor reflects the hiding of the member. However, to
see whether a member is hidden in the Cube Editor, you must perform a
specific browsing technique. To browse the Store dimension in the Cube
Editor to see if the second Mexico is suppressed, pivot the Store dimension
to the row area and double-click the level headings, not the individual
members.

4. In the Data pane, expand the Store dimension and notice the member names
at the Store Name level.
Currently, the member names at the Store Name level do not present
descriptive information. An analyst may not know that Store 9 is located in
Mexico City. You will update the member name to include the city name in
addition to the store name.
5. Update the Store Name level so that the member names include the city
name and the store name. The format of the member names should be:
CityName – StoreName
6. Click the Tools menu, and then click Process Dimension.
7. Save the dimension, rebuild the dimension structure, close the Process
dialog box, and then close the Dimension Editor.

! To update the Store Manager dimension


1. Add a new level to the Store Manager dimension, First Letter, which
groups the store managers by the first letter of their names.
The dimension should look like the following:

2. After adding the new level, notice the members with no names at both levels
of the dimension.
3. Apply level settings to suppress the members with no names.
\

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 7: Case Study—Creating the Store Expense Cube 17

! To create the Store Type dimension


1. Create a new dimension, Store Type, as a virtual dimension containing one
level, Store Type.
2. Add Store Type to the Store Expense cube.

! To evaluate the Account dimension


1. In the Cube Editor for Store Expense, process the cube without defining
aggregations or storage mode.
2. Verify that you retrieve $373,823.44 for the following member
combination:
• Current Year’s Actuals
• All Store Manager
• All Department
• All Store
• All Store Type
• 2000
• Net Income
• Amount
3. Why is the amount $373,823.44 incorrect for this member combination?
The Account dimension is summing Total Expense, when it should be
subtracting Total Expense from Net Sales to calculate Net Income.

! To update the Account dimension


1. Open the Dimension Editor for the Account dimension.
2. Browse the dimension and notice how all members aggregate.
The problem with the Account dimension exists because all account
members sum up to Net Income. However, you can use a column called
account_rollup to define how each of the members should aggregate.
3. Browse the dimension table, account, to view the account_rollup values.
4. Update the Account dimension to use the account_rollup column to define
how each member aggregates in the dimension.
5. Modify a level property so that the Account members appear in the same
order as the account id column values.
6. Remove the All Account member from the Account dimension.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


18 Module 7: Case Study—Creating the Store Expense Cube

! To verify cube results


1. In the Cube Editor for Store Expense, process the cube without defining
aggregations or storage mode.
2. In the Data pane, verify that you retrieve $847.20 for the following member
combination:
• Current Year’s Actuals
• Store managers that begin with S
• All Department
• All Store Type
• San Francisco – Store 14
• 2000
• Total Expense
• Amount
3. Verify that you retrieve $10,272.00 for the following member combination:
• Current Year’s Actuals
• Store managers that begin with B
• All Department
• All Store
• Supermarket store type
• 2000
• Total Expense
• Amount
4. Verify that you retrieve negative $373,823.44 for the following member
combination:
• Current Year’s Actuals
• All Store Manager
• All Department
• All Store
• All Store Type
• 2000
• Net Income
• Amount
The value is negative because the Net Income member is equal to Net Sales
minus Total Expense, and the cube does not contain data for Net Sales.
5. Save the Store Expense cube, and then close the Cube Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 7: Case Study—Creating the Store Expense Cube 19

Demonstration: Reviewing Lab B


Topic Objective
To demonstrate solutions to
lab B.
Lead-in
In this demonstration, you
will view and discuss the
solutions to lab B.

Delivery Tips In this demonstration, you will view and discuss the solutions of lab B.
The steps for this
demonstration are included
in the Instructor Notes.

Encourage students to
follow along with the
demonstration by comparing
their Store Expense cube
to the archived version that
you demonstrate.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


20 Module 7: Case Study—Creating the Store Expense Cube

Review
Topic Objective
To reinforce module
objectives by reviewing key
points. ! Building the Store Expense Cube
Lead-in ! Updating the Store Expense Cube
The review questions cover
some of the key concepts
taught in the module.

1. In what interface does Analysis Manager automatically create Member Key


Column values and Level Types for Time dimensions built from
Date/Time columns?
The Dimension Wizard.

2. What are the steps for creating a virtual dimension from a member property
and adding the virtual dimension to a cube?
You first add the member property to a dimension.
Next, you create the virtual dimension from the member property by
using the Dimension Wizard.
Finally, you add the virtual dimension to the cube in the Cube Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 8: Managing
Storage and
Optimization
Contents

Overview 1
Analysis Server Cube Storage 2
The Storage Design Wizard 10
Analysis Server Aggregations 17
Lab A: Designing Storage for Sales 23
Usage-Based Optimization 28
Lab B: Implementing Usage-Based
Optimization 35
Optimization Tuning 39
Review 41
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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 8: Managing Storage and Optimization iii

Instructor Notes
Presentation: This module provides students with a comprehensive understanding of
70 Minutes Microsoft® SQL Server™ Analysis Services storage options and optimization
techniques for online analytical processing (OLAP) cubes. The characteristics
Labs: of the three storage modes—multidimensional OLAP (MOLAP), relational
20 Minutes OLAP (ROLAP), and hybrid OLAP (HOLAP)—are reviewed in detail
followed by an overview of aggregations. The module then takes students
through the Storage Design Wizard with discussion of specific aggregation
options and further discussion of the contents of aggregations and design
guidelines. The module concludes with a review of usage-based optimization
and general optimization tuning techniques.
There are two labs in the module. In lab A, students create a storage design and
process a cube by using the Storage Design Wizard. In lab B, students learn the
interfaces and mechanics of usage-based optimization.
After completing this module, students will be able to:
! Explain the advantages and disadvantages of the three data storage modes.
! Use the Storage Design Wizard to set storage design.
! Describe how aggregations work and design aggregations for cubes.
! Describe the concepts and mechanics of usage-based optimization.
! Override aggregation settings per dimension.

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_08.ppt

Preparation Tasks
To prepare for this module, you should:
! Read all the student materials.
! Read all the instructor notes and margin notes.
! Practice the lecture presentation and demonstration.
! Complete the labs.
! 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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


iv Module 8: Managing Storage and Optimization

Demonstration: Designing Storage for the Sales Cube


In this demonstration, you will learn how to create a storage design by using the
Demonstration: Storage Design Wizard.
10 Minutes
The following demonstration procedures contain information that does 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, find and click the file
C:\Moc\2074A\Labfiles\L08\Module 08.CAB, click Open, and then click
Restore.
2. Click Close, and then double-click Module 08 to expand the database.
3. Below Module 08, double-click Data Sources, right-click the Module 08
data source, and then click Edit.
4. Click the Connection tab of the Data Link Properties dialog box, and then
verify that localhost is selected in step 1.
5. In step 2, verify that Use Windows NT Integrated security is selected.
6. In step 3, verify that Module 08 is selected.
7. Click Test Connection and verify that the test succeeded. Click OK twice.

! To specify storage type


1. In the Module 08 database, right-click the Sales cube and click Design
Storage.
2. Click Next to skip the welcome page.
3. From the Select the type of data storage step, click MOLAP, and then
click Next.

! To design aggregations
1. In the Set aggregation options step, click Performance gain reaches from
the Aggregation options pane.
2. Type 20 in the percent box for Performance gain reaches to reflect a 20-
percent aggregation target.
For the Sales cube, the default value of 50 is unnecessarily high.
3. Click Start to initiate the graphical simulation of Performance vs. Size on
the Set aggregation options step, and then click Next.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 8: Managing Storage and Optimization v

! To process the cube


1. In the Finish the Storage Design Wizard step and with the Process now
option clicked, click Finish.
Regardless of the processing option you choose, Analysis Manager stores
the definition of the aggregations in the OLAP repository. Storing the
definition of the aggregations is different from physically creating them,
however. The Storage Design Wizard designs aggregations but does not
create them. The Analysis Server does not create aggregations until you
process the cube. Processing the cube automatically creates any
aggregations that have been designed.
2. Close the Process dialog box when processing is complete.

! To examine the metadata


1. In Analysis Manager, click the Sales cube in the Analysis Manager tree
pane and then click Metadata in the right details pane.
2. Scroll down and notice the process and storage mode statistics.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


vi Module 8: Managing Storage and Optimization

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. If ROLAP is slow to process and query, why would an organization use this
option?
ROLAP would be adopted if the organization needs a real-time OLAP
solution—that is, data is always updated with the current fact table
values.
In this scenario, an organization defines its cube as ROLAP with zero
aggregations. All detail and aggregate data are calculated as users
query the cube. While queries are slow, in some situations perfectly
updated data is more important than fast query times.
2. Do Analysis Services MOLAP cubes have the “data explosion” problem
common to OLAP solutions?
MOLAP database engines in competing products often create cubes
that grow exponentially from source files to fully calculated cubes. For
example, a five-megabyte (MB) source file has been known to grow into
a five-gigabyte (GB) cube after processing.
The data explosion problem when using MOLAP in Analysis Services
does not exist to the extent experienced with other OLAP products. In
many cases, the MOLAP cube may be smaller than the data source.
The following are the principal reasons for the MOLAP storage
efficiency:
• Analysis Services MOLAP cubes are completely dense in their data
storage—that is, no null values are stored.
• The Analysis Services query engine is highly optimized, calculating
commonly accessed aggregations as the cube is queried so that fewer
aggregations need to be precalculated and stored.
• The Analysis Services data compression algorithms are highly
efficient.
Some multidimensional products presumably solve the data explosion
problem by not using an OLAP engine, instead accessing data directly
from a relational database.
Such products classify themselves as ROLAP solutions because they
access relational databases directly and give users a multidimensional
view of the data, but do not create cubes that consume large amounts of
storage. Such ROLAP solutions typically suffer in query performance
compared to MOLAP solutions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 8: Managing Storage and Optimization vii

3. MOLAP cubes duplicate the detail data already stored in relational tables.
How can MOLAP storage be more efficient than ROLAP cube storage?
How can MOLAP be faster to process than ROLAP if Analysis Services
brings all the detail data to the Analysis Server?
Multidimensional structures and data are extremely compressed and
optimized compared to the two-dimensional tables in relational
databases. In addition, when defining ROLAP cubes, indexes are
automatically created in the relational database management system
(RDBMS).
Even though MOLAP cubes carry over the detail data, they can still be
smaller than their ROLAP cube counterparts. The exception is a
ROLAP cube that has few or no aggregations.
From a processing standpoint, it may be faster to create a
multidimensional structure than to create, insert, and update data in
relational tables. It also may take a long time to build the indexes that
are automatically created in ROLAP cubes. Again, the exception is
when the ROLAP cube has few or no aggregations defined.
4. If processing time and disk space are not constraints, should aggregations be
set to 100 percent for Performance gains reaches?
If Performance gains reaches is set to 100 percent, all a cube’s possible
aggregations will not necessarily be computed. The setting simply
targets that query performance will be potentially increased by 100
percent.
As a cube defines more aggregations, query performance improvements
reach a point of diminishing returns. Some cubes may slow in their
query performance if the aggregation percentage is set too high.
5. How does one estimate the size of a cube based on fact table size?
You can estimate the data storage for MOLAP data on disk in bytes,
assuming zero aggregations, by using the following formula:
(((2 * total number of levels) + (4 * number of measures)) * number of
records) / 3
6. Analysis Services has intelligent algorithms for determining the most
optimized aggregation design. Why would you choose to override the
dimension level aggregations?
In most cases, you use the Storage Design Wizard and the Usage-Based
Optimization Wizard to define aggregations. However, there may be
exceptional situations in which you might want to exercise control,
overriding wizard algorithms.
For example, you might not want your cube to contain aggregations for
the lowest level of the Product dimension, because users will not be
accessing data at that level. Therefore, you have the ability to turn off
aggregations for this level.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


viii Module 8: Managing Storage and Optimization

Module Strategy
Use the following strategy to present this module:
! Analysis Server Cube Storage
Deliver an overview discussion of general server storage issues and then
talk through the characteristics of each of the three storage modes—
MOLAP, ROLAP, and HOLAP. This discussion leads into a basic
introduction to the concept of aggregations.
! The Storage Design Wizard
The materials in this section can be delivered as lecture by using the slides
or integrated with the demonstration Design Storage for the Sales Cube.
Because the demonstration essentially duplicates the materials in the student
notes, it is recommended to integrate lecture and demonstration.
The following table is a mapping of lecture topics to demonstration steps.
Lecture Topic Demonstration Procedure

Choose Storage Option To specify storage type


Set Aggregation Options To design aggregations
How Much Aggregation? To design aggregations
Estimated Storage Reaches To design aggregations
Performance Gain Reaches To design aggregations
Until I Click Stop To design aggregations
Finishing Up To examine the metadata and browse
the cube

There will be substantial interest and questions from students about the
storage size and performance implications of choosing from each of the
three storage methods. Do not rush through these materials or limit
discussion and questions. Review the questions and answers in the previous
Difficult Questions section.
Be prepared to discuss elements of aggregation again, including the specific
functioning of the three aggregation options—Estimated storage reaches,
Performance gain reaches, and Until I click stop. These three choices
represent different conceptual approaches and specific underlying
algorithms for implementing aggregations.
! Analysis Server Aggregations
The subject of aggregation is explored in more detail, including review of
aggregation tables, general characteristics of aggregations, and details about
ROLAP aggregations. Because students must thoroughly understand the
concepts and wizard implementation of aggregations, the subject is
approached repeatedly in this module at increasing levels of detail and
sophistication.
Lab A follows the aggregation details section. Students now have an
opportunity to create storage designs of their own based on MOLAP and
ROLAP storage modes. The lab essentially replicates the steps performed in
the demonstration.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 8: Managing Storage and Optimization ix

! Usage-Based Optimization
This section presents an important feature set of Analysis Services—usage-
based optimization. Your lecture, following the materials in the student
notes, takes students through the simple Usage-Based Optimization Wizard.
Be prepared to answer detailed questions about how each of the five query
options work by themselves and in conjunction with each other.
The section is followed by lab B, Implementing Usage-Based Optimization,
which can be conducted as a hands-on exercise with students following your
demonstration. The lab allows students to perform their own usage-based
optimizations.
! Optimization Tuning
You complete the module with a discussion of specific optimization tuning
methods, including how to override dimension and level settings. No
exercises or labs are included in this section. However, you should switch to
Analysis Manager to show the settings and to briefly explain their functions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 8: Managing Storage and Optimization 1

Overview
Topic Objective
To provide an overview of
the module topics and ! Analysis Server Cube Storage
objectives.
Lead-in ! The Storage Design Wizard
In this module, you will learn
about aggregation design
! Analysis Server Aggregations
and storage modes, which ! Usage-Based Optimization
are the key factors in
enabling fast query ! Optimization Tuning
response times.

Query performance—how long it takes a user to access requested


information—is a primary determining factor for online analytical processing
(OLAP) cube storage design. An optimal design produces fast queries for users
while maintaining reasonable cube processing times. Designing the storage
mode and aggregations for a cube is one of the most crucial steps in cube
development.
After completing this module, you will be able to:
! Explain the advantages and disadvantages of the three data storage modes.
! Use the Storage Design Wizard to set storage design.
! Describe how aggregations work and design aggregations for cubes.
! Describe the concepts and mechanics of usage-based optimization.
! Override aggregation settings per dimension.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


2 Module 8: Managing Storage and Optimization

# Analysis Server Cube Storage


Topic Objective
To introduce Analysis
Services storage options.
Lead-in
Analysis Services supports
three storage options:
MOLAP, ROLAP, and
HOLAP.

Microsoft® SQL Server™ 2000 Analysis Services supports three storage


Delivery Tips options:
Avoid going into too much
detail on the three storage ! Multidimensional OLAP (MOLAP)
modes here. Wait until the
following slides. ! Relational OLAP (ROLAP)
! Hybrid OLAP (HOLAP)
Point out that in the
preceding illustration, Aggs Cube developers design the storage for cubes. The storage design of a cube is
stands for aggregations. transparent to clients—users do not realize that different cubes have different
storage designs.
The following list contains descriptions of some key characteristics of cube
storage modes:
! The storage mode is transparent to clients. Users and client applications see
only cubes. For users, the only indication of the storage mode is their
observations of query performance.
! The storage mode can be changed after the initial storage decision is made.
Once you specify storage and put a cube into production, you can change to
a different storage type later. After you change the mode, you must
reprocess the cube and then Analysis Server reloads the data and creates
new aggregations.
! Each partition of a cube can have a different storage mode. A cube can
consist of multiple partitions. One cube might have both a MOLAP partition
and a ROLAP partition.

Note For more information about partitions, see module 10, “Managing
Partitions,” in course 2074A, Designing and Implementing OLAP Solutions
with Microsoft SQL Server 2000.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 8: Managing Storage and Optimization 3

! Analysis Server does not allocate storage for missing values. For example, if
no bikinis are sold in Antarctica, no space is allocated to that missing value.
Because missing values take up no storage, cubes are 100 percent dense—
that is, all storage is efficiently used. This characteristic of Analysis Server
helps avoid the data explosion problems of other OLAP products.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


4 Module 8: Managing Storage and Optimization

MOLAP Storage Mode

Topic Objective
To describe the
characteristics of MOLAP
storage.
Lead-in
In MOLAP cubes, detailed
data and aggregations are
stored in a multidimensional
format on the Analysis ! Details and Aggregations Stored in Multidimensional
Server. Format
! Fastest Storage Option for Queries
! Often the Most Efficient in Terms of Disk Storage, Due
to Compression

The following list contains characteristics of MOLAP storage:

Delivery Tips ! Detailed data and aggregations are stored in a multidimensional format on
Tell students that you the Analysis Server.
design cubes as MOLAP the • Because the detail data from the fact table is brought into Analysis
vast majority of the time
because of the fast query
Server for storage, data is duplicated.
times, processing times, and • The level of detail imported into a cube is based on the grain of the
efficient storage of MOLAP cube’s dimensions. For example, if the fact table contains daily data
cubes. records, but the grain of the cube time dimension is month, the cube will
contain data at a month level. The fact table daily records are combined
Point out that Aggs stands
for aggregations in the
at cube processing time.
preceding illustration. • After a MOLAP cube is processed, all data necessary for querying is
located on the Analysis Server. The source relational database
management system (RDBMS) is not accessed other than at processing
time.
! MOLAP cubes have the fastest query performance for users.
! MOLAP is a very economical mode in terms of disk storage, due to efficient
data compression algorithms.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 8: Managing Storage and Optimization 5

ROLAP Storage Mode


Topic Objective
To describe the
characteristics of ROLAP
storage.
Lead-in
The following are
characteristics of ROLAP
storage.

! Details and Aggregations ! Analysis Server Can Create


Stored in RDBMS Indexed Views
! Slowest Query Performance ! Useful for Large Data Sources
! Most Often the Slowest to ! Provides Real-Time OLAP
Process Solution

The following are characteristics of ROLAP storage:


! Detailed data and aggregations are stored in relational tables in the source
Key Point database.
Aggregation tables must be
stored in the same RDBMS • RDBMS indexes are automatically created in the data source to improve
as the data source of a cube performance.
cube.
• All queries, other than those satisfied by the client or server caches, must
access the source RDBMS tables.

Delivery Tip ! Under most circumstances, ROLAP cubes are much slower in query
Point out that Aggs stands performance than MOLAP cube equivalents.
for aggregations in the ! ROLAP cubes are usually the slowest to process, unless the ROLAP cubes
preceding illustration. contain few aggregations.
! When assigning the ROLAP storage mode to cubes that have data sources
defined in SQL Server 2000 databases, the Analysis Server attempts to
create indexed views instead of tables, assuming certain criteria are met in
the data source.
! You use the ROLAP storage mode when the data source is too large to be
stored and processed effectively in MOLAP or HOLAP.
! You use the ROLAP storage mode when you require a real-time OLAP
solution.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


6 Module 8: Managing Storage and Optimization

Creating Real-Time Cubes


Some cubes require immediate refreshing of data when changes occur in the
data source. However, by using standard cubes, you are forced to reprocess
cubes when data changes in the underlying database. To overcome the delay of
data updates, you have the ability to create real-time OLAP cubes in Analysis
Services.
You create a real-time cube by performing the following steps:
! Define the cube by using the ROLAP storage mode.
! Select the Enable real-time updates check box in the Select the type of
data storage page in the Storage Design Wizard.

Real-Time Cube Behavior


The following behavior occurs in real-time cubes:
! The Analysis Server polls the database to determine if changes have been
made to the data source.
! The Analysis Server flushes the server cache after it detects any database
changes to ensure that clients do not query outdated data.
! Cube data automatically refreshes when fact table data changes.

Real-Time Criteria
ROLAP cubes must meet certain criteria before they can behave as real-time
cubes:
! Cubes must contain zero aggregations or must store aggregations in SQL
Server 2000 indexed views.
! Cube partitions cannot be defined as real-time partitions if they are remote
partitions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 8: Managing Storage and Optimization 7

HOLAP Storage Mode

Topic Objective
To describe the
characteristics of HOLAP
storage.
Lead-in
The following are
characteristics of HOLAP
storage.

! Details Maintained in RDBMS


! Aggregations Created in Multidimensional Format
! Good Option where Disk Consumption Is a Concern
! Good Compromise if Details Are Accessed Infrequently

The following are characteristics of HOLAP storage:


! Detailed data is maintained in the RDBMS.
Delivery Tip
Point out that Aggs stands ! Aggregations are created in the multidimensional cube format and are stored
for aggregations in the on the Analysis Server.
preceding illustration. ! Because detailed data is not duplicated, HOLAP is a reasonable storage
compromise where disk consumption is a concern.
! In a situation when users do not frequently access the details stored in the
RDBMS and the cube contains a high degree of aggregation, HOLAP is a
good option for cube storage.
Most cubes use MOLAP as the cube storage mode. However, you can define a
cube with a HOLAP design to use less cube storage than if the cube used the
MOLAP storage design. The following are effects of using the HOLAP design
in cubes:
! Queries are not as slow as in a ROLAP cube, nor as fast as in a MOLAP
cube.
! Processing time for a HOLAP cube is similar to processing time for a
MOLAP cube.
• The same amount of data is read from disk into memory for both
HOLAP and MOLAP cube types.
• The only processing difference between MOLAP and HOLAP cubes is
the writing of detail data to the Analysis Server for MOLAP cubes. This
process does not add significant processing time because the data has
already been read into memory.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


8 Module 8: Managing Storage and Optimization

Cube Aggregations

Topic Objective
To explain aggregation ! Full Aggregation Not Necessary
topics.
! Effects on Cube Size and Processing Time
Lead-in
Aggregations are $ Cube size and processing times increase as
precalculated summaries of aggregations are added to a cube
detailed data that enable
Analysis Server to answer ! Tools for Implementing Aggregations
queries quickly.
$ Storage Design Wizard
$ Usage-Based Optimization Wizard
$ Dimension and level aggregation properties

Aggregations are precalculated summaries of detailed data that enable Analysis


Delivery Tip Server to answer queries quickly. Cubes contain aggregations designed with the
Use the preceding
illustration to introduce
Storage Design Wizard or with the Usage-Based Optimization Wizard.
aggregations, stepping Precalculated aggregations are fundamental to OLAP cubes, making user
through the bullets on the
queries significantly faster than calculating aggregations at query time.
slide. Point out that there
are more sections covering
Accessing aggregations is transparent to users and client applications. The
aggregations later in the Analysis Server accesses aggregations automatically.
module.
Note A cube can contain multiple partitions. Aggregations can be designed
like a cube’s storage mode, on a partition-by-partition basis. For more
information about partitions, see module 10, “Managing Partitions,” in course
2074A, Designing and Implementing OLAP Solutions with Microsoft SQL
Server 2000.

Full Aggregation Not Necessary


It is not necessary to fully aggregate a cube in Analysis Services. Analysis
Server utilizes a variety of algorithms to optimize data access, thereby
eliminating the need for total cube aggregation.
If an aggregation does not exist to satisfy a query containing summarized data,
Analysis Server does not need to query the lowest level of data. Instead, the
server uses an intermediate aggregation, if one exists, to satisfy the query.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 8: Managing Storage and Optimization 9

Here is an example of how Analysis Server uses an intermediate aggregation to


satisfy a query:
! Assume a hierarchy for the Time dimension consisting of the levels Year,
Quarter, and Month. Aggregations exist for Quarter but not for Year.
! When a user queries the Year level, the server does not access Month level
data to calculate the yearly totals. Instead, the server derives the totals from
the quarter totals that are already aggregated.

Effects on Cube Size and Processing Time


Cube size increases as aggregations are added to a cube. In addition, processing
times increase because pre-aggregations are calculated at process time.

Note Long processing times tend to be more detrimental to an OLAP


application’s success than large cube sizes. Disk space is inexpensive compared
to time lost waiting for a cube to process.

Size of the cube depends on several factors:


! The number of aggregations
! The number of dimensions
! The number of levels
! The number of measures
! The number of members
! The data distribution of the cube
When designing aggregations, the goal is to maximize query performance while
maintaining reasonable cube sizes and processing times.

Tools for Implementing Aggregations


In the following sections, you will learn about three tools available to you for
implementing aggregations:
! Storage Design Wizard
! Usage-Based Optimization Wizard
! Dimension and Level aggregation properties

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


10 Module 8: Managing Storage and Optimization

# The Storage Design Wizard

Topic Objective
To introduce the steps
involved in using the ! Choosing a Storage Mode
Storage Design Wizard.
! Setting Aggregation Options
Lead-in
The Storage Design Wizard ! Determining the Level of Aggregation
is the interface that lets you
specify the storage mode ! Finishing Up
and aggregation design.

The Storage Design Wizard is the interface that lets you specify the storage
Delivery Tip mode and aggregation design. The next section introduces the steps involved in
Integrate this content into
the demonstration
using the Storage Design Wizard to design storage modes and aggregations:
Designing Storage for the ! Choosing a storage mode
Sales Cube as an effective
method of presenting the ! Setting aggregation options
material.
! Determining the level of aggregation
! Finishing up

There are two entry points into the Storage Design Wizard:
! After building or modifying a cube, you are prompted to set storage options.
You start the wizard by clicking Yes.
! Right-click a cube or a partition in a cube, and then click Design Storage.

The user interface of the Storage Design Wizard differs depending on:
! Whether storage has been designed previously for the cube.
! Whether the cube contains partitions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 8: Managing Storage and Optimization 11

Choosing a Storage Mode

Topic Objective
To review storage options.
Lead-in
At the first real step of the
wizard, you must specify the
storage type.

At the first step of the wizard, you must specify the storage type: MOLAP,
ROLAP, or HOLAP. The selected storage mode determines query performance,
processing performance, and cube storage. Therefore, you must determine the
appropriate storage mode before starting the Storage Design Wizard.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


12 Module 8: Managing Storage and Optimization

Setting Aggregation Options

Topic Objective
To show the aggregation
design step of the Storage
Design Wizard.
Lead-in
The next step of the Storage
Design Wizard allows you to
design aggregations for the
cube or partition.

The next step of the Storage Design Wizard allows you to design aggregations
Key Points for the cube or partition. Three design options are available as radio button
The Performance Gain choices. The design options are as follows:
Reaches option is the most
helpful method for designing ! Estimated storage reaches
aggregations.
! Performance gain reaches
No one specific percentage ! Until I click Stop
works best for all cubes.
Every cube is different and The following characteristics apply to all three options:
requires testing to find the
optimal aggregation ! Regardless of aggregation option, the dimensional hierarchies are navigated
percentage. The best and aggregations are built where the greatest performance benefits will be
method of determining the realized based on the number of members at a given level.
optimal percentage is to test
various settings for their ! Aggregations are calculated when the cube is processed or refreshed and
effects on the query and when incremental data is added to the cube—not during the aggregation
cube processing times. design.
! Aggregation design is per partition. A single cube can consist of multiple
partitions, and each partition can have a different aggregation design.

Note At the stage in which you design aggregations in the Storage Design
Wizard, aggregations are designed, not calculated. The aggregation design is
stored in the metadata repository. Only when the cube is processed are actual
aggregations built.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 8: Managing Storage and Optimization 13

Estimated Storage Reaches


The Estimated storage reaches option is determined by disk space usage,
specified in megabytes (MB). With this option, aggregations are designed until
they consume the specified amount of disk space or until 100 percent
aggregation is attained.

Performance Gain Reaches


The entry in the Performance gain reaches box represents the percentage
improvement between the maximum and minimum query times as represented
by the formula:
PercentGain = 100 * (QTimeMAX - QTimeTARGET) /
(QTimeMAX - QTimeMIN)

For example, if a nonoptimized query takes 22 seconds to execute


(QTimeMAX), and the best possible query performance with maximum
aggregations is 2 seconds (QTimeMIN), you would specify a 75 percent desired
performance gain to achieve a query time of seven seconds (QTimeTARGET).
Use this setting as a relative rather than an absolute gauge. A recommended
practice is to start with a low value—for example, enter 10 percent. If queries to
the cube are too slow, increase the setting to a higher level—for example, 20
percent. If queries are still too slow, repeat the process.

Note The more aggregations a cube contains, the greater the amount of time
required to process the cube. Excessive aggregation of a large cube can lead to
unacceptable processing times.

As you increase the performance percentage, you quickly reach a level of


diminishing returns, consuming large amounts of disk storage in exchange for
nominal query performance benefit. For example, the number of aggregations
required to reach 10 percent optimization is fewer—sometimes by an order of
magnitude—than the number of aggregations required to improve from 10
percent to 20 percent.
In general, you gain little by setting the Performance gain reaches option
higher than 50 percent. Ten percent to 30 percent is adequate for most
applications.
The following is recommended practice for implementing Performance gain
reaches:
1. Enter a low percentage, record the processing time, and then gauge retrieval
performance through testing.
2. Enter a higher percentage, again recording processing time and testing
performance.
3. Repeat this procedure until an optimum balance between processing time
and retrieve performance is achieved for your business need.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


14 Module 8: Managing Storage and Optimization

Until I Click Stop


With the Until I click Stop option, the system designs aggregations until one of
the following two situations occurs:
! You literally click Stop as you watch a simulation of your aggregation
design take place in the Performance vs. Size box
! A 100-percent performance gain is reached without clicking Stop
You should click Stop when the curve of the line in the Performance vs. Size
box starts to level at an acceptable performance gain.

Note The Until I click Stop and Estimated storage reaches options are not
very helpful and potentially misleading when designing aggregations. Use the
Performance gain reaches option for the best results.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 8: Managing Storage and Optimization 15

Determining the Level of Aggregation


Topic Objective
To explain how much
aggregation is necessary.
Lead-in
Here are some guidelines
to help you determine how
much aggregation is
generally necessary.

Because Analysis Server uses aggregations intelligently, it is unnecessary to


create aggregations for all possible combinations of data. A common mistake is
over-aggregation.
The following are two important guidelines to follow when designing
aggregations:
! Due to the speed of MOLAP data retrieval, MOLAP generally requires less
aggregation.
! Due to the relative slowness of ROLAP retrieval, ROLAP generally requires
more aggregation.
The key to defining aggregations is identifying when you have reached a point
of diminishing returns. Testing is necessary to find that point for each cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


16 Module 8: Managing Storage and Optimization

Finishing Up

Topic Objective
To show the options offered
at the last step of the
Storage Design Wizard.
Lead-in
At the last step of the
Storage Design Wizard, you
have four options.

You have four options at the last step of the Storage Design Wizard:
! Process now. Writes the aggregation metadata to the repository, and then
processes the cube.
! Save, but don’t process now. Writes the aggregation metadata to the
repository, but does not process the cube or build the actual aggregations.
! Cancel. Discards all inputs to the Storage Design Wizard.
! Back. Allows you to go back to previous steps to change inputs.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 8: Managing Storage and Optimization 17

# Analysis Server Aggregations

Topic Objective
To introduce the topic of
server aggregations. ! Contents of an Aggregation
Lead-in ! Aggregation Generalities
Now let us define the term
aggregation in greater
detail.

Aggregations are precalculated summaries of detailed data that enable Analysis


Server to answer queries quickly. While you can easily create a cube without
aggregations, aggregations make a significant difference in query times.
As with storage modes, aggregations are transparent to client applications.
Regardless of the number aggregations you design, the cube always appears to
contain every possible aggregated value. When you request a value from a
cube, Analysis Services uses whatever aggregations are available to retrieve the
value as quickly as possible.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


18 Module 8: Managing Storage and Optimization

Contents of an Aggregation

Topic Objective
To show an example of one
aggregation.
Lead-in
ROLAP aggregation tables
give us the opportunity to
visualize exactly what is
contained in a single
aggregation.

ROLAP is the one storage option that stores aggregations in the source
RDBMS. Therefore, it is useful to look at ROLAP aggregation tables to learn
For Your Information about the structure of Analysis Server aggregations.
Students create and view
ROLAP aggregations in lab Aggregation Table Example
A: Designing Storage.
You can examine ROLAP aggregations created for a cube. The preceding
illustration is an aggregation table created by Analysis Server for the Sales
cube. It represents one aggregation.
There are three reasons for you to view a ROLAP aggregation table:
! The table provides insight into ROLAP structures.
! The table provides a general understanding of Analysis Server aggregations.
! You cannot easily view MOLAP aggregation schemas.

Note A single aggregation is not simply a single value. It represents


aggregated values for a certain combination of levels.

You access aggregation tables by searching in the cube data source for new
tables that have the name format of cubename_partitionname_N, where N is a
set of alphanumeric characters meaningful to the Analysis Server.

Note The property Aggregation Prefix is available in the Cube Editor to


define a prefix for your ROLAP cube aggregation tables, instead of using the
default cubename_partitionname.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 8: Managing Storage and Optimization 19

Aggregation Table Naming Conventions


Following are naming conventions for aggregation tables:
! Column names contain the level name plus the letter L followed by a
number. The number corresponds to the level’s placement in the cube. For
example, Category_L4 is the Category level of the Product dimension that
happens to be the fourth sequential level of the cube—including the All
levels.
! The column names for measures use a prefix that denotes the aggregation
type. For example, SUM_SalesDollars contains the SalesDollars measure
that has the SUM aggregation method applied to it.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


20 Module 8: Managing Storage and Optimization

Aggregation Generalities
! General Characteristics of Aggregations
Topic Objective
To explain general $ Are created when a cube is processed
characteristics of
aggregations. $ Include all measures
Lead-in $ Cannot generally be designed for specific members
Let us go over some
characteristics of $ Can be designed on a partition-by-partition basis
aggregations.
$ Are built and maintained automatically
! Characteristics of ROLAP Aggregations
$ Are automatically indexed
$ Require write permission to the RDBMS
$ Increase query performance

Aggregations have several characteristics that apply to their design and


maintenance. For example, all aggregations are created at cube processing time
and contain all cube measures. You will now review the characteristics of
aggregations and gain a deeper understanding of their mechanics.

General Characteristics of Aggregations


Following are general characteristics of aggregations:
! Aggregations are calculated when a cube is processed, refreshed, or
incrementally updated.
! A single aggregation always includes all cube measures except calculated
members.
! There is no capability for designing aggregations for specific members of a
cube—for example, aggregating United States at 25 percent and Europe at
10 percent is not possible. There is one important exception: Cubes can be
partitioned by slice. For example, region West can reside in one partition,
and region Europe can reside in another partition.
! Aggregations can be designed on a partition-by-partition basis.
! Analysis Server builds and maintains aggregations automatically based on
the aggregation design.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 8: Managing Storage and Optimization 21

Characteristics of ROLAP Aggregations


The following characteristics are specific to ROLAP aggregations:
! The tables are automatically indexed.
! Analysis Server must have write permission to the source RDBMS in order
to build the aggregations.
! Because ROLAP storage is slower than MOLAP storage, the query
performance for ROLAP cubes benefits from a higher degree of
aggregation.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


22 Module 8: Managing Storage and Optimization

Demonstration: Designing Storage for the Sales Cube

Topic Objective
To demonstrate the design
of a cube’s storage mode so
that students become
familiar with the interface.
Lead-in
Let us see an example of
storage design by using the
Sales cube.

In this demonstration, you will learn how to create a storage design by using the
Delivery Tips Storage Design Wizard.
Deliver this demonstration
integrating the previous
lecture materials, which
cover details of the Storage
Wizard.

The steps for this


demonstration are included
in the Instructor Notes.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 8: Managing Storage and Optimization 23

Lab A: Designing Storage for Sales

Topic Objective
To introduce the lab.
Lead-in
In this lab, you will design
storage and aggregations
for the Sales cube.

After completing this lab, you will be able to:


Explain the lab objectives.
! Design the storage mode for a cube.
! Modify the storage mode of a cube.

Prerequisites
Before working on this lab, you must have:
! Experience working with cubes.

Estimated time to complete this lab: 10 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


24 Module 8: Managing Storage and Optimization

Exercise 1
Designing Storage for the Sales Cube
In this exercise, you will design storage for the Sales cube by using the
MOLAP storage option. Next, you will process the cube and view the cube
metadata.

! 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\L08\Module
08.CAB, click Open, and then click Restore.
2. Click Close, and then double-click Module 08 to expand the database.
3. Below Module 08, double-click Data Sources, right-click the Module 08
data source, and then click Edit.
4. Click the Connection tab of the Data Link Properties dialog box, and then
verify that localhost is selected in step 1.
5. In step 2, verify that Use Windows NT Integrated security is selected.
6. In step 3, verify that Module 08 is selected.
7. Click Test Connection and verify that the test succeeded. Click OK twice.

! To specify storage type


1. In the Module 08 database, right-click the Sales cube and click Design
Storage.
2. Click Next to skip the welcome page.
3. From the Select the type of data storage step, click MOLAP, and then
click Next.

! To design aggregations
1. In the Set aggregation options step, click Performance gain reaches from
the Aggregation options pane.
2. Type 20 in the percent box for Performance gain reaches, reflecting a 20-
percent aggregation target.
For the Sales cube, the default value of 50 is unnecessarily high.
3. Click Start to initiate the graphical simulation of Performance versus Size
in the Set aggregation options step, and then click Next.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 8: Managing Storage and Optimization 25

! To process the cube


1. In the Finish the Storage Design Wizard step and with the Process now
option clicked, click Finish.
Regardless of the processing option you choose, Analysis Manager stores
the definition of the aggregations in the OLAP repository. Storing the
definition of the aggregations is different from physically creating them,
however. The Storage Design Wizard designs aggregations but does not
create them. The Analysis Server does not create aggregations until you
process the cube. Processing the cube automatically creates any
aggregations that have been designed.
2. Close the Process dialog box when processing is complete.

! To examine the metadata


1. In Analysis Manager, click the Sales cube in the Analysis Manager tree
pane and then click Metadata in the right details pane.
2. Scroll down and notice the process and storage mode statistics.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


26 Module 8: Managing Storage and Optimization

Exercise 2
Modifying the Storage of the Sales Cube
In this exercise, you will update the storage design for the Sales cube. You will
apply the ROLAP storage mode and redesign aggregations. In addition, you
will open SQL Server 2000 Enterprise Manager to view the aggregation tables
created by the cube process.

! To specify storage type


1. In the Module 08 database, right-click the Sales cube and click Design
Storage.
2. Click Next to skip the welcome page.
3. In the Aggregations already exist step, click Replace the existing
aggregations, and then click Next.
Notice that you have the option to add new aggregations to the existing cube
aggregations.
4. From the Select the type of data storage step, click ROLAP, and then
click Next.

! To design aggregations
1. In the Set aggregation options step, click Performance gain reaches from
the Aggregation options pane.
2. Type 30 in the percent box for Performance gain reaches, reflecting a 30-
percent aggregation target.
Because you are changing the storage mode to ROLAP, you will add 10
percent to Performance gain reaches to compensate for the slower query
performance of ROLAP cubes.
3. Click Start to initiate the graphical simulation of Performance vs. Size, and
then click Next.

! To process the cube


1. In the Finish the Storage Design Wizard step and with the Process now
option clicked, click Finish.
2. As the cube processes, notice the creation of tables in the Module 08 data
source.

Note You will notice that you receive an error at the creation of the first
aggregation table. Receiving the error is normal. Analysis Services cannot
create indexed views for the Sales cube aggregations in the Module 08
database. Therefore, Analysis Services creates new tables in the Module 08
database. The error simply notifies you of this situation.

3. Close the Process dialog box when processing is complete.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 8: Managing Storage and Optimization 27

! To view the aggregation tables


1. Click Start, point to Programs, point to Microsoft SQL Server, and then
click Enterprise Manager.
2. In Enterprise Manager, double-click Microsoft SQL Servers, double-click
SQL Server Group, and then double-click the local SQL Server.
It will take a few seconds for Enterprise Manager to connect to the local
SQL Server.
3. Double-click the Databases folder, double-click the Module 08 database,
click Tables, and then notice the tables in the right pane of Enterprise
Manager.
You see the fact table, SalesFact, and all dimension tables. In addition, you
see an aggregation table for each aggregation that the Analysis Server
created when it processed the Sales cube.
Each aggregation table name has the prefix of Sales_Sales_. For each table,
the aggregation table identifier following the prefix contains letters,
numbers, or a combination of the two.
4. Right-click one of the aggregation tables, point to Open Table, and then
click Return all rows.
You see various dimension levels in the table, with the last two columns
containing the sum of SalesDollars and SalesUnits.
5. Notice the number at the end of every dimension level in the column names.
The number signifies the number of the level in the cube, starting from the
top dimension to the bottom dimension.
6. Open each of the aggregation tables to compare the different structure of the
tables.
7. Close Enterprise Manager.

! To examine the metadata


1. Switch to Analysis Manager.
2. In Analysis Manager, click the Sales cube in the Analysis Manager tree
pane, and then click Metadata in the right details pane.
3. Scroll down and notice the updated process and storage mode statistics.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


28 Module 8: Managing Storage and Optimization

# Usage-Based Optimization

Topic Objective
To introduce the concept of
usage-based optimization. ! Working with the Usage-Based Optimization Wizard
Lead-in ! Using the Query Log
A very important feature of
Analysis Server is usage- ! Factoring the Server Cache
based optimization.

Algorithms in the Storage Design Wizard are sophisticated, but results are
based solely on structural factors, such as the number of rows in a fact table or
the number of members in different levels of a dimension.
The Storage Design Wizard cannot take into account the way that users perform
a particular query or the frequency of data access. However, Analysis Services
provides a separate tool for doing just that—usage-based optimization.
Usage-based optimization allows aggregations to be built based on patterns
established from actual queries submitted to the server. Query performance is
optimized to reflect the usage patterns of real world users.
The next section introduces the following topics:
! Working with the Usage-Based Optimization Wizard
! Using the query log
! Factoring the server cache

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 8: Managing Storage and Optimization 29

Working with the Usage-Based Optimization Wizard

Topic Objective
To describe the Usage-
Based Optimization Wizard.
Lead-in
The Usage-Based
Optimization Wizard
simplifies the optimization of
queries.

The Usage-Based Optimization Wizard is used to design aggregations based on


Delivery Tip a sampling of user queries.
Take students through a
thorough discussion of
these query-driven criteria. Displaying the Usage-Based Optimization Wizard
Challenge them to relate the To display the Usage-Based Optimization Wizard, right-click a cube or
options to what would and partition and click Usage-Based Optimization. The wizard contains a variety
would not be relevant to
of methods to create aggregations based on logged queries.
their own user analysis
patterns.
Using Query-Driven Criteria
There are several query-driven criteria from which you may choose to optimize
the cube. The following table describes these choices.
Criterion Action

Queries for the dates Optimizes queries for a specified range of


dates.
Queries that took longer than Optimizes queries that took longer than a
specified amount of time.

Queries by these users Optimizes queries that are performed by


specified users or user groups.
Queries that ran more than Optimizes queries that are executed more
than the specified number of times.

Queries to Optimizes queries for specific locations:


MOLAP cubes, ROLAP cubes, or the server
cache.

When selecting from these query options, you may choose a single criterion or
multiple criteria. If you choose multiple criteria, only those queries that satisfy
all the specified criteria are optimized.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


30 Module 8: Managing Storage and Optimization

Finishing with the Wizard


After you choose the queries that you want optimized, you are given the
opportunity to preview the aggregations that will be built.
After clicking Next again, the wizard mirrors the Storage Design Wizard. You
can add aggregations to the existing aggregations or replace them. If you choose
to replace them and click Next, you are given the option of changing the storage
mode—that is, MOLAP, ROLAP, or HOLAP.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 8: Managing Storage and Optimization 31

Using the Query Log

Topic Objective ! Populating the Usage Log


To describe the usage of the
query log. $ The server logs one out of ten queries by default
Lead-in $ You can change the query sampling rate
Usage-based optimization is
possible because the query
! Accessing the Usage Log
log keeps track of queries $ You can view reports in Analysis Manager
made to the server.
$ You can open the file msmdqlog.mdb
! Modifying the Cube Structure
$ If you update the cube structure, query log entries may
be invalid
$ You can clear or filter the contents of the query log in
Analysis Manager

Usage patterns are captured in a query log. The query log is a Microsoft Access
Delivery Tip database named msmdqlog.mdb located in the folder containing the Analysis
Access the query log in
Analysis Manager through
Services executable files.
Usage Analysis.
Populating the Usage Log
By default, the server logs one out of each ten queries. You may want to change
this sampling rate.
To change the server log setting, perform the following steps:
1. Right-click the server in Analysis Manager and click Properties.
2. On the Logging tab, update the box with the new sampling rate.

Note Changes made to server properties take effect only when the server is
stopped and restarted.

Queries that can be answered by the client cache are not recorded on the server
and thus are not logged. To clear the client cache, you must disconnect from the
database.

Accessing the Usage Log


Access the usage log by right-clicking the cube and clicking Usage Analysis in
Analysis Manager. Here you have access to several preformatted reports.
Because the query log is stored in an Access table in a logical format, custom
applications can read the log to analyze usage.
The Dataset column in the log requires explanation. The column contains a
string of numbers that represents the granularity, or level number, for each
dimension. Because a dimension can have more than nine levels, ASCII values
ten through N are used to represent levels greater than nine.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


32 Module 8: Managing Storage and Optimization

Modifying the Cube Structure


When queries are processed, this activity causes queries to be written to the
query log. If you change the cube structure, the query log will contain invalid
entries and may potentially cause errors when you attempt usage-based
optimization.
Two preventive measures are available to help you avoid this problem:
! Clear the query log after the cube structure is modified.
! In the Usage-Based Optimization Wizard, filter out queries that occurred
before the time of the cube modification.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 8: Managing Storage and Optimization 33

Factoring the Server Cache

Topic Objective
To describe the use of The
server cache check box. ! Queries to the Server Cache
Lead-in ! Query Caching Example
Consider selecting The
server cache check box
when performing usage-
based optimization.

The query you execute most frequently may not be the query that is most in
Key Point
need of aggregations. The reason is that data values needed for frequently
By selecting The server
cache check box, you accessed queries are kept in the server and client caches. Any summary values
ensure that frequently already calculated for queries exist in caches and no aggregations must be
accessed queries are accessed at query time.
optimized for users, even
when the queries are not Note Both PivotTable® Service and the Analysis Server maintain caches on
found in client or server the client and on the server, respectively.
caches and therefore data is
retrieved from the server.
Queries to the Server Cache
Selecting The server cache check box, part of the Queries To pane in the
Usage-Based Optimization Wizard, ensures that any queries found in the server
cache will be included during usage-based optimization. By selecting this check
box, you ensure that frequently accessed queries are optimized for users.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


34 Module 8: Managing Storage and Optimization

Query Caching Example


The following example demonstrates the situation in which a frequently
accessed query would have no data in the caches.
You have just started the server, so no data exists in the cache. This is true
because the server cache empties each time the server is stopped.
The following series of activities illustrates query-caching behavior:
! User A submits a query that is frequently submitted by many users in the
organization.
! No aggregations exist on the server to satisfy the query. Therefore, all
summary data values are calculated at query time. This causes the query to
be slow.
! The query results are automatically cached on the server and on the client
cache.
! User B submits the same query. Because the results are cached on the
server, the query executes quickly.
Frequently executed queries derive limited benefit from optimization, with the
exception of the first time a frequently accessed query is executed after server
caches have been refreshed. This is why you would use The server cache
setting on the Usage-Based Optimization dialog. Select this checkbox to
include commonly queried data in your usage-based optimization.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 8: Managing Storage and Optimization 35

Lab B: Implementing Usage-Based Optimization

Topic Objective
To perform usage-based
optimization.
Lead-in
In this lab, you will design
and optimize storage and
create usage analysis
reports.

Explain the lab objectives.


Objectives
After completing this lab, you will be able to:
! Change sampling frequency.
! Create usage analysis reports.
! Implement usage-based optimization.

Prerequisites
To complete this lab, you need to complete of lab A, Designing Storage for
Sales, found earlier in this module.

Estimated time to complete this lab: 10 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


36 Module 8: Managing Storage and Optimization

Exercise 1
Changing Sampling Frequency
In this exercise, you will change the query log sampling frequency and restart
the server.
Delivery Tip Analysis Server writes queries to a query log. The query log is the basis for
You may want to execute usage-based optimization. By default, one out of ten queries are written to the
this exercise and the
log. There is a server property that controls this sampling frequency. You are
following two exercises as
an instructor-led going to change the setting now, so that the log will be populated when you
demonstration with students perform Usage Based Optimization.
following on their own
computers. ! To change the sampling frequency
1. In the Analysis Manager tree pane, right-click the local server icon, and then
click Properties.
2. Click the Logging tab, type 1 in the Write to log once per box, and then
click OK.
3. Click OK when warned that the change will not take place until you stop
and restart the server.

! To restart the server


Server properties are recognized when the server is started. For the new
sampling frequency to take effect, the server must be stopped and restarted. In
this procedure, you will restart the server.
1. Close Analysis Manager.
2. Click Start, point to Programs, point to Administrative Tools, and then
click Computer Management.
3. Double-click Services and Applications, and then double-click Services.
4. Scroll down and find MSSQLServerOLAPService in the right pane of the
Computer Management window.
5. Right-click MSSQLServerOLAPService, and then click Restart.
6. After the service restarts, close the Computer Management window.
7. Restart Analysis Manager.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 8: Managing Storage and Optimization 37

Exercise 2
Creating Usage Analysis Reports
You cannot perform usage-based optimization without recording usage
activities. In this exercise, you will populate the usage log, and will then view
usage analysis reports.

! To populate the usage log


In this procedure, you browse the Module 08 Sales cube to populate the query
log for the Sales cube. Each manipulation of the cube generates a new query to
the server.
1. In Analysis Manager, right-click the Module 08 Sales cube, and then click
Browse Data.
2. Spend a few minutes browsing the cube data, taking various actions such as:
• Changing the dimension lists.
• Dragging and dropping dimension tiles to different locations in the Cube
Browser.
• Double-clicking levels with plus signs to drill-down into dimensions.
3. Close the Cube Browser dialog box.

! To view usage analysis reports


1. Right-click the Sales cube and click Usage Analysis to start the Usage
Analysis Wizard.
2. Click Query Run Time Table, and then click Next.
3. Do not specify any criteria, and then click Next.
By not specifying any criteria, you view all queries found in the query log
for the Sales cube.
4. Click Back.
5. Optionally, specify criteria, and then click Next.
6. Review the report.
7. Click Back twice, select the Query Response Graph report type, and then
click Next twice to see the graph.
8. Click Finish to close the Usage Analysis Wizard.
9. Repeat the above steps to view each of the available reports.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


38 Module 8: Managing Storage and Optimization

Exercise 3
Implementing Usage-Based Optimization
In this exercise, you will adjust usage-based optimization for the Sales cube in
the Module 08 database and add new aggregations.

! Enter the usage-based optimization criteria


1. In Analysis Manager, right-click the Sales cube and click Usage-Based
Optimization.
2. Click Next at the Welcome page.
3. Enter the following criteria:
• Select the Queries that ran more than check box.
• Type 1 in the times box and then click Next.
4. Review the report.
5. If no queries exist in the report, click Back and then perform the following
steps:
• Clear the Queries that ran more than check box.
• Select the Queries that took longer than check box, and then click
Next.
• Review the report.
• If no queries exist after updating the criteria, create a report with
Queries that ran more than 0 times.
6. When queries exist on the Review the results step, click Next.

! Add new aggregations and process the cube


1. Click Add new aggregations to the existing ones, and then click Next.
2. At the Set aggregation options step, click Start.
Even though the Estimated storage reaches option is clicked, the wizard
does not design 100 MB of cube data. The number of aggregations designed
equals the number of queries that appeared in the preceding Review the
results step.
3. Click Next, click Process Now, and then click Finish.
You added cube aggregations by performing usage-based optimization. The
new aggregations were designed based on query patterns.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 8: Managing Storage and Optimization 39

Optimization Tuning

Topic Objective
To discuss the available
dimension and level ! Accessing Aggregation Usage
aggregation options.
! Overriding a Dimension
Lead-in
Analysis Services gives you ! Overriding Levels
additional dimension and
level settings for fine-tuning ! Changing Aggregation Properties
aggregations.

Although the Storage Design and the Usage-Based Optimization wizards do an


effective job of tuning the database, there are conditions where additional
No exercises or procedures tuning may be necessary.
are listed for this topic
because aggregation There are settings in the Cube Editor that allow you to override the Storage
overrides are rarely used in Design Wizard and Usage-Based Optimization Wizard on a per-dimension or
production cube per-level basis.
environments.
Accessing Aggregation Usage
In the cube editor, select a dimension and click the Properties pane. When you
click the Advanced tab, you will find the Aggregation Usage property.

Overriding a Dimension
To override the aggregation for a dimension or level, you must first change the
Aggregation Usage property for the dimension. To set the property, choose
from a list containing the choices that are described in the following table.
Setting Result

Standard (All levels) This is the default setting. Each level of


the dimension is eligible to be aggregated.
Top Level Only Only the top level of the dimension will
be aggregated.
Bottom Level Only Creates aggregations for only the lowest
level in the dimension.
Custom Enables the aggregations to be defined on
a per-level basis in the dimension. When
Custom is chosen, the levels are set not to
aggregate until overridden.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


40 Module 8: Managing Storage and Optimization

Overriding Levels
In order to set overrides for specific levels in a dimension other than Top Level
Only or Bottom Level Only, you must set the Aggregation Usage property for
the parent dimension to Custom. This enables the Enable Aggregations
property for the levels.
When the Aggregation Usage property of the parent dimension is set to
Custom, the Enable Aggregations property for all the levels is set to No. You
can then choose which levels should be set to Yes.

Changing Aggregation Properties


Changing the aggregation properties for dimensions and levels does not take
effect until one of two things occurs:
! Aggregations are designed with the Storage Design Wizard.
! Aggregations are designed with the Usage-Based Optimization Wizard.
Both wizards are overridden by dimension and level aggregation properties.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 8: Managing Storage and Optimization 41

Review

Topic Objective
To reinforce module
objectives by reviewing key ! Analysis Server Cube Storage
points
! The Storage Design Wizard
Lead-in
The review questions cover ! Analysis Server Aggregations
some of the key concepts
taught in the module. ! Usage-Based Optimization
! Optimization Tuning

1. List the three storage modes in order of fastest query performance to


slowest. Relate the architecture of each to query performance.
MOLAP, HOLAP, and ROLAP, in this order.
MOLAP is the fastest in terms of query performance because queries
only need to access the multidimensional structures, which are
optimized for fast queries.
HOLAP and ROLAP queries, on the other hand, must access the
underlying RDBMS. Accessing the relational tables adds significant
time to every query.

2. List the three storage modes in order of most to least efficient in data
storage and disk space utilization. Relate the architecture of each to its
storage efficiency.
HOLAP, MOLAP, and ROLAP, in this order.
HOLAP is the most efficient because there is no redundancy of data
storage—that is, detail is stored in the RDBMS and aggregations are
stored in a cube. In addition, HOLAP cubes store aggregations with
multidimensional structures.
MOLAP is the second most efficient because the multidimensional
structures are space-efficient compared to relational tables.
While ROLAP does not require that detail data be duplicated, ROLAP
is less efficient than both HOLAP and MOLAP because it does not take
advantage of the efficient multidimensional structures and relies
exclusively on the RDBMS tables.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


42 Module 8: Managing Storage and Optimization

3. What are the benefits of ROLAP?


You can create a real-time OLAP cube by designing the storage of the
cube as ROLAP.
You use the ROLAP storage mode when the data source is too large to
be stored and processed effectively in MOLAP or HOLAP.

4. Is it possible to design aggregations per dimension member in Analysis


Manager?
No.

5. What is the negative impact of more versus less aggregation?


More aggregation takes up greater disk space and slows down cube
processing. However, more aggregation improves query performance.
Less aggregation reduces disk usage and speeds up processing, but
slows queries.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing
Dimensions and Cubes

Contents

Overview 1
Introducing Dimension and Cube Processing 2
Processing Dimensions 5
Processing Cubes 15
Lab A: Processing Dimensions and Cubes 27
Lab B: Updating Dimension Data 30
Lab C: Incrementally Updating Cubes 36
Optimizing Cube Processing 41
Troubleshooting Cube Processing 49
Review 54
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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes iii

Instructor Notes
Presentation: Multidimensional online analytical processing (OLAP) databases include
75 Minutes schema and data, both of which change and need updating from the relational
database management system (RDBMS) on a regular basis. In this module,
Lab: students learn to manage dimension and cube processing with Microsoft® SQL
75 Minutes Server™ 2000 Analysis Services.
After completing this module, students will be able to:
! Understand the difference between OLAP schema and data.
! Process dimensions.
! Perform the three types of cube processes.
! Optimize cube processing.
! Troubleshoot cube processing.

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 Microsoft PowerPoint® file 2074A_09.ppt

Preparation Tasks
To prepare for this module, you should:
! Read all the student materials.
! Read the instructor notes and margin notes.
! Complete all the demonstrations.
! Practice the lecture presentation and demonstration.
! Complete the lab.
! 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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


iv Module 9: Processing Dimensions and Cubes

Demonstration: Rebuilding the State Dimension


The following demonstration procedures provide information that will not fit in
Demonstration: the margin notes or is not appropriate for student notes.
10 Minutes
In this demonstration, you will rebuild the State dimension and will show
students the impacts to the Sales Units cube after the rebuild.

! 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\L09\Module
09.CAB, click Open, click Restore, and then click Close.
2. Double-click Module 09 to expand the database.
3. Below Module 09, double-click the Data Sources folder, right-click the
Module 09 data source, and then click Edit.
4. Click the Connection tab of the Data Link Properties dialog box, and then
verify that localhost is selected in step 1.
5. In step 2, verify that Use Windows NT Integrated security is selected.
6. In step 3, verify that Module 09 is selected.
7. Click Test Connection and verify that the test succeeded. Click OK twice.

! To browse the Sales Units cube


1. In the Module 09 database, browse the Sales Units cube.
2. Show students that the cube contains two dimensions—State and Time—
and one measure—Sales Units.
3. Point out that the cube is processed and able to accept queries.

! To rebuild the State dimension


1. In the Module 09 database Shared Dimensions folder, right-click the State
dimension, and then click Process.
The Process a Dimension dialog box opens.
Here you see two options for processing a dimension—incrementally
updating the dimension and rebuilding the dimension.
2. Click Rebuild the dimension structure, and then click OK.
The Process dialog box opens and steps through the dimension rebuild.
3. After the dimension finishes processing, double-click the line in the Process
dialog box that begins with a yellow SQL icon.
Here you see the SQL that executes to rebuild the State dimension:
SELECT DISTINCT "dbo"."State"."Country",
"dbo"."State"."Region", "dbo"."State"."STATE_ID",
"dbo"."State"."State_Name" FROM "dbo"."State"

4. Close the View Trace Line window, and then click Close.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes v

! To attempt to browse the Sales Units cube


1. In the Module 09 database, right-click the Sales Units cube, and then click
Browse Data.
2. Notice that you receive the following error:
“Unable to browse the cube ‘Sales Units’. Cube not processed. To browse
sample data for this cube, open Cube Editor, and then on the View menu,
click Data.”
You did not change the State source data, and therefore the dimension did
not require a rebuild. However, if the dimension is rebuilt, the Sales Units
cube is unavailable.
After you rebuild a shared dimension, all cubes containing the shared
dimension are unavailable for user access.
3. Click Close.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


vi Module 9: Processing Dimensions and Cubes

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 are incremental updates useful if the Analysis Server is unaware of
data warehouse loads and it therefore does not know what data to load from
a table?
You can create a column in the fact table that has an identifying record,
such as a time stamp or a batch number. You can include the unique
record in the WHERE clause of the associated partition definition and
filter records based on that identifier.
2. Are multiple partitions of a cube processed sequentially, even if they reside
on different computers?
Yes, unless you specify that you want certain partitions to be built in
parallel. You can do this by using Decision Support Objects (DSO).

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes vii

Module Strategy
Use the following strategy to present this module:
! Introducing Dimension and Cube Processing
Define the term processing and explain that Analysis Server creates SQL
statements to extract information from the data source. Next, define the
terms schema and data as they are used in Analysis Services.
! Processing Dimensions
Explain to students that dimensions must be processed when they are first
designed and whenever there are changes or updates in the source
dimension tables. Describe the interface and the steps to follow to process a
shared dimension. Explain that there are two ways to process a shared
dimension—a rebuild or an incremental update. Describe when to use each
type of processing and the implications of doing so. Explain that private
dimensions are created and manipulated in single cubes, and that to process
a private dimension, the entire cube must be processed. Finally, define
relational OLAP (ROLAP) dimensions and changing dimensions and
explain when to use them.
! Processing Cubes
Begin with an explanation of when to process a cube and how to get to the
Process a Cube dialog box. Describe the three options available in the
dialog box—full process, refresh, and incremental update. Describe when to
use each option and the implications of doing so. Introduce the Incremental
Update Wizard and the steps involved in performing an incremental
update—specifying the data source and specifying the filter expression.
Explain what happens behind the scenes when using a filter. Discuss
available properties that affect cube and dimension processing.
! Optimizing Cube Processing
Explain to students that, while query performance is obviously a high
priority when using OLAP cubes, processing time is also important.
Describe several ways to improve cube processing performance—
optimizing the data source, optimizing the cube schema, optimizing cube
design, and optimizing Analysis Server. Explain how to perform each of
these types of optimization.
! Troubleshooting Cube Processing
Describe the three most common cube problems related to processing—
missing data, processing errors, and insufficient memory and disk space.
Give tips and techniques for solving each type of problem.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 1

Overview
Topic Objective
To provide an overview of
the module topics and
objectives.
! Introducing Dimension and Cube Processing
Lead-in
In this module, you will learn ! Processing Dimensions
about dimension and cube
processing and the various ! Processing Cubes
ways to perform processes.
! Optimizing Cube Processing
! Troubleshooting Cube Processing

Multidimensional online analytical processing (OLAP) databases include


schema and data, both of which change and need updating from the relational
database management system (RDBMS) on a regular basis. In this module, you
will learn to manage Analysis Server dimension and cube processing with
Microsoft® SQL Server™ 2000 Analysis Services.
After completing this module, you will be able to:
! Understand the difference between OLAP schema and data.
! Process dimensions.
! Perform the three types of cube processes.
! Optimize cube processing.
! Troubleshoot cube processing.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


2 Module 9: Processing Dimensions and Cubes

# Introducing Dimension and Cube Processing


Topic Objective
To introduce the concept of
cube and dimension
processing. ! Definition of Processing
Lead-in ! Overview of Schema and Data
In this section, you are
introduced to dimension and
cube processing, and will
learn the difference between
OLAP schema and OLAP
data.

In this section, you are introduced to dimension and cube processing, and will
learn the difference between OLAP schema and OLAP data.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 3

Definition of Processing
Topic Objective
To define the term
processing, as used in
Analysis Services. ! Processing Must Occur Prior to Users Querying the
Lead-in Cube
Before users can access
data from a cube, some
! Dimension Processing Loads Dimension Data
form of processing must ! Cube Processing Loads Cube Data and Creates
occur in the cube.
Aggregations
! Processing Uses SQL Queries to Populate Dimension
and Cube Data

Before users can access data from an OLAP cube, some form of processing
must occur in the cube. In Analysis Services, the term processing means
loading dimensions and cube data from the RDBMS data source.
When you process dimensions and cubes, Analysis Server creates SQL
statements to extract the necessary information from the data warehouse
dimension and fact tables. In addition, Analysis Server creates any aggregations
in the cube that were designed previously.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


4 Module 9: Processing Dimensions and Cubes

Overview of Schema and Data


Topic Objective
To describe the differences
between OLAP schema and
OLAP data. ! OLAP Schema
Lead-in $ Consists of dimensional hierarchies and members
It is important to understand
the difference between the $ Comes from dimension tables
terms schema and data as
they are used in Analysis $ Is commonly referred to as OLAP metadata
Services.
! OLAP Data
$ Consists of numeric information
$ Comes from fact table

To master various dimension and data load processes, it is important to


understand the difference between schema and data. Definitions of the two
terms as used in Analysis Services may differ from what you are accustomed to
when using other databases and technologies.

OLAP Schema
Unlike relational databases, where member names are considered data, member
names in Analysis Services are considered part of the schema.
The following is true of OLAP schema:
! The schema consists of the dimensional hierarchies and the members that
populate these hierarchies.
! OLAP schema comes from the dimension tables in the source RDBMS.
! Member names, for example Quarter 1, Canada, and Bread, are
commonly referred to as OLAP metadata in multidimensional databases.

OLAP Data
The data in Analysis Services is the numeric information, such as units sold,
prices, inventory levels, or dollar revenues.
The following is true of OLAP data:
! This numeric information, or data, is commonly referred to as the measures.
! OLAP data comes from the fact table in the source RDBMS.
Understanding the distinction between schema and data is important for
database administrators and OLAP architects.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 5

# Processing Dimensions
Topic Objective
To introduce dimension
processing.
Lead-in ! Dimension Processing Overview
In this section, you will learn ! Rebuilding Dimensions
about dimension processing
and the various ways of ! Incrementally Updating a Dimension
processing dimensions.
! Processing Private Dimensions
! Understanding ROLAP and Changing Dimensions

A cube consists of one or more dimensions combined with one or more


measures. The dimensions form the structure or organization for the data values
in the cube. Before the Analysis Server can process a cube, it must have already
processed each dimension that is used in the cube.
In this section, you will learn about dimension processing and the various ways
to process dimensions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


6 Module 9: Processing Dimensions and Cubes

Dimension Processing Overview


Topic Objective
To explain the purpose and ! Purpose of Dimension Processing
mechanics of dimension
processing. $ Creates a new dimension
Lead-in $ Maintains an existing dimension
Before data can be loaded
into a cube, you must first ! Shared Dimension Processing Mechanics
create and process the
dimensions of the cube. $ Right-click a single dimension
$ Right-click the Shared Dimensions folder
! The Process Dialog Box
$ Opens at time of dimension process
$ Contains dimension processing information

Before data can be loaded into a cube, you must first create and process the
Key Point dimensions of the cube. Once you process the dimensions, the Analysis Server
Analysis Server creates
multidimensional OLAP
can load data from the fact table into the cube and can create aggregations.
(MOLAP) dimension
structures in the Data folder Purpose of Dimension Processing
located on the server,
You process a dimension when you first create it, when you modify its
except in those cases when
you use ROLAP
structure, and when data updates occur in the source data dimension tables.
dimensions. Non-ROLAP After the initial dimension process, you must maintain dimensions on an
dimensional structures are
ongoing basis to reflect changes in the underlying dimension tables—for
created on the server for
cubes that use the MOLAP,
example, new products are added to the product line, sales representatives
hybrid OLAP (HOLAP), and change sales regions, and so on. Dimensions must reflect the changes in the
relational OLAP (ROLAP) business structure.
storage modes.
Two methods are available to the Analysis Server developer for processing
shared dimensions:

Do not spend too much time ! Rebuild the dimension structure completely rebuilds and constructs a
here describing dimension dimensional structure.
rebuilds and incremental
updates because they are
! Incremental update imports new members into an existing dimensional
discussed in detail later in structure.
this section. Analysis Server creates multidimensional OLAP (MOLAP) dimension
structures in the Data folder located on the server, except in those cases when
you use ROLAP dimensions. Non-ROLAP dimensional structures are created
on the server for cubes that use the MOLAP, hybrid OLAP (HOLAP), and
relational OLAP (ROLAP) storage modes.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 7

Shared Dimension Processing Mechanics


You can initiate the processing of a shared dimension in either of two ways:
! Expand the Shared Dimensions folder, right-click the dimension, and then
click Process to display the Process a Dimension dialog box. This interface
lets you choose between an incremental update and a dimension structure
rebuild.
! Right-click the Shared Dimensions folder and click Process All
Dimensions. There is no choice about which type of process will occur
when you choose this option. The Analysis Server determines the type of
process applied to dimensions by determining which dimensions contain
structure changes and which dimensions maintain their original structure.

The Process Dialog Box


When you process a dimension in Analysis Manager, a Process dialog box
opens that steps through each of the processing phases. The dialog contains the
following information that you can use to troubleshoot errors or determine the
success or failure of the process:
! Start time, end time, and process duration.
! Number of RDBMS rows processed.
! Initialization and committal information.
! SQL statements performed on the RDBMS to access member and
dimension data.
! Information on the success or failure of the dimension build.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


8 Module 9: Processing Dimensions and Cubes

Rebuilding Dimensions
Topic Objective
To describe the process of ! Situations in which to Rebuild a Dimension
rebuilding a dimension.
$ A level is added or deleted
Lead-in
The Rebuild the $ A member is deleted
dimension structure option
entirely recreates the
$ A member is renamed
dimension structure. It is the $ A child is moved from one parent to another
most comprehensive
method for processing ! Implications of Rebuilding a Dimension
dimensions.
$ Dimensional structure is rebuilt
$ Cubes become unavailable to clients until the cubes are
reprocessed
$ Rebuilding takes time

The Rebuild the dimension structure option in the Process a Dimension


dialog box entirely recreates the dimension structure. It is the most
comprehensive method for processing dimensions.

Situations in which to Rebuild a Dimension


The following situations require a rebuild of the dimension structure to reflect
the structural dimension changes:
! Adding or deleting a level.
! Deleting a member.
! Renaming a member.
! Moving a child from one parent to another. This movement is commonly
called re-parenting. For example, if you move a product from one business
unit to another, the dimensional structure must reflect the change.

Implications of Rebuilding a Dimension


Rebuilding a dimension is not a minor action. The following are implications of
rebuilding a shared dimension:
! The Analysis Server erases and rebuilds the dimensional structure that is
stored on the Analysis Server.
! Cubes that depend on the given dimension are unavailable to clients until
the cubes are reprocessed. In other words, clients cannot connect to cubes
that depend on a rebuilt dimension until the cubes are reprocessed.
! The rebuilding of the dimensional structure can be a time-consuming
process if the dimension contains an abundance of members.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 9

Incrementally Updating a Dimension


Topic Objective
To describe dimension ! Situations in which to Incrementally Update a Dimension
incremental updates.
$ Members are added
Lead-in
Incremental updates allow $ Member properties are added
you to add members and
member properties to a ! Implications of Incrementally Updating a Dimension
shared dimension when no
structural changes have $ Cubes remain available
occurred.
$ New members appear
$ Existing members remain intact
$ New associated fact table data requires a cube update

The other option of the Process a Dimension dialog box is Incremental


update. This option allows you to add members and member properties to a
shared dimension when no structural changes have occurred.
Incremental updates do not force a reprocessing of the cube. Therefore, perform
incremental updates of dimensions instead of dimension rebuilds when
possible.

Situations in which to Incrementally Update a Dimension


You can perform incremental updates in the following situations:
! Adding a member to a dimension.
! Adding a member property to a dimension.

Implications of Incrementally Updating a Dimension


Though the implications are not as severe as dimension rebuilds, it is still
important to understand what happens when an incremental update occurs:
! Cubes that use the given dimension are available to clients during this
process.
! The dimension hierarchy reflects the member updates when the incremental
update is complete.
! Existing members are left intact.
! New fact table data associated with the new members requires an
incremental cube update.

Note When you process a cube, you have the option to incrementally update

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


10 Module 9: Processing Dimensions and Cubes

all shared dimensions found in the cube. You do this by selecting the
Incrementally update the shared dimensions used in this cube check box
found in the Process a Cube dialog box.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 11

Processing Private Dimensions


Topic Objective
To discuss the processing of
private dimensions.
Lead-in ! Exist in Single Cubes
In this section, you will learn ! Cannot Be Processed Independently
about private dimension
processing. ! Are Processed When The Cube Is Processed
$ Incremental update of cube
$ Refresh of cube
$ Full process of cube

You create and manipulate private dimensions in single cubes. Because they
exist in single cubes, you do not affect other cubes by processing private
dimensions. Therefore, you can isolate cube-processing needs by defining
dimensions as private.
You cannot process private dimensions without also processing the cubes in
which they reside, and no options or commands exist that process private
dimensions independently.
There are two methods of processing private dimensions:
! Perform an incremental update or a refresh of a cube. An incremental
update or a refresh of a cube performs an incremental update of all private
dimensions in the cube. In other words, an incremental update or a refresh
of a cube adds new members and member properties in private dimensions
in the cube.
! Perform a full process of a cube. A full process of a cube performs a rebuild
of all private dimensions in the cube. In other words, a full process of a cube
updates the structure and all members in private dimensions in the cube.

Note For more information on cube refreshes and full processes, refer to the
next section in this module, Processing Cubes.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


12 Module 9: Processing Dimensions and Cubes

Understanding ROLAP and Changing Dimensions


Topic Objective ! ROLAP Dimensions
To discuss ROLAP and
changing dimensions. $ Store dimension data in dimension tables
Lead-in $ Can support tens of millions of members
You can define dimensions
as being ROLAP or
$ Force you to define their cubes as ROLAP cubes
changing. $ Require SQL Server 2000 Enterprise Edition
$ Are also considered changing dimensions
! Changing Dimensions
$ Are optimized for frequent data source changes
$ Permit more types of changes with incremental updates
$ Include virtual, parent-child, and ROLAP dimensions
$ Are set within the Dimension Editor

When you create a dimension, its structure is stored, by default, in


multidimensional structures on the Analysis Server computer. You maintain its
dimensional structure based on the processing rules presented in the preceding
pages of this section. These dimensions are considered MOLAP dimensions.
Alternatively, you can define dimensions as ROLAP dimensions to allow for
millions of members in your dimension, or you can create changing dimensions
to allow for more frequent changes to the dimension structure.

ROLAP Dimensions
A ROLAP dimension’s data is stored in the dimension table or tables.
Therefore, there is no need to build the multidimensional dimension structures
that MOLAP dimensions create on the Analysis Server.
By defining a dimension as ROLAP, you can maintain a dimension with tens of
millions of members. If you attempt to store tens of millions of members in a
MOLAP dimension, you receive errors when you process the dimension.
Because of the query performance degradation you receive when using ROLAP
dimensions, you usually define a dimension as ROLAP only if the dimension
contains millions of members.
When you add a ROLAP dimension to a cube, the cube must use the ROLAP
option for its cube storage mode. You are not given the option to define the
cube as MOLAP or HOLAP in the Storage Design Wizard.
ROLAP dimensions require SQL Server 2000 Enterprise Edition.
All dimensions that use the ROLAP storage mode are also considered to be
changing dimensions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 13

Changing Dimensions
A changing dimension is optimized for frequent changes. It allows certain types
of changes to be made by using incremental updates instead of rebuilding the
dimension and fully processing the cube. Therefore, users can access the cubes
without interruption when making these changes.
The following types of dimensions are always changing dimensions:
! Virtual dimensions
! Parent-child dimensions
! ROLAP dimensions
You can define any dimension as changing by setting its Changing property to
True in the Properties pane of the Dimension Editor or Cube Editor.
In a changing dimension, because aggregations are not stored at intermediate
dimension levels, levels and members below the top level and above the bottom
level of the dimension can be added, moved, changed, or deleted, and an
incremental update applies the changes when you save the dimension. You do
not need to rebuild the dimension, a process that makes the cube unavailable to
clients during the rebuild process.
Changing dimensions provide for more flexibility in updating dimension
structures. However, queries that use changing dimensions are slower than
queries that use non-changing dimensions.

Note For more information on ROLAP and changing dimensions, see SQL
Server Books Online.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


14 Module 9: Processing Dimensions and Cubes

Demonstration: Rebuilding the State Dimension


Topic Objective
To demonstrate how to
rebuild a dimension.
Lead-in
In this demonstration, you
will learn how to rebuild the
State dimension and will
see the impacts to the Sales
Units cube after the rebuild.

In this demonstration, you will learn how to rebuild the State dimension and
Delivery Tips will see the impacts to the Sales Units cube after the rebuild.
The steps for this
demonstration are included
in the Instructor Notes.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 15

# Processing Cubes
Topic Objective
To introduce cube
processing.
Lead-in ! Cube Processing Overview
After you design a cube, you ! The Full Process
must process the cube to
populate it with data. ! Refreshing a Cube
! Incrementally Updating a Cube
! The Incremental Update Wizard
! Processing Options

The topics in this section are After you design a cube, you must process the cube to populate it with data.
very complex. If students MOLAP cubes, ROLAP cubes, and HOLAP cubes all require processing. There
are confused, tell them that are three different processes for cubes, the mechanics and logic of which are
the following labs contain described in the next section.
exercises that include each
of the processing types.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


16 Module 9: Processing Dimensions and Cubes

Cube Processing Overview


Topic Objective
To introduce the mechanics
of cube processing.
Lead-in ! Cube Processing Mechanics
To contain accurate data, a ! Using the Process Dialog Box
cube must be processed
when the data in the data
warehouse changes.

An OLAP cube is a fast and flexible representation of the information stored in


a data warehouse. When the information in the data warehouse changes, you
must update the cube so that the data in the cube is accurate. Updating an
OLAP cube to accurately represent the relational data warehouse is called
processing the cube. Different types of changes can occur in the data
warehouse, and the Analysis Server provides different techniques for
synchronizing the OLAP cube with the relational data warehouse.

Cube Processing Mechanics


To initiate cube processing, right-click a cube and then click Process to display
the Process a Cube dialog box. Here, you decide if you want to perform an
incremental update, a data refresh, or a full process.

Using the Process Dialog Box


When you process a cube in Analysis Manager, the process dialog box opens
with processing information. This is the same dialog you saw earlier when
processing dimensions. However, there are more steps documented. These
include:
! Start time, end time, and duration of entire process, as well as the times and
duration of each of the steps of the process.
! Number of RDBMS rows processed at each step.
! Initialization and committal information.
! SQL statements used to access data from the RDBMS.
! Statistics on aggregations created.
! Information on the success or failure of the process.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 17

The Full Process


Topic Objective
To describe when to ! Situations in which to Perform a Full Process
perform a full process and $ The cube is new
the implications of doing so.
$ A dimension is added or deleted
Lead-in
A full process is the most $ A dimension is rebuilt
comprehensive cube
process you can perform. $ A measure is added, deleted, or modified
! Implications of Performing a Full Process
$ Cube data, including aggregations, is erased and rebuilt
$ Dependent virtual cubes become unavailable until reprocessed
$ Partition data is read into the cube from the data source
$ Private dimensions and changed shared dimensions are rebuilt

A full process is the most comprehensive cube process you can perform. To
initiate a process, click the third option in the Process a Cube dialog box. All
cube structures and cube data is rebuilt.

Situations to Perform a Full Process


Because a full process is the most time consuming method of processing, it is
important to understand the situations that require a full process. These include:
! Creating a new cube.
! Adding or deleting dimensions.
! Rebuilding any shared dimension belonging to the cube.
! Adding, deleting, or modifying cube measures.

Implications of Performing a Full Process


The following are important implications of performing a full process on a
cube:
! If the cube is MOLAP, it is erased and rebuilt.
! Regardless of cube storage—MOLAP, ROLAP, or HOLAP—aggregations
are erased and rebuilt.
! Any virtual cubes based on the cube are unavailable after the process until
they are reprocessed themselves.
! All partition data is read into the cube from the RDBMS data sources.
! All private dimensions are rebuilt.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


18 Module 9: Processing Dimensions and Cubes

! If a shared dimension belonging to the cube has been modified structurally


and needs to be rebuilt, the dimension will automatically rebuild when the
cube is processed. All other cubes that use the same shared dimension will
not be available again until they have each been reprocessed.
! If an error occurs, the operation is rolled back.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 19

Refreshing a Cube
Topic Objective
To describe when to refresh ! Situations in which to Refresh a Cube
a cube and the implications
of doing so. $ Source data has changed
Lead-in $ Data has been duplicated
Refreshing a cube erases all
data and repopulates the
! Implications of Refreshing a Cube
cube by reading the data $ Data is erased and then replaced, in MOLAP cubes
from the RDBMS data
source. $ Aggregations are cleared and then recalculated
$ Shared dimension structures remain unchanged
$ Cube remains available
$ Virtual cubes remain available
$ The operation rolls back if an error occurs

Refreshing a cube erases all data and repopulates the cube by reading the data
from the RDBMS data source. The cube structure does not change when you
perform a cube refresh.

Situations in which to Refresh a Cube


A cube can be refreshed in the following situations:
! The source data of a cube has changed in the RDBMS but the structure of
the cube is the same.
Tell students that duplication ! An incorrectly performed incremental update causes cube data to be
of data due to an incorrectly duplicated.
performed incremental
update will be discussed in Implications of Refreshing a Cube
the next section.
Although a cube refresh is not as major a procedure as a full process, it is still
important to understand the implications of refreshing a cube:
! If the cube is MOLAP, the detailed data is erased and the cube is
repopulated from the source RDBMS.
! All aggregations are cleared and recalculated.
! Shared dimension structures are unchanged, and private dimensions are
incrementally updated.
! The original cube is available to clients during the refresh. Once the refresh
is complete, clients see the new data.
! Virtual cubes based on the cube are available to clients during the refresh.
! If an error occurs, the operation is rolled back.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


20 Module 9: Processing Dimensions and Cubes

Incrementally Updating a Cube


Topic Objective
To describe when to ! Situations in Which to ! Implications of Incrementally
incrementally update a cube Perform an Incremental Updating a Cube
and the implications of doing
Update
so. $ New data is imported into
$ New data is added to the MOLAP cubes
Lead-in fact table
An incremental update is the $ No detail data movement in
process by which you add $ Data is needed temporarily ROLAP and HOLAP cubes
new data to your cube on a from a different fact table
$ All aggregations are updated
periodic basis.
$ Existing source data has
not changed $ Cubes remain available

$ Cube structure has not $ Different fact tables can be


changed used
$ Filters can be defined

An incremental update is the process by which you add new data to a cube on a
Key Point periodic basis. It is the least time-consuming method of processing a cube
The Incremental Update
Wizard cannot determine
because it retains the existing data in the cube and adds only the data you select.
new fact table data. However, you must understand the mechanics of cube incremental updates to
Therefore, you must define avoid incorrectly duplicating data.
what is new in the data
source. If you incorrectly Situations in Which to Perform an Incremental Update
define new data, you risk
creating incorrect values in Incremental updates can occur if the following are true:
the cube.
! New data is added to the fact table.
! New data is needed temporarily from a different fact table.

Note To include data from a different fact table permanently, create a new
partition in the cube. For information on partitions, see module 10,
“Managing Partitions,” in course 2074A, Designing and Implementing
OLAP Solutions with Microsoft SQL Server 2000.

! The underlying source data has not changed.


! There are no structural changes made to cubes, partitions, or dimensions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 21

Implications of Incrementally Updating a Cube


An incremental update produces the following results:
! For MOLAP cubes, new detailed data is imported into the cube—old data is
unaffected.
! For ROLAP and HOLAP cubes, since detailed data is already stored in the
source RDBMS, there is no movement of detailed data.
! For all storage options—MOLAP, ROLAP, and HOLAP—aggregations are
updated.
! Private dimensions included in the cube are incrementally updated.
! Clients can work with the cube and dependent virtual cubes while the
incremental update is in process. Once completed, clients see new data.
! If an error occurs, the operation is rolled back.
! You can define a different fact table in the Incremental Update Wizard. By
defining a different fact table, you add the data in the new fact table to the
existing cube data.
! Filters can be defined in the Incremental Update Wizard to further specify
the data to be loaded into your cube. Filters are SQL statements that are
passed to your RDBMS.

Important The Incremental Update Wizard does not have a method for
determining new fact table data. Therefore, you must define what is new in the
data source. By incorrectly defining new data, you risk creating incorrect values
in your cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


22 Module 9: Processing Dimensions and Cubes

The Incremental Update Wizard


Topic Objective
To introduce the
Incremental Update Wizard.
Lead-in ! Specifying the Data Source
The Incremental Update ! Specifying the Filter Expression
Wizard allows you to specify
exactly where the new data ! Understanding Filters
is coming from.

By clicking Incremental update as your processing method, the Incremental


Delivery Tip Update Wizard appears.
Open the Incremental
Update Wizard by right- This wizard allows you to specify exactly where the new data is coming from.
clicking a cube and clicking In cubes containing multiple partitions, you define which partition is to be
Process. Click Incremental
updated.
Update and then click Next.
Step through the wizard to You can also define a filter to specify exactly what data from a fact table will be
describe the required loaded into your cube.
components of an
incremental update, but do Incremental updates to cubes are made simple in Analysis Services with the
not click Finish at the end of Incremental Update Wizard. The wizard takes you through the setup of an
the wizard. incremental update. This section describes each of the steps.

Specifying the Data Source


The first step when performing an incremental cube update is to specify where
the new data comes from:
1. Click Change to display the Choose a Fact Table dialog.
The available data sources are listed in the left pane. Only the data sources
that have been defined previously in the current Analysis Server database
are listed.
2. Expand the data source to display the tables and then choose the fact table
containing the incremental data.
The columns belonging to the selected table are displayed in the right pane.
This is for information purposes only.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 23

Specifying the Filter Expression


Having chosen a database and fact table, the next step is to specify the filter
expression in the form of an SQL WHERE expression. This is done without
explicitly including the keyword WHERE.
The filter expression determines which rows from the fact table will be
imported into the cube.
Here is the basic syntax of the filter expression:
“ColumnName” = value
“TableName”.”ColumnName” = value (where value specifies the data you
need).
The accuracy of the filter expression is important. Analysis Server has no
mechanism for ensuring that the data you import through the incremental
update wizard has not already been imported in whole or in part. A mistake can
cause cube data to be duplicated.

Understanding Filters
This is what happens behind the scenes when you use a filter:
! The expression you enter becomes part of a WHERE clause.
! The WHERE clause in turn is part of an SQL SELECT statement.
! The SQL statement passes through to the particular relational database
without a syntax check by Analysis Server.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


24 Module 9: Processing Dimensions and Cubes

Processing Options
Topic Objective
To describe available cube
and dimension processing
properties. ! Source Table Filter
Lead-in ! Processing Optimization Mode
You have access to several
properties that affect cube ! Stop Processing on Key Errors
and dimension processing.
! Key Error Limit
! Key Error Log File
! Processing Log File

You have access to several properties that affect cube and dimension
Delivery Tip processing. In addition, you can enable log files that store processing
Switch to Analysis Manager,
and show students how to
information and errors. You set the properties and log files in Analysis
access each property as Manager.
you describe it.
Source Table Filter
In the Cube and Dimension Editors, you can set the Source Table Filter
property for cubes and dimensions. The Source Table Filter property contains
an expression included in the WHERE clause of the SQL query that filters the
data loaded into the cube or dimension. The expression that you add is an
expression used in the WHERE clause, without explicitly including the
command WHERE.
For example, to include only the Canada member and its descendants in a
dimension, type the following in the dimension’s Source Table Filter:
“store”.”store_country” = ‘Canada’

You set the Source Table Filter in the Advanced tab of the Properties pane in
the Cube Editor or the Dimension Editor. In the Cube Editor, the Source Table
Filter limits fact table records included in the cube. In the Dimension Editor,
the Source Table Filter limits members included in the dimension.
The Source Table Filter box does not check the syntax of the expression.

Caution Always verify that the syntax you enter to define the filter is correct
so that you do not produce duplicated data.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 25

Processing Optimization Mode


The Processing Optimization Mode property of a cube determines how
Analysis Server processes a cube. You set the Processing Optimization Mode
property either in the Advanced tab of the Properties pane in the Cube Editor,
or in the Cube Processing Settings dialog box after clicking Settings in the
Process a Cube dialog box.
When you select Regular as the value for the Processing Optimization Mode
property, users cannot query a cube until the fact table data is loaded into the
cube and all designed aggregations are created. If you select Lazy
Aggregations for the Processing Optimization Mode property, users can
query the cube after the fact table data is loaded into the cube, and before all
aggregations are created.
When using Lazy Aggregations, the cube aggregations are calculated after
users have the ability to connect to the cube. The advantage of using Lazy
Aggregations is that users have immediate access to cube data after the fact
table data is loaded into the cube and before the Analysis Server calculates
aggregations. The disadvantage of using Lazy Aggregations is that users
experience slower queries than when all aggregations are previously calculated.

Stop Processing on Key Errors


The Stop Processing on Key Errors property determines how Analysis Server
handles errors as it processes a cube. You set the Stop Processing on Key
Errors property in the Advanced tab of the Properties pane in the Cube Editor,
or in the Cube Processing Settings dialog box after clicking Settings in the
Process a Cube dialog box.
When you select Yes as the value for the Stop Processing on Key Errors
property, cube processing stops when the specified limit for the number of
dimension key errors is exceeded. When you select No as the value, cube
processing does not stop if Analysis Server encounters any number of
dimension key errors.

Key Error Limit


The Key Error Limit property determines the limit for the number of
dimension key errors for a cube. You set the Key Error Limit property in the
Advanced tab of the Properties pane in the Cube Editor, or in the Cube
Processing Settings dialog box after clicking Settings in the Process a Cube
dialog box. The default value for the Key Error Limit is zero.
If the Key Error Limit is exceeded when Analysis Server processes a cube and
the Stop Processing on Key Errors value is Yes, cube processing stops.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


26 Module 9: Processing Dimensions and Cubes

Key Error Log File


The Key Error Log File property provides the path and file name of the log
file created for any dimension key errors encountered during cube processing.
You set the Key Error Log File property in the Advanced tab of the Properties
pane in the Cube Editor, or in the Cube Processing Settings dialog box after
clicking Settings in the Process a Cube dialog box.

Processing Log File


The processing log file logs all processing messages occurring on a single
Analysis Server. You enable the processing log file by right-clicking the server,
clicking Properties, clicking the Logging tab, and selecting the Log
processing messages to a file check box. You also define the path and file
name for the processing log file. General Analysis Server status and error
messages relating to processing appends to the file. To view detailed processing
errors, you must enable the Key Error Log File property.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 27

Lab A: Processing Dimensions and Cubes


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will rebuild
the State dimension and
perform a full process of the
Sales Units cube.

Explain the lab objectives.


Objectives
After completing this lab, you will be able to:
! Rebuild a dimension.
! Perform a full process of a cube.

Prerequisites
Before working on this lab, you must have:
! Experience working with Analysis Manager.
! An understanding of dimensions and cubes.

Estimated time to complete this lab: 15 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


28 Module 9: Processing Dimensions and Cubes

Exercise 1
Processing State and Sales Units
In this exercise, you will rebuild the State dimension and perform a full process
of the Sales Units cube.

! 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\L09\Module
09.CAB, click Open, click Restore, and then click Close.
2. Double-click Module 09 to expand the database.
3. Below Module 09, double-click the Data Sources folder, right-click the
Module 09 data source, and then click Edit.
4. Click the Connection tab of the Data Link Properties dialog box, and then
verify that localhost is selected in step 1.
5. In step 2, verify that Use Windows NT Integrated security is selected.
6. In step 3, verify that Module 09 is selected.
7. Click Test Connection and verify that the test succeeded. Click OK twice.

! To browse the Sales Units cube


1. In the Module 09 database, browse the Sales Units cube.
The cube contains two dimensions—State and Time—and one measure—
Sales Units.
The cube is processed and able to accept queries.
2. Close the Cube Browser dialog box.

! To rebuild the State dimension


1. In the Module 09 database Shared Dimensions folder, right-click the State
dimension, and then click Process.
The Process a Dimension dialog box opens.
Here you see two options for processing a dimension—incrementally
updating the dimension and rebuilding the dimension.
2. Click Rebuild the dimension structure, and then click OK.
The Process dialog box opens and steps through the dimension rebuild.
3. After the dimension finishes processing, double-click the line in the Process
dialog box that begins with a yellow SQL icon.
Here you see the SQL that executes to rebuild the State dimension:
SELECT DISTINCT "dbo"."State"."Country",
"dbo"."State"."Region", "dbo"."State"."STATE_ID",
"dbo"."State"."State_Name" FROM "dbo"."State"

4. Close the View Trace Line window, and then click Close.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 29

! To attempt to browse the Sales Units cube


1. In the Module 09 database, right-click the Sales Units cube, and then click
Browse Data.
2. Notice that you receive the following error:
“Unable to browse the cube ‘Sales Units’. Cube not processed. To browse
sample data for this cube, open Cube Editor, and then on the View menu,
click Data.”
You did not change the State source data, and therefore the dimension did
not require a rebuild. However, if you perform a rebuild of the dimension,
the Sales Units cube is unavailable.
After you rebuild a shared dimension, all cubes containing the shared
dimension are unavailable for user access.
3. Click Close.

! To perform a full process


1. Right-click the Sales Units cube, and then click Process.
2. Notice that the Full Process option is selected, and then click OK.
3. After the cube finishes processing, close the Process dialog box.
4. Verify that you can browse the Sales Units cube.
5. Notice that the Sales Units ROLAP cube is also unavailable.
Why is Sales Units ROLAP unavailable?
Sales Units ROLAP also contains the State dimension. Therefore, the
cube is unavailable until you perform a full process of Sales Units
ROLAP.
____________________________________________________________

____________________________________________________________

6. Perform a full process of the Sales Units ROLAP cube.


7. Browse Sales Units ROLAP to verify that the cube is available.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


30 Module 9: Processing Dimensions and Cubes

Lab B: Updating Dimension Data


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will make
changes to the data in the
State dimension table and
see how the updates affect
the dimension and cube
data.

Explain the lab objectives.


Objectives
After completing this lab, you will be able to:
! Incrementally update dimensions.
! Refresh cube data.

Prerequisites
Before working on this lab, you must have:
! Experience working with Analysis Manager.
! An understanding of dimensions and cubes.
! An understanding of cube storage.
! Completed lab A, Processing Dimensions and Cubes, found earlier in the
module.

Estimated time to complete this lab: 30 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 31

Exercise 1
Adding the Jalisco State
In this exercise, you will add the Mexican state Jalisco to the State dimension
table by using SQL Server Enterprise Manager. After you add the new state,
you will see how the update to the data source affects the State dimension and
the Sales Units cube.

! To add the Jalisco state


1. Click Start, point to Programs, point to Microsoft SQL Server, and then
click Enterprise Manager.
Enterprise Manager, the administrative interface for SQL Server 2000,
opens. You will update the Module 09 data source in Enterprise Manager.
2. Double-click Microsoft SQL Servers, double-click SQL Server Group,
and then double-click the local SQL Server.
It will take a few moments for Enterprise Manager to connect to the local
SQL Server.
3. Double-click the Databases folder, double-click Module 09, and, below the
Module 09 database, click Tables.
The database tables appear in the right pane of Enterprise Manager.
4. Right-click the State table, point to Open Table, and then click Return all
rows.
You see the data in the State table. The table contains four fields—
State_ID, State_Name, Region, and Country.
5. Add one record to the State table containing the data found in the following
table for the four table fields.
State_ID State_Name Region Country

7 Jalisco Mexico West Mexico


Coast

6. Close the State table.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


32 Module 9: Processing Dimensions and Cubes

! To add a sales units fact record for Jalisco


1. In Enterprise Manager, right-click the Salesfact table, point to Open Table,
and then click Return all rows.
You see the data in the Salesfact table. The table contains three fields—
Month_ID, State_ID, and Sales_Units
2. Scroll down to the bottom of the Salesfact table.
3. Add one record to the Salesfact table containing the data found in the
following table for the three table fields.
Month_ID State_ID Sales_Units

22 7 1000

4. Close the Salesfact table.


You added a new state, Jalisco, to the State table. In addition, you added a
value for Sales Units for Jalisco. You will now return to Analysis Manager
and see how the update to the data source affects the Sales Units cube and
dimension data.

! To update the State dimension


1. Switch to Analysis Manager, and leave Enterprise Manager open.
2. In the Module 09 database, browse the Sales Units cube, drill down into the
State dimension below Mexico, and then notice that Mexico West Coast
and Jalisco are missing in the dimension hierarchy.
You must process the dimension before you can view the data in the Sales
Units cube.
3. Close the Cube Browser dialog box.
4. In the Shared Dimensions folder, right-click State, and then click Process.
Here you see two options for processing the dimension—Incremental
update and Rebuild the dimension structure.
Because you added a new member to the dimension table, and did not
change the structure of the State dimension, you can perform an
incremental update of the dimension to add the Jalisco state to the
dimension.
5. Click Incremental update, and then click OK.
6. After the dimension finishes processing, close the Process dialog box.
7. Right-click the State dimension, and then click Browse Dimension Data.
8. Expand the State dimension and verify that Jalisco and Mexico West
Coast exist below Mexico in the dimension.
9. Close the Dimension Browser dialog box.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 33

! To update the Sales Units cube


1. In the Analysis Manager, browse the Sales Units cube.
2. Expand the State dimension below Mexico and verify that the new
members exist in the dimension.
You see Jalisco and Mexico West Coast in the State dimension hierarchy.
3. Notice the Jalisco and Mexico West Coast values for Sales Units.
Why do you not see the 1,000 units that you added to the Salesfact table?
You processed the dimension, but you have not yet processed the Sales
Units cube.
4. Close the Cube Browser dialog box.
5. Right-click the Sales Units cube, click Process, click Refresh data, and
then click OK.
Because you did not change the structure of the cube or rebuild the State
dimension, you can refresh the Sales Units data to repopulate the cube with
the data from the data source.
6. Close the Process dialog box, browse the Sales Units cube, and verify that
the Jalisco Sales Units data exists in the cube.
You see 1,000 Sales Units for both Jalisco and Mexico West Coast in the
Sales Units cube. The cube refresh reloaded the cube data from the Module
09 SQL Server data source.
7. Close the Cube Browser dialog box.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


34 Module 9: Processing Dimensions and Cubes

Exercise 2
Adding the Baja California State
In this exercise, you will add the Mexican state Baja California to the State
dimension table by using SQL Server Enterprise Manager. After you add the
new state, you will see how the update to the data source affects the State
dimension and the Sales Units ROLAP cube.

! To add the Baja California state


1. Switch to Enterprise Manager, and leave Analysis Manager open.
2. In the Module 09 SQL Server database, right-click the State table, point to
Open Table, and then click Return all rows.
You will add the Baja California state record to the State table.
3. Add one record to the State table containing the data found in the following
table for the four table fields.
State_ID State_Name Region Country

8 Baja California Mexico North Mexico

4. Close the State table.

! To add a sales units fact record for Baja California


1. In the Enterprise Manager, right-click the Salesfact table, point to Open
Table, and then click Return all rows.
2. Scroll down to the bottom of the Salesfact table.
3. Add one record to the Salesfact table containing the data found in the
following table for the three table fields.
Month_ID State_ID Sales_Units

22 8 1000

4. Close the Salesfact table.


You added a new state, Baja California, to the State table. In addition, you
added a value for Sales Units for Baja California. You will now return to
Analysis Manager and see how the update to the data source affects the
Sales Units ROLAP cube and dimension data.
5. Close Enterprise Manager.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 35

! To update the State dimension


1. Switch to Analysis Manager.
2. In the Module 09 database, right-click the State dimension, and then click
Browse Dimension Data.
Notice that Baja California does not exist in the dimension hierarchy yet.
3. Perform an incremental update of the State dimension.
4. After the dimension finishes processing, close the Process dialog box.
5. Right-click the State dimension, and then click Browse Dimension Data.
6. Expand the State dimension and verify that Baja California and Mexico
North exist in the dimension.
7. Close the Dimension Browser dialog box.

! To update the Sales Units ROLAP cube


1. In the Analysis Manager, browse the Sales Units ROLAP cube.

Important Browse the Sales Units ROLAP cube, not the Sales Units cube
from the previous exercise.

2. Expand the State dimension below Mexico and verify that the new
members exist in the dimension.
You should see Baja California and Mexico North in the State dimension
hierarchy. Notice that no data exists for Sales Units at the Baja California
and Mexico North members.
3. In the Time dimension, click October 2001.
You previously loaded the Sales Units data for the Month_ID 22, which is
October 2001.
4. Notice the Sales Units values for Baja California and Mexico North.
How can you see the 1,000 units that you added to the Salesfact table when
you have not yet processed the cube?
The Sales Units ROLAP cube uses ROLAP cube storage. Therefore, the
cube retrieves the detail data from the SQL Server database directly.
However, the aggregation tables do not incorporate the new data
automatically. Therefore, you do not see Sales Units for Baja California
and Mexico North at the All Time member.
Currently, your detail cube data does not match your aggregated cube data.
To update the aggregation tables, you must perform a refresh of the Sales
Units ROLAP cube.
5. Close the Cube Browser dialog box.
6. Refresh the Sales Units ROLAP cube data, and browse the cube to verify
that the Baja California data exists at All Time.
7. Browse the Sales Units cube, and notice that the Baja California Sales
Units value does not exist in the Sales Units cube.
8. Refresh the Sales Units cube data, and browse the cube to verify that the
Baja California data exists.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


36 Module 9: Processing Dimensions and Cubes

Lab C: Incrementally Updating Cubes


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will
incrementally update the
Sales Units cube.

Explain the lab objectives.


Objectives
After completing this lab, you will be able to:
! Understand potential issues when performing cube incremental updates.
! Incrementally update cubes.
! Chose different fact tables in the Incremental Update Wizard.
! Use filters in the Incremental Update Wizard.

Prerequisites
Before working on this lab, you must have:
! Experience working with Analysis Manager.
! An understanding of dimensions and cubes.
! An understanding of cube storage.
! Completed lab A, Processing Dimensions and Cubes, found earlier in the
module.
! Completed lab B, Updating Dimension Data, found earlier in the module.

Estimated time to complete this lab: 30 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 37

Exercise 1
Incorrectly Duplicating Cube Data
In this exercise, you will learn the consequences of carelessly clicking through
the Incremental Update Wizard. You will incorrectly duplicate data in the Sales
Units cube.

! To browse the Sales Units cube.


1. In Analysis Manager, beneath the Module 09 database, browse the Sales
Units cube.
2. Record the data value for North America Sales Units for All Time.
$37,696.00
____________________________________________________________

3. Close the Cube Browser dialog box.


4. Right-click the Sales Units cube, click Process, click Incremental update,
and then click OK.
The Incremental Update Wizard for Sales Units opens.
5. Click Next three times, and then click Finish.
Normally, you define a separate fact table or an incremental update filter in
these wizard steps. However, you skipped these important steps of the
Incremental Wizard, and nothing prevented you from processing the cube.
6. Close the Process dialog box.
7. Browse the Sales Units cube, and record the data value for North America
Sales Units for All Time.
$75,392.00
____________________________________________________________

8. Compare the value to the previously recorded value.


Notice that you incorrectly duplicated the cube values in Sales Units. You
receive no error in the Process dialog box or in the wizard. The only way to
see the problem is to compare cube values from before and after the
incremental update.
You will now perform a refresh of Sales Units to fix the errors.
9. Refresh the data in the Sales Units cube, browse the Sales Units cube after
processing, and verify that the data values are correct again.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


38 Module 9: Processing Dimensions and Cubes

Exercise 2
Adding Fact Table Data
In this exercise, you will perform an incremental update of the Sales Units
cube. You will select a different fact table, SalesFact_Incr1, which will be
added to the Sales Units cube data.

! To browse the Sales Units cube


1. In Analysis Manager, beneath the Module 09 database, browse the Sales
Units cube.
2. Expand the Time dimension and notice that no data exists for November in
the year 2001.
3. Close the Cube Browser dialog box.

! To perform an incremental update


1. In the Module 09 database, right-click the Sales Units cube, click Process,
click Incremental update, and then click OK.
The Incremental Update Wizard for Sales Units opens.
2. Click Next to skip the welcome page.
3. Click Change.
The Choose a fact table dialog box opens. Here you will choose a different
fact table.
4. Click SalesFact_Incr1, and then click OK.
If the SalesFact_Incr1 table did not contain the same structure as the
SalesFact table, you would have received error messages at this step.
5. Click Next twice, and then click Finish.
6. Close the Process dialog box.
7. Browse the Sales Units cube, and then expand the Time dimension.
8. Notice that November 2001 data exists in the Sales Units cube.
The SalesFact_Incr1 table contains data for November only. Therefore,
you incrementally updated the Sales Units cube and defined the
SalesFact_Incr1 table as the data source, and the November data loaded
into the cube.
9. Record the value of November 2001 Sales Units for North America.
$6547.00
____________________________________________________________

10. Close the Cube Browser dialog box.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 39

Exercise 3
Using an Incremental Update Filter
In this exercise, you will perform an incremental update of the Sales Units
cube. You will select a different fact table, SalesFact_Incr2, which will be
added to the Sales Units cube data.
The SalesFact_Incr2 table contains data for November and December of
2001. In the previous exercise, you added the November data. Therefore, you
must be careful to not duplicate the November data. You will include only
December data by using a filter in the Incremental Update Wizard.

! To browse the Sales Units cube


1. In Analysis Manager, beneath the Module 09 database, browse the Sales
Units cube.
2. Expand the Time dimension, and notice that no data exists for December in
the year 2001.
3. Close the Cube Browser dialog box.

! To perform an incremental update


1. In the Module 09 database, right-click the Sales Units cube, click Process,
click Incremental update, and then click OK.
The Incremental Update Wizard for Sales Units opens.
2. Click Next to skip the welcome page.
3. Click Change.
The Choose a fact table dialog box opens. Here you will choose a different
fact table.
4. Click SalesFact_Incr2, click OK, and then click Next.
5. Type the following expression in the Create a filter expression step:
Month > 'November 30 2001'

The Month column exists in the TimeMonth table. You can reference the
TimeMonth table, because it is included in the cube schema and is included
in the cube processing SQL statement.
The incremental update will only add data for dates after November 30,
2001. Therefore, because the table contains only data from November and
December of 2001, you will load the correct values.

Important The Incremental Update Wizard does not check the syntax of the
filter. Therefore, verify that you type the correct expression, paying close
attention to punctuation.

6. Click Next, and then click Finish.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


40 Module 9: Processing Dimensions and Cubes

7. Open the SQL line to view the finished WHERE clause and then close the
Process dialog box.
8. Browse the Sales Units cube, and verify that the December 2001 data exists
in the cube.
9. View the November 2001 data also, and verify that the North America
Sales Units value equals your recorded value from the previous exercise.
10. Close the Cube Browser dialog box.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 41

# Optimizing Cube Processing


Topic Objective
To introduce the technique
of optimizing cube
processing. ! Optimizing the Data Source
Lead-in ! Optimizing the Cube Schema
The next section discusses
several ways in which to ! Optimizing Cube Design
improve cube processing
performance. ! Optimizing the Analysis Server

Optimizing cube processing is an important step in developing an OLAP


solution. If a cube process takes too long to fit in a given processing window,
users might not use the cube for their analysis requirements.
The next section discusses several ways in which to improve cube processing
performance. The following optimization topics are discussed:
! Optimizing the data source.
! Optimizing the cube schema.
! Optimizing cube design.
! Optimizing the Analysis Server.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


42 Module 9: Processing Dimensions and Cubes

Optimizing the Data Source


Topic Objective
To describes ways to
optimize the data source for
cube processing. ! Indexing the RDBMS
Lead-in ! Using Star vs. Snowflake Schema
You can make changes and
apply various database ! Using Native OLE DB Drivers
designs to the data source
to improve cube processing
performance.

Cube processing is dependent on the data source defined for a cube. Therefore,
you can make changes and apply various database designs to the data source to
improve cube processing performance.

Indexing the RDBMS


Indexing is a mechanism for boosting performance in an RDBMS.
Because cube processing executes SQL statements against your RDBMS, the
performance of your cube process is affected not only by the complexity of
your cube, but also by how well your RDBMS is optimized.
Properly indexing your RDBMS will normally improve cube processing
performance.

Using Star vs. Snowflake Schema


Because a snowflake schema defines individual dimensions with multiple
tables, more joins are necessary to access the data from the RDBMS, thereby
degenerating dimension processing performance. To optimize dimension
processing, use star schemas wherever possible. The trade-off is that using a
strict star schema will result in denormalized dimension tables.

Using Native OLE DB Drivers


Use the native OLE DB driver to access your data source, if one is available. If
you access the data source through the generic ODBC driver, you increase
processing time because of the data transformation layers added to cube
processing.
Some native OLE DB drivers have been known to perform irregularly with
Analysis Services cubes. Therefore, verify that the OLE DB driver works
properly in Analysis Services by performing thorough system testing.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 43

Optimizing the Cube Schema


Topic Objective
To describe how to optimize
the cube schema.
! Processing Can Be Optimized if Joins Are Eliminated
Lead-in ! Perform the Optimize Schema Command in the Cube
An important method of Editor
cube optimization is
performing the Optimize ! The Schema Can Be Optimized for a Dimension if the
Schema command in a Following Are True:
cube.
$ The dimension is shared
$ The lowest level Member Key Column of the dimension
is the dimension key used in the fact table
$ The lowest level Member Key Column is unique
$ The lowest level in the cube is not Disabled

When you process a cube, Analysis Server executes an SQL query that retrieves
Delivery Tip necessary cube data from the data source. Therefore, a very important method
Realize that this topic is
difficult to understand,
of optimizing cube performance is to optimize the executed SQL query. A
especially for students common way to optimize SQL queries is to eliminate unnecessary joins. You
without a relational can do this in Analysis Manager for cube processes by using the Optimize
database background. The Schema command.
following demonstration
should clear up confusion When you perform the Optimize Schema command in the Cube Editor,
associated with the Analysis Manager attempts to modify the cube schema and eliminate
Optimize Schema unnecessary joins between the fact table and dimension tables. Analysis
command. Manager attempts to replace the lowest level dimension keys with the
dimension foreign keys found in the fact table. If your lowest level keys are
optimized in this way, the Analysis Server does not need to join to dimension
tables at cube processing times.

Note You can manually perform the same steps performed by the Optimize
Schema command. In the Cube Editor, change the lowest level Member Key
Columns of your dimensions so that they use the dimension foreign keys from
the fact table.

In order for Analysis Manager to optimize the cube schema, you must follow
these four guidelines when designing dimensions:
! Use shared dimensions to optimize the cube schema. Private dimensions are
always processed at cube processing times, and Analysis Manager must join
to the dimension tables to build the dimensions. Shared dimensions,
however, can be processed before cube processing, and Analysis Manager
does not need to access the dimension tables at cube processing time if the
schema is optimized.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


44 Module 9: Processing Dimensions and Cubes

! When defining the lowest level of your dimensions, use the same key
referenced in the fact table. Therefore, at cube processing time, all required
key information exists in the fact table, and you do not need to join to the
dimension table for the key information.
! Use unique keys to identify the lowest level dimension members. Set the
Unique Members property to Yes for the lowest level of those dimensions.
! Do not assign the Disabled property to the lowest level of a dimension.

Tip If you do not want to include the level in the cube, set the Visible
property of the level to False.

To optimize the schema in the Cube Editor, click the Tools menu, and then
click Optimize Schema. If it can do so, Analysis Manager updates the
Member Key Column in the lowest levels of dimensions that follow the
preceding four guidelines. If the Optimize Schema command successfully
updates a dimension, notice that the Member Key Column in the lowest level
of the dimension points to the dimension foreign key in the fact table.

Important Do not optimize the schema of a cube if you depend on the inner
joins of the SQL query to exclude fact table rows that contain dimension keys
not found in your dimension tables. The entire fact table is loaded if all
dimension table joins are eliminated by the Optimize Schema command.

Be aware that, if the dimension table members and fact table members are not
identical, errors may occur when you load data into a cube with an optimized
schema.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 45

Optimizing Cube Design


Topic Objective
To give cube design tips to
improve cube processing
performance. ! Storage Mode and Aggregation Design
Lead-in ! Partitioning
You have the ability to
update settings and designs ! Numeric Data Types
in a cube to improve the
performance of cube ! Unique Member Setting
processes.
! Measure Data Types

Cube processing performance is affected by the design of your cube. The


following list highlights some of the most common factors affecting cube
processing:
! Cube size.
! Number of dimensions.
! Number of aggregations.
! Number of levels and members.
! Number of measures.
You have the ability to update settings and designs in your cube to improve the
performance of your cube processes.

Storage Mode and Aggregation Design


If your cube is taking too long to process, you may need to remove
aggregations from the cube. In addition, you may need to redesign the storage
mode and aggregation design of your cube.
For example, a common misconception about designing storage is that ROLAP
cubes do not take as much time to process. However, the Analysis Server
creates MOLAP aggregations much faster than the data sources create ROLAP
aggregation tables or indexed views.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


46 Module 9: Processing Dimensions and Cubes

Partitioning
Instead of storing data in only one partition in your cube, the default condition,
separate the data into multiple partitions.
The following is an illustrative example:
! A company’s sales cube is updated and loaded with data on a monthly basis.
An efficient method for handling monthly processing is to create multiple
partitions, one for each month.
! With this data segregated into partitions, you focus monthly processing on
one small subset of the data, processing only one month’s information, as
opposed to processing one very large partition that contains all months.
You can have an unlimited number of partitions in a cube. Therefore, there is
no programmed limitation in using this optimization technique.

Numeric Data Types


If possible, assign member key columns as numeric data types. Analysis Server
processes numeric columns faster than other data type columns, such as text
and date.
Do not reengineer all your databases for this sole purpose. However, keep in
mind the inherent efficiency of numeric data types for OLAP data loading when
initially designing your RDBMS.

Unique Member Setting


If all members of a dimension at a given level are unique, set the Unique
Members property to Yes. If the Unique Members setting is No, the server
must query all parents of the non-unique level members in addition to the
members themselves, and therefore processing time increases.

Measure Data Types


The data type of your measures impacts data load performance. The larger the
data type, the slower the cube processing.
Keep in mind that the data type must be appropriate at the highest level of
expected aggregation for the given measure.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 47

Optimizing the Analysis Server


Topic Objective
To describe server changes
that help to improve cube
processing performance. ! Increase Available Memory
Lead-in ! Increase the Process Buffer Size
To improve cube processing
performance, you can make ! Maintain the Data Source on the Same Server
changes to Analysis Server
and to the server computer
to manage the use of server
memory and resources.

Processing cubes uses large quantities of server resources. To improve cube


processing performance, you can make changes to your Analysis Server and to
your server computer to manage the use of server memory and resources.

Increase Available Memory


One of the most important server resources is memory. The Analysis Server
consumes memory to process dimensions and to process cube facts. You need
to provide adequate available memory on the server computer to allow for the
processing of Analysis Services cubes and dimensions.
At cube processing time, a reader thread retrieves fact table records and stores
the data in a buffer in memory. At the same time, a processing thread processes
the data and creates aggregations in a different buffer in memory. The acts of
reading data from disk, storing data, processing data, and writing data back to
disk use a large amount of memory.
The most memory-intensive operation during cube processing is the creation of
aggregations. The server uses as much memory as possible on the server
computer to calculate aggregations. If enough memory is available,
aggregations are derived from each other, which is a more efficient method than
creating aggregations from fact table data each time Analysis Server creates an
aggregation.
By providing enough memory for Analysis Server, you increase cube
processing efficiency and allow for the use of buffers during cube processing.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


48 Module 9: Processing Dimensions and Cubes

Increase the Process Buffer Size


The process buffer is an important optimization property found in the server
properties dialog box that determines how much data is processed in memory
before an input/output (I/O) to disk is required. The larger the buffer, the fewer
I/Os that must be performed.
To change the process buffer size in Analysis Manager, right-click the server,
click Properties, click the Processing tab, and, in the Process buffer size box,
update the buffer size in megabytes (MB).
The default setting is 32 MB. If the server computer contains available memory,
increase the buffer size. The size of this buffer depends largely on the random
access memory (RAM) available on the server computer.

Maintain the Data Source on the Same Server


If your data source exists on a different computer than the Analysis Server
computer, large amounts of data are transferred over the network at cube
processing time. If you experience a slow network connection, processing times
can be affected.
If the server contains enough system resources, maintaining the data source and
the Analysis Server on the same server computer eliminates the need for the
processed data to travel over a network.
Another optimized server configuration is using a dedicated high-speed
network to connect the data source server and the Analysis Server. By using a
dedicated high-speed network, you receive the processing power of two
computers, but without experiencing a networking penalty.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 49

Troubleshooting Cube Processing


Topic Objective
To give tips to help solve
some common problems
that occur when processing ! Missing Data
a cube or dimension.
! Processing Errors
Lead-in
Problems can occur when ! Insufficient Memory and Disk Space
processing a cube or
dimension.

Problems can occur when performing the various Analysis Server processing
operations. This section includes tips and techniques for solving the most
common problems.

Missing Data
You have processed a cube. You browse the cube, and there is no data, or there
appears to be missing data. Often, the problem is caused by the source
relational database, for the following reasons:
! Analysis Server does not verify the referential integrity of the underlying
relational database.
! If the fact table contains foreign keys that are missing from the joined
domain table, those fact rows are not processed—without an error message
or alert.
Following is a reliable methodology for tracking down missing data:
1. In Analysis Server’s processing window, locate and double-click the suspect
SQL statement. You will open the View Trace Line window that contains
the SQL statement passed to the RDBMS.
2. Copy the statement to your query tool of choice, make changes to the SQL
depending on your tool, and test the query without Analysis Server as part
of the equation.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


50 Module 9: Processing Dimensions and Cubes

Processing Errors
A problem can exist in a dimension definition in your cube. The only indication
of the error will be your cube’s inability to process.
If your cube cannot process and there is no specific error defining the problem,
perform the following task:
! Rebuild all shared dimensions that are included in your cube. Structural
changes made to shared dimensions can prevent a cube from processing.
! Remove dimensions from your cube, one by one, and try to process the cube
after each dimension’s removal. In this way, you can isolate the problem
dimension and can fix its definition.
! Verify that the measure data types defined in the Cube Editor are large
enough to store the aggregated cube values.

Insufficient Memory and Disk Space


As MOLAP and HOLAP cubes are processed, the Analysis Server creates
temporary, uncompressed files. Depending on the number of aggregations,
these files can be much larger than the final cube, and in some cubes are many
times larger.
For this reason, it is necessary that the Analysis Servers have not only the
available disk space to store your cubes, but also to process your cubes.
Verify that all computers that store cube data and partitions contain available
disk space, not only the main Analysis Server.
In addition to disk space, verify that the Analysis Server contains enough
memory to process dimensions and cubes. If you run out of memory, you can
experience poor processing performance and potential system instability.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 51

Demonstration: Optimizing the Cube Schema


Topic Objective
To demonstrate how to
optimize the schema of a
cube.
Lead-in
In this demonstration, you
will learn how to optimize
the schema of a cube.

In this demonstration, you will learn how to optimize the schema of a cube.
Delivery Tip You will learn how to update the Member Key Columns of the lowest levels
Encourage students to
follow along with your
of dimensions in a cube and will see how the updates affect the processing of
demonstration. cubes.

! To review the Sales Units Schema cube


1. In Analysis Manager, below the Module 09 database, expand the Cubes
folder, right click the Sales Units Schema cube, and then click Edit.
2. Notice the four dimensions in the cube—Employee, Product, State, and
Time.
3. From the Tools menu, click Process Cube, click No to avoid designing
storage, click Full Process, and then click OK.
4. After the cube finishes processing, double-click the last SQL line in the
Process dialog box. It contains the following WHERE clause in the SQL
statement:
WHERE
("dbo"."XXSchema_SalesFact"."Employee_ID"="dbo"."Employee".
"Employee_ID") AND
("dbo"."XXSchema_SalesFact"."Product_ID"="dbo"."Product"."P
roduct_ID") AND
("dbo"."XXSchema_SalesFact"."State_ID"="dbo"."State"."State
_ID")

5. Because the Member Key Columns of the lowest dimension levels are
defined from the dimension tables, the SQL statement must join to the
dimension tables during the cube process.
The cube builds the Time dimension from the fact table directly. Therefore,
there is no join to a Time dimension table.
6. Close the Process dialog box.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


52 Module 9: Processing Dimensions and Cubes

! To update the Employee dimension


1. In the Cube Editor, expand the Employee dimension, click the Employee
Name level, and then notice the value of the Member Key Column for the
level.
The Employee Name level is built from the
"dbo"."Employee"."Employee_ID" column. However, because this
column also exists in the fact table, you will update the Member Key
Column to point to the fact table.
2. In the Member Key Column property, click the ellipsis (…) button.
3. Click the Employee_ID column in "dbo"."XXSchema_SalesFact" table.
The "dbo"."XXSchema_SalesFact" table is the fact table of the cube.
4. Click OK.
5. From the Tools menu, click Process Cube, click Yes to save the cube, click
No to avoid designing storage, click Full Process, and then click OK.
6. Double-click the last SQL line in the Process dialog box. It contains the
following WHERE clause in the SQL statement:
WHERE
("dbo"."XXSchema_SalesFact"."Product_ID"="dbo"."Product"."P
roduct_ID") AND
("dbo"."XXSchema_SalesFact"."State_ID"="dbo"."State"."State
_ID")

7. Notice that the join to the Employee table no longer exists in the SQL
statement.
By updating the Member Key Column of the Employee Name level, you
eliminated the need to join to the Employee table during cube processing.
8. Close the Process dialog box.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 53

! To optimize the cube schema


1. In the Cube Editor, click the Tools menu, and then click Optimize Schema.
2. Notice the Cube Schema Optimization dialog box.
It indicates that the Optimize Schema automatically updated the lowest
Product and State levels by updating the Member Key Columns to point
to the fact table keys.
It also indicates that the Employee dimension has already been optimized.
In the previous procedure, we performed the Employee dimension
optimization by updating the Member Key Column.
3. Expand the Product and State dimensions and notice the Member Key
Column values at their lowest levels.
4. From the Tools menu, click Process Cube, click Yes to save the cube, click
No to avoid designing storage, click Full Process, and then click OK.
5. Double-click the last SQL line in the Process dialog box.
6. Notice that the SQL statement no longer contains a WHERE clause. The
cube does not need to join to the dimension tables during cube processing,
because all dimensions are optimized.
7. Close the Process dialog box.
8. Close the Cube Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


54 Module 9: Processing Dimensions and Cubes

Review
Topic Objective
To reinforce module
objectives by reviewing key
points.
Lead-in ! Introducing Dimension and Cube Processing
The review questions cover
some of the key concepts ! Processing Dimensions
taught in the module.
! Processing Cubes
! Optimizing Cube Processing
! Troubleshooting Cube Processing

1. Where does Analysis Server create MOLAP dimension structures? For


MOLAP cubes? For ROLAP cubes? For HOLAP cubes?
Analysis Server for all three.

2. How do you process a private dimension, with a rebuild or an incremental


update?
Private dimensions are incrementally updated as part of a cube refresh
or a cube incremental update and are rebuilt as part of a full cube
process.

3. What are the two methods for processing a shared dimension?


Incremental update.
Rebuild the dimension structure.

4. What are the three methods for processing a cube?


Full process, refresh, and incremental update.

5. What common problem is associated with incremental updates?


Duplicating data.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 9: Processing Dimensions and Cubes 55

6. How can you design your data source to potentially improve processing
performance?
Create indexes in the data source.
Use the native OLE DB driver to access your data source, if one is
available and stable.
If there are adequate resources, place the data source on the same
server computer as Analysis Services.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 10: Managing
Partitions

Contents

Overview 1
Introducing Partitions 2
Creating Partitions 7
Lab A: Creating a Partition in the Sales Cube15
Using Advanced Settings 19
Merging Partitions 24
Lab B: Applying Advanced Settings to
Partitions 26
Review 29
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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 10: Managing Partitions iii

Instructor Notes
Presentation: For enterprise-scale online analytical processing (OLAP) cubes developed in
30 Minutes Microsoft® SQL Server™ 2000 Analysis Services, partitioning can improve
both processing and query performance. In this module, students learn how to
Labs: create partitions, how to define slices and filters, and the benefits of using
30 Minutes partitions in cubes to improve scalability.
After completing this module, students will be able to:
! Explain the benefits of partitioning.
! Describe the mechanics of the Partition Wizard.
! Explain when to define slices and when to define filters.
! Describe the purpose and mechanics of merging partitions.

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_10.ppt

Preparation Tasks
To prepare for this module, you should:
! Read all the student materials.
! Read the instructor notes and margin notes.
! Practice the lecture presentation and demonstration.
! Complete the labs.
! 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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


iv Module 10: Managing Partitions

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. After defining multiple partitions, there are empty spaces in the cube even
though there is data in the fact tables to support the cells. What causes this?
Incomplete partitions can cause missing data. Incomplete partitions
result when a partition is misdefined (perhaps using a member from a
level that is too low for a slice) or not defined at all. Be careful—if a
partition is misdefined and another partition is added to fix the
problem, duplicate data can result.
2. What is the best way to split a partition into one or more different
partitions?
There is no direct way to do this. To split up an existing partition, you
must redefine the partition on a smaller slice or modify the WHERE
clause and then define new partitions.
3. If a different fact table than the one defined for the partition is used for an
incremental load of the partition, what happens when the cube is refreshed
or processed in the future?
The incremental data will not be included. Analysis Services refers to
only one fact table per cube partition.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 10: Managing Partitions v

Module Strategy
Use the following strategy to present this module:
! Introducing Partitions
Start with an explanation of why partitions are used. Emphasize the fact that
partitions are transparent—users and front-end applications see only cubes.
Explain that partitions in a cube may have different storage modes,
aggregation designs, and physical locations. Define remote partitions.
! Creating Partitions
Explain each step involved in creating a partition—choosing the fact table,
defining a data slice, assigning the partition location, and completing the
partition. Finish by describing how to access commands in Analysis
Manager.
! Using Advanced Settings
Introduce students to the Advanced settings dialog box. Describe the
settings available—specifying filters, enabling drillthrough options, and
setting the aggregation prefix—and explain when to use each.
! Merging Partitions
Explain to students why merging partitions can be beneficial. Use the
Current Year/Prior Year/History partition example. Describe the steps
involved in merging partitions. Emphasize the fact that, to be merged, two
partitions must have the same storage mode and aggregation design.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 10: Managing Partitions 1

Overview
Topic Objective
To provide an overview of
the module topics and
objectives. ! Introducing Partitions
Lead-in ! Creating Partitions
In this module, you will learn
about partitions and their ! Using Advanced Settings
use in OLAP cubes.
! Merging Partitions

For enterprise-scale online analytical processing (OLAP) cubes developed in


Microsoft® SQL Server™ 2000 Analysis Services, partitioning can improve
both processing and query performance. In this module, you will learn how to
create partitions, how to define slices and filters, and the benefits of using
partitions in cubes to improve scalability.
After completing this module, you will be able to:
! Explain the benefits of partitioning.
! Describe the mechanics of the Partition Wizard.
! Explain when to define slices and when to define filters.
! Describe the purpose and mechanics of merging partitions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


2 Module 10: Managing Partitions

# Introducing Partitions
Topic Objective
To introduce the concept of
partitions.
Lead-in ! Basic Architecture
In this section, you will learn ! Partitioning Design
about partition architecture
and design and the use of ! Remote Partitions
partitions in OLAP cubes.

You create partitions in cubes to help manage cube storage, process cubes, and
query cubes. In this section, you will learn about partition architecture and
design and the use of partitions in OLAP cubes.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 10: Managing Partitions 3

Basic Architecture
Topic Objective
To describe the fundamental
characteristics of cube ! Act As Physical Storage Mediums for Cube Data
partitions.
! Improve Cube Performance
Lead-in
Partitions are the physical $ Cube processing performance
storage mediums for cube
data. $ Query performance
! Are Transparent to Users
! Require SQL Server 2000 Enterprise Edition
$ Analysis Server and Analysis Manager Computers

Partitions are the physical storage mediums for cube data. A cube may have one
or more partitions. Each partition may have a different storage mode with a
different aggregation design. In addition, each partition may be located on a
different server. All cubes initially have a single default partition.
When you design aggregations for a one-partition cube, you are actually
designing aggregations for the partition, not for the cube. When you process a
single-partition cube, you are also processing the partition, not the cube. If a
cube contains more than one partition, attempting to design storage for a cube
opens up a dialog box that requires you to select a single partition for designing
aggregations.
You create partitions to improve cube processing and query performance,
increasing the scalability of a cube. Partitions are processed either as part of a
full cube process or independent from other cube partitions. By processing
partitions independently, you isolate processing to a subset of cube data, and
therefore reduce the processing time. In addition, queries can focus on a single
partition and can perform faster data retrievals due to the smaller data set being
accessed.
Partitions are transparent. Users and application front-ends see only cubes—that
is, they query a cube and not a partition. The cube reflects the combined data
contained in all its partitions.
To create multiple partitions in a cube, you must have the Enterprise Edition of
SQL Server 2000 installed on the Analysis Server and on any computers
administering the server. To install the Enterprise Edition of SQL Server 2000,
the computer requires one of the following operating systems:
! Microsoft Windows NT® Server 4.0 with Service Pack 5
! Windows NT Server Enterprise Edition 4.0 with Service Pack 5
! Microsoft Windows 2000 Advanced Server
! Windows 2000 Data Center Server
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
4 Module 10: Managing Partitions

Partitioning Design
Topic Objective
To describe the use of
different aggregation and
storage designs in MOLAP
partitions.
Current Year 35% agg
Lead-in
Partitions separate cube
data into discrete storage
areas. Each partition in a MOLAP
cube may have different Prior Year 10% agg
storage modes, aggregation
designs, and physical
locations.
ROLAP
History 0% agg

Partitions separate cube data into discrete storage areas. Each partition in a cube
Delivery Tip may have different:
Point out that agg stands for
aggregation in the preceding ! Storage modes—multidimensional OLAP (MOLAP), relational OLAP
illustration. (ROLAP), or hybrid OLAP (HOLAP).
! Source fact tables—Salesfact2000 for one partition and Salesfact2001 for
another.
! Aggregation designs—35 percent aggregation in one MOLAP partition
versus 10 percent aggregation in a second MOLAP partition versus 0
percent aggregation in a third ROLAP partition.
! Storage locations—Server 1 in Pittsburgh, Server 2 in San Francisco, and so
forth.
Because of these factors, partitioning is the principal feature in Analysis
Services for increasing cube scalability and designing storage to reflect user
access and response time needs.
In the preceding illustration, three partitions exist in one cube. The data in the
partitions, representing the entire accounting history for a company, is
organized by current year, prior year, and historical data.
The aggregation design for each of the partitions reflects specific user access
needs and storage considerations. The partitions are designed as follows:
! Current Year
The current year partition design contains the highest aggregation
percentage using the MOLAP storage mode—the fastest storage method.
The design reflects the high number of users, the high frequency of the
access of each user, and the presumed performance requirements for the
reporting and analysis of current year data.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 10: Managing Partitions 5

Note To further enhance response times, the current year partition might
also reside on a more robust server with large amounts of storage and
memory and a fast processor.

! Prior Year
The prior year partition design also uses MOLAP storage, but with a lower
aggregation level, thus conserving storage while sacrificing reporting
performance. Users access prior year data less frequently than they access
current year data, and data extraction is typically used for printed reports
rather than ad hoc analysis, so response times are less important.
! History
The history design uses ROLAP with zero aggregations, and is the slowest
of the three partitions in reporting performance—reflecting the low
frequency of access by users for this type of data. While reporting is slow,
ROLAP with no aggregations is the most storage efficient design—
reflecting the need for economical storage of large amounts of historical
data.
In summary, partitioning is an important tool for enhancing overall system
performance. Partitioning allows you to balance data load performance, run-
time reporting performance, and storage needs against user needs, production
cycle times, and hardware availability.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


6 Module 10: Managing Partitions

Remote Partitions
Topic Objective
To introduce the concept of ! Remote Partitions Are Stored on a Separate Server
remote partitions.
Lead-in $ Data stored separately
You have the ability to $ Processing performed separately
define cube partitions as
remote in Analysis Services. $ Querying performed separately, but funneled through
local Analysis Server
$ Metadata stored and maintained on local Analysis
Server
$ Administration performed on the local Analysis Server
! Transparent Setup and Maintenance

A partition assigned to a server that is physically separate from the main


Analysis Server is called a remote partition. The separate server where the
remote partition is stored is called the remote server, and the main server where
the cube definition is stored and administered is called the local server.
The following are the general parameters for the organization and processing of
remote partitions:
! The data associated with the remote partition is stored on the separate, or
remote, server.
! All processing of the partition by its own aggregation rules is done on the
remote server.
! Querying of the partition occurs on the remote server, but is funneled from
the local Analysis Server.
! Metadata for the partition is stored and maintained on the local Analysis
server—not on the remote server.
! Administration of a cube and its associated partitions is performed on the
local Analysis Server, and not on the remote server as part of the remote
partition definition. In other words, no administration occurs on the remote
server.
You create remote partitions through the Partition Wizard. In the process of
creating a partition by using the wizard, after you name the remote server for a
remote partition, all other configurations are automatic and transparent—that is,
setup and administration is the same as for a non-remote partition.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 10: Managing Partitions 7

# Creating Partitions
Topic Objective
To introduce the mechanics
of creating partitions.
Lead-in ! Choosing the Fact Table
This section outlines the ! Defining a Data Slice
systematic procedures for
creating additional ! Assigning the Partition Location
partitions.
! Completing the Partition
! Accessing Commands

When you first create a cube, by default the cube contains one partition. You
Delivery Tip add additional partitions by using the Partition Wizard. This section outlines the
Present this entire section
as an informal
systematic procedure for creating additional partitions, which includes the
demonstration. Switch back following steps:
and forth between the slides
! Choosing the data source and the source fact table, if different from the
and the Partition Wizard,
showing students the actual
default source and fact table.
interfaces as you discuss ! Optionally defining a data slice to focus the data included in the partition.
the issues.
! Assigning the location of the partition.
! Completing the partition design by naming it and specifying an aggregation
design.
! Accessing partitioning commands to administer a partition after you have
created it.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


8 Module 10: Managing Partitions

Choosing the Fact Table


Topic Objective
To describe the action of
choosing a fact table for a
new partition.
Lead-in
The first step in creating a
partition is choosing a data
source and fact table for the
partition.

When you create a new partition in a cube, the partition fact table is not
required to be from the same data source or fact table defined in the Cube
Editor. The first step in creating a partition is to choose a data source and fact
table for the partition. The fact table must contain the measures and dimension
keys found in the fact table defined in the Cube Editor.
To add a new partition to a cube, perform the following steps:
1. In Analysis Manager, expand the folder for the cube to which you want to
add a partition.
2. Right-click the Partitions folder, and then click New Partition.
The Partition Wizard opens.
3. Click Next to bypass the Welcome step of the Partition Wizard.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 10: Managing Partitions 9

To confirm or change the fact table and database, perform the following steps:
1. From the Specify data source and the fact table step, note the data source
and fact table default entries.
The Partition Wizard defaults to the same data source and fact table that are
defined in the Cube Editor.
2. Click Change to specify a different fact table.
If you want to use the same data source and fact table as the default
partition, click Next to proceed to the Select the data slice (optional) step.
3. From the Choose a fact table step, select a fact table for the partition to use
from the Tables list, and then click OK.
The Tables list includes all the fact tables associated with available data
sources. The chosen fact table must have the same structure as the fact table
of the default partition. If it does not, Analysis Manager will display an alert
and will not allow you to proceed with the invalid choice.
If you want to define a different data source, in the Choose a fact table
step, click New Data Source.
4. Click Next.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


10 Module 10: Managing Partitions

Defining a Data Slice


Topic Objective
To describe the process of
defining a data slice in a
cube partition.
Lead-in
The next step in designing a
partition is determining the
partition’s data slice.

The next step in designing a partition is determining the partition’s data slice.
Delivery Tip You define a data slice for a partition to define which data to include in the
Point out that defining a
data slice for a partition
partition. In addition, queries use data slices to determine which partitions to
ensures that queries access when retrieving data. Use data slices to prevent duplication of data and
achieve the full benefit of to optimize query performance.
multiple partitions.
Choosing the data slice on which to base a partition is an important design
decision, which must take into consideration user reporting and analysis needs,
load and processing cycle times, and server hardware availability.
While the step of defining a data slice is optional in the Partition Wizard, it is
important to specify a data slice if the partition derives from the same data
source and fact table as the default partition. If you do not otherwise specify a
data slice—or a filter, which is discussed in the next section—then the default
partition and the new partition will contain duplicate data, which defeats the
purpose of creating the additional partition.
If the partitions are derived from different fact tables, and the fact tables are
partitioned the same as the cube partitions, specifying a data slice is not
necessary. However, if you define a data slice, queries accessing partition data
do not waste time by searching through partitions that do not contain the
requested data.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 10: Managing Partitions 11

To define a data slice, perform the following steps:


1. In the Select the data slice (optional) step, select a dimension for the data
slice from the Dimensions list.
A hierarchical list of members for the selected dimension appears in the
Members list. You can drill down through this list to see various members
in the hierarchy.
2. In the Members list, click a member to define the specific data slice.
The member selected appears under the Data slice column of the
Dimensions list to the right of the selected dimension. Note in the interface
that the data slice maps to a single member definition. You define a data
slice that requires additional complexity by using a filter expression, which
is reviewed later in this module.
3. Click Next.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


12 Module 10: Managing Partitions

Assigning the Partition Location


Topic Objective
To describe how you can
specify the location for
storing the partition.
Lead-in
The wizard allows you to
specify whether the partition
should remain on the local
server or be distributed to
another server.

Each partition can reside on a different server. The wizard allows you to specify
whether the partition should remain on the local server or be distributed to
another server.

Note If you want to define a remote partition for a cube, you must define the
remote partition on a computer running Analysis Services. In addition, you
must have a user name in the OLAP Administrator group on both computers.
Lastly, the logon account for the Analysis Server service must be a domain user
account before creating a remote partition.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 10: Managing Partitions 13

Completing the Partition


Topic Objective
To describe the last step of
the Partition Wizard, in
which you can name the
partition and design
aggregations.
Lead-in
In the last step of the
wizard, you enter the name
of the new partition and
specify how you wish to
design aggregations.

In the last step of the wizard, you enter the name of the new partition and
specify how you want to design aggregations.
To name and define aggregations for the partition, perform the following steps:
1. In the Finish the Partition Wizard step, enter a descriptive name for the
partition in the Partition name box.
2. Click one of the three What do you want to do? radio buttons.
Following are the behaviors of each of the choices:
• If you click Design the aggregations for your partition now, the
Storage Design Wizard opens after you click Finish.
• If you click Design the aggregations later, when you click the Finish
button, the Partition Wizard closes and you return to the Analysis
Manager. Before processing the cube, you must return to the Storage
Design Wizard to design aggregations. To do so, you right-click the
partition, and then click Design Storage.
• If you click Copy the aggregation design from an existing partition,
you may choose an aggregation design from the list of designs that are
defined for other cube partitions.
3. Select the Process the partition when finished check box to initiate
processing of the partition after you click the Finish button.
4. Click Finish.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


14 Module 10: Managing Partitions

Accessing Commands
Topic Objective
To describe the process of ! Right-Click the Partitions Folder
updating, creating,
modifying, and processing $ New partition
partitions in Analysis
Manager. $ Process all partitions
Lead-in ! Right-Click a Specific Partition
The interface for creating,
modifying, and processing $ Edit
partitions in Analysis
Manager is very
$ Process
straightforward and intuitive. $ Design storage
$ Usage-based optimization
$ Merge

The interface for creating, modifying, and processing partitions in Analysis


Manager is very simple and intuitive. All commands are accessed through the
context-sensitive menu system.
By right-clicking the Partitions folder below the specific cube in Analysis
Manager, you can perform the following operations:
! Create a new partition
! Process all partitions
To access commands for administering a specific partition, right-click the
partition from in the Partitions folder. The menu allows you to perform the
following operations:
! Edit the partition.
! Process the partition.
! Open the Storage Design Wizard to design or change the storage for the
partition.
! Open the Usage Based Optimization Wizard to implement usage-based
optimization for the partition.
! Open the Merge Wizard to merge the partition with another cube partition.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 10: Managing Partitions 15

Lab A: Creating a Partition in the Sales Cube


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will create a
new partition in the Sales
cube to access data from
another fact table.

Objectives
Explain the lab objectives. After completing this lab, you will be able to:
! Create a new partition in a cube.

Prerequisites
Before working on this lab, you must have:
! Experience working with dimensions.
! An understanding of dimensions, cubes, and measures.

Estimated time to complete this lab: 10 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


16 Module 10: Managing Partitions

Exercise 1
Creating a Partition in the Sales Cube
In this exercise, you will add a second partition to the Sales cube and populate
it with data. You will partition the cube by defining a data slice from the Time
dimension. The existing default partition contains 2000 data. The new partition
will contain 2001 data.

! 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\L10\Module
10.CAB, click Open, click Restore, and then click Close.
2. Double-click Module 10 to expand the database.
3. Double-click the Data Sources folder below Module 10, right-click the
Module 10 data source, and then click Edit.
4. In the Data Link Properties dialog box, click the Connection tab, and then
verify that localhost is selected in step 1.
5. In step 2, verify that Use Windows NT Integrated security is selected.
6. In step 3, verify that Module 10 is selected.
7. Click Test Connection and verify that the test succeeded. Click OK twice.

! To browse the Sales cube


1. Open the Cube Editor for the Sales cube.
2. Browse the cube in the Data pane.
Notice the very simple cube structure. The Sales cube contains two
dimensions—Time and State—and one measure—Sales Units.
3. Expand the Time dimension and click 2000. Notice the cube data in USA.
4. Click 2001. Notice that the cube does not contain any data for the year
2001.
5. Click the Schema tab in the Data pane.
Notice the fact table defined in the cube—Salesfact2000. The reason the
cube contains no data for the year 2001 is that the cube retrieves data from
the one fact table, Salesfact2000. Now you will add a new partition to the
Sales cube to incorporate the 2001 data.
6. Close the Cube Editor.

! To create a new partition.


1. Expand the Sales cube, expand the Partitions folder, and then notice the
default partition in the Sales cube—Sales.
The default partition has the same name as the cube name.
2. Right-click the Partitions folder and then click New Partition. The
welcome page of the Partition Wizard opens. Click Next.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 10: Managing Partitions 17

! To select the fact table and database


1. From the Specify the data source and the fact table step, click Change to
specify a different fact table.
2. From the Choose a fact table dialog box, click the fact table Salesfact2001.
3. Click OK, and then click Next.

! To define the data slice


1. From the Select the data slice (optional) step, click the Time dimension,
and then click 2001 from the Members pane.
You define a data slice in the new partition to optimize queries made against
2001 data.
2. Click Next twice to move to the Finish the Partition Wizard step.

! To finish the partition


1. From the Finish the Partition Wizard step, type Sales 2001 in the
Partition name box.
2. From the What do you want to do? pane, click Copy the aggregation
design from an existing partition and then verify that Sales is selected in
the Copy from list.
3. Select the Process partition when finished check box, and then click
Finish.
4. Close the Process dialog box.

! To browse the Sales cube


1. Open the Cube Editor for the Sales cube.
2. Browse the cube data in the Data pane.
3. Click the 2000 and 2001 members in the Time dimension.
Notice that the cube contains data for both years.
4. View the cube schema for the Sales cube.
Notice that the schema did not change after you created the new partition. In
other words, the schema is based on the Salesfact2000 fact table, and there
is no reference to the Salesfact2001 fact table. The only reference to the
new table is found in the new partition definition identified in the Partition
Wizard.
5. Close the Cube Editor for Sales.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


18 Module 10: Managing Partitions

! To update the data slice for the Sales partition


1. In Analysis Manager, expand the Partitions folder in the Sales cube, right-
click the Sales partition, and then click Edit.
The Partition Wizard opens.
2. Click Next to advance to the Select the data slice (optional) step.
3. Click the Time dimension, and then click 2000 from the Members pane.
You will not see any differences in data values after defining the data slice
for the Sales partition. However, you are optimizing the internal
management of the two partitions. Now, when users query 2000 data, the
Analysis Server searches only the Sales partition instead of searching both
the Sales and Sales 2001 partitions. The same is true for queries accessing
2001 data. The Analysis Server will not need to search through the Sales
partition, because it is defined as containing only 2000 data.
4. Click Next twice, copy the aggregations from the Sales 2001 partition, and
then process the partition.
5. Browse the Sales cube to verify that the data values have not changed.
6. Close the Cube Browser.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 10: Managing Partitions 19

# Using Advanced Settings


Topic Objective
To introduce the use of
advanced settings in the
Partition Wizard. ! Partition Filters
Lead-in ! Drillthrough Options
You can take advantage of
several advanced setting ! Aggregation Prefix
features from the Advanced
settings dialog box, which
is accessed from the Finish
the Partition Wizard page.

You can take advantage of several advanced setting features from the
Delivery Tip Advanced settings dialog box, which is accessed from the Finish the Partition
Show the Advanced
settings dialog box during
Wizard step. These advanced settings include:
your lecture. ! Specifying filters for more complex partition definitions.
! Enabling drillthrough options for the partition.
! Setting the aggregation prefix to assign a common prefix for aggregation
tables.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


20 Module 10: Managing Partitions

Partition Filters
Topic Objective
To introduce partition filters
and their use when defining ! Used for Specifying Complex Partition Criteria
a partition.
Lead-in ! Accessed from the Advanced Button
In some cases, you might ! Defined by a WHERE Clause as an SQL Pass-Through
want to define a partition by
using more complex
Expression
variables than a single ! Can Refer to Any Column in a Fact Table or Dimension
member. You can create
such a partition by using a
Table
filter statement.
“time_table”.”year”
“time_table”.”year” << 1999
1999

Filters
FiltersAll
AllYears
YearsBefore
Before1999
1999totoDefine
Definethe
theHistory
HistoryPartition
Partition

The principal method for defining the special focus of a partition in a cube is to
specify a data slice as reviewed in the previous section. The important
characteristic of the data slice is that there is a mapping of the partition design
to just one single member from dimensions.
In some cases, however, you might want to define a partition by using more
complex variables than a single member. You can create such a partition by
using a filter statement.
In the preceding partitioning example, the Current Year and Prior Year
partitions were defined by using data slices, because the current and prior years
were specific members from the Time dimension. For the History partition,
however, no single member of the Time dimension was available to define all
other years of accounting history. Many Time members represent history—all
the years before the current and prior years.
Using a filter instead of a data slice can solve the problem of defining the data
for the History partition.
To create a filter for a particular partition, click Advanced in the Finish the
Partition Wizard step to access the Advanced Settings dialog box. You enter
SQL pass-through expressions in the Filter statement box to create the filter.
When the partition is processed, the filter statement is used as the WHERE
clause of the SQL statement that populates the partition.
Because dimension tables are inner-joined to the fact table, a filter typically
includes criteria applied against the fact table or any dimension table used by
dimensions in the partition.
To filter on dimension tables, you must include the fully qualified dimension
table name and column name in the Filter statement box.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 10: Managing Partitions 21

For example, to include only the historical data in the History partition, use the
following syntax:
“time_table”.”year” < 1998

Notice that the expression uses the format of “TableName”.”ColumnName”.


An error will occur when you process the partition if you do not reference the
table name.
Additional filter statement examples follow:
To retrieve data for countries that are not the USA, use the following
expression.
“MyFactTable”.”Country” <> ‘USA’

To filter on periods that are earlier than July 31, use the following expression.
“MyFactTable”.”Time.ID” < 731

Important Analysis Manager does not validate the expression entered in the
filter statement in the Partition Wizard. The statement is simply passed through
to the relational database management system (RDBMS) at processing time. If
the syntax is incorrect, an error will occur when you attempt to process.

A data slice must be based on a dimension member, but a filter SQL statement
can refer to any column in the fact table or a cube’s dimension table, even if the
column is not used in the cube. For example, a filter could be based on a Batch
Number column, which typically would not be a dimension in a cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


22 Module 10: Managing Partitions

Drillthrough Options
Topic Objective
To describe the process of
enabling drillthrough for a
partition of a cube. ! Provides Access to Source Data of a Cell
Lead-in ! Is Enabled When:
Analysis Services provides
a feature called drillthrough $ Users have security access
that provides users with
access to the details behind $ Client application supports drillthrough
individual cube data cells.
$ Cube is enabled for drillthrough
$ Cube cell is created directly from data source
! Is Set at the Cube or Partition Level

Analysis Services has a feature called drillthrough, with which users can gain
access to the details behind individual cube data cells. Users can retrieve
drillthrough data if they meet the following requirements:
! The Analysis Services user role has granted the user drillthrough access.
! The client application supports cube drillthrough operations.
! The cube is enabled with drillthrough support.
! The accessed cell is created by cube data directly, and is not the result of a
calculated member or custom member formula.

When you set drillthrough at the cube level, the settings apply to all partitions
in the cube. However, you can customize drillthrough access for each partition
by using the Advanced Settings dialog box in the Partition Wizard.
By using the Partition Drillthrough Options dialog box, you select the
columns that are retrieved when a user accesses drillthrough for a partition data
cell. In addition, you can define a filter that limits the data retrieved for a
particular drillthrough operation for a partition.

Note Before setting drillthrough options for a partition, you must enable the
cube containing the partition for drillthrough. For more information about cube
drillthrough, see module 14, “Using Actions, Drillthrough, and Write-Back,” in
course 2074A, Designing and Implementing OLAP Solutions with Microsoft
SQL Server 2000.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 10: Managing Partitions 23

Aggregation Prefix
Topic Objective
To explain the aggregation
prefix option available in the
Advanced Settings dialog
box of the Partition Wizard.
Lead-in
You can select an
aggregation prefix for the
partition in the Advanced
Settings dialog box of the
Partition Wizard.

You can select an aggregation prefix for the partition in the Advanced Settings
dialog box of the Partition Wizard. Update the prefix to assign a prefix to all
aggregation table names when using the ROLAP storage mode.

Note If you are not using ROLAP storage, the aggregation prefix has no effect
on the partition.

By default, the aggregation prefix has the format of CubeName_PartitionName.


By designating a different aggregation prefix, you differentiate aggregation
tables created by multiple partitions in the data source.
The aggregation prefix defined in the Partition Wizard is added to any
aggregation prefixes defined at the cube level in the Cube Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


24 Module 10: Managing Partitions

Merging Partitions
Topic Objective
To discuss the process of
merging partitions and to
explain the reason for
merging existing partitions.
Lead-in
In Analysis Manager, you
can merge partitions into
other partitions to
consolidate cube data.

You can create multiple partitions from a cube with a single default partition. In
turn, multiple partitions can be merged to create a single partition.
In some situations, you can merge partitions to take advantage of optimized
query performance. Queries that access multiple partitions sometimes take
longer than queries accessing the same data stored in a single partition.
Therefore, you can determine user access and design partitions according to
projected query patterns.
For example, you can design monthly partitions that allow monthly feeds to
process a subset of the cube at a time. However, after the monthly data is
processed, you can merge the partitions so that annual reports containing all
monthly data access a single partition, instead of accessing twelve monthly
partitions.
Consider the Current Year/Prior Year/History partition example. At the end of
each accounting year, you update the three partitions. Starting with the new
accounting year, you reorganize the partitions to reflect new definitions of the
periods for current, prior, and history data:
! The year 2001 becomes the new Current Year.
! The year 2000—previously the Current Year—now becomes the Prior Year.
! The year 1999—previously the Prior Year—now goes into the History pool
of data.
Moving the year 1999 data into the History partition requires merging of the
previous Prior Year and History partitions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 10: Managing Partitions 25

Partition Merge Procedure


The steps for merging partitions are straightforward.
To merge two partitions, perform the following steps:
1. Expand the Partitions folder, and then right-click the name of the partition
you want to merge. This partition is called the source partition.
2. From the menu, click Merge.
The Merge Partitions dialog box is displayed.
3. From the Merge Partitions dialog box, select the partition into which the
source partition is to be merged. This partition is called the target partition.
4. Click Merge.

The merging process begins immediately. The operation may take a long
time depending on the size of the merged data sets.

Merge Parameters
The two partitions to be merged must both have the same storage mode and
aggregation design. If this is not the case, you must edit the aggregation design
of the source partition to conform to the design of the target partition. At the
last step of the Partition Wizard, you can copy the aggregation design of the
target partition.

Caution You cannot merge partitions based on different fact tables


automatically. You must first merge the respective fact tables manually, and
then merge the partitions. Analysis Manager does not warn you if you attempt
to merge partitions accessing separate fact tables.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


26 Module 10: Managing Partitions

Lab B: Applying Advanced Settings to Partitions


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will apply
advanced settings to a new
partition.

Explain the lab objectives.


Objectives
After completing this lab, you will be able to:
! Create a new partition.
! Understand the duplication issue in partitions.
! Create a partition filter.
! Merge two partitions.

Lab Setup
To complete this lab, you need to complete lab A, Creating a Partition in the
Sales Cube, found earlier in the module.

Estimated time to complete this lab: 20 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 10: Managing Partitions 27

Exercise 1
Updating the Sales Cube Partitions
In this exercise, you will add a third partition to the Sales cube and will observe
its behavior after creating a new data slice. You will create a partition filter to
address the issue, and will learn how to merge partitions.

! To browse the Sales cube


1. In Analysis Manager, browse the Sales cube in the Module 10 database.
2. Record the Sales Units value for USA for All Time.
$26,815.00
____________________________________________________________

3. Close the Cube Browser for Sales.

! To create a new partition


1. In Analysis Manager, create a new partition in the Sales cube.
2. Click Next twice, click the State dimension, and then click USA in the
Members pane.
Here you define a data slice for the new partition.
3. Click Next twice and name the new partition Sales USA.
4. Copy the aggregation design from Sales, and then process the new partition.
5. Close the Process dialog box.

! To browse Sales
• Browse the Sales cube and record the Sales Units value for USA for All
Time.
$32,374.00
____________________________________________________________

This value is incorrect. The data for 2000 USA Sales Units is being
duplicated, because two partitions contain the data. You will now learn to
create a filter to limit the data retrieved in a partition.

! To create a partition filter


1. In Analysis Manager, edit the Sales partition.
2. Click Next three times to advance to the Finish the Partition Wizard step.
3. Click Advanced.
4. In the Filter box, type the following statement to exclude USA in the
partition’s WHERE clause:
"State"."Country" <> 'USA'

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


28 Module 10: Managing Partitions

Important The Partition Wizard does not check the syntax of filters. Verify that
you type the expression with the correct table and column names, and that you
use the proper punctuation.

5. Click OK, copy the aggregation design from the Sales USA partition, and
then process the partition.
6. Close the Process dialog box, browse the Sales cube, and then record the
Sales Units value for USA for All Time.
$26,815.00
____________________________________________________________

Because you eliminated the USA data from the Sales partition, you do not
duplicate the USA data and you see the correct value. Now you will merge
the two partitions to see the behavior of merging partitions with filters.

! To merge partitions
1. In the Sales cube Partitions folder, right-click the Sales USA partition and
then click Merge.
The Merge Partitions dialog box opens.
2. Click the Sales partition in the Into this partition pane and then click Merge.
3. After the process, close the Process dialog box.
4. Browse the Sales cube and record the Sales Units value for USA for All
Time.
$26,815.00
____________________________________________________________

5. Close the Cube Browser dialog box.


6. Perform a refresh of the Sales cube.
Refreshing or performing a full process of a cube processes all partitions in
the cube.
7. Browse the Sales cube and again record the Sales Units value for USA for
All Time.
$21,256.00
____________________________________________________________

The value is different from when you browsed the cube before performing
the refresh.
8. Edit the Sales partition and notice the data slice and partition filter.
The filter is limiting the USA data. When you originally merged the
partitions, the wizard simply merged the existing data without applying the
filter to the data. However, after you process the cube, the filter is applied
and your data is incorrect.
9. Remove the USA filter from the Sales partition, reprocess the partition,
browse the cube, and verify that the Sales Units value for USA for All
Time is $26,815.00.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 10: Managing Partitions 29

Review
Topic Objective
To reinforce module
objectives by reviewing key
points. ! Introducing Partitions
Lead-in ! Creating Partitions
The review questions cover
some of the key concepts ! Using Advanced Settings
taught in the module.
! Merging Partitions

1. If you do not have the ability to create new partitions in Analysis Manager,
what is the cause?
Your version of Analysis Manager is not the SQL Server 2000
Enterprise Edition version.

2. Can a partition be explicitly queried?


No.

3. Do partitions improve query performance or data load performance?


Potentially, both.

4. If you merge partitions that use separate fact tables, what happens to the fact
tables?
Nothing. They must be merged manually.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 11:
Implementing
Calculations Using MDX
Contents

Overview 1
Understanding Calculated Members 2
Building Calculated Members 6
Lab A: Creating Average Price 9
Lab B: Creating Sales Variance Calculations 14
Creating Non-Measure Calculated Members 17
Lab C: Creating a Non-Measure Dimension 20
Using Functions within Calculated Members 22
Lab D: Creating Calculated Members with
Functions 24
Understanding Other Calculation Methods 29
Introducing Solve Order 32
Review 34
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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 11: Implementing Calculations Using MDX iii

Instructor Notes
Presentation: In addition to performance and the intuitive nature of the multidimensional
45 Minutes model, the ability to perform complex calculations is one of the key benefits of
online analytical processing (OLAP). In some respects, an OLAP database is
Lab: something in between a relational database and a spreadsheet. This is why
45 Minutes OLAP is a tool used extensively by analysts. Calculated members in Microsoft®
SQL Server™ 2000 Analysis Services play a vital role in cube functionality and
analysis. In this module, students will learn the rudiments of working with
calculated members and multidimensional expressions (MDX).
After completing this module, students will be able to:
! Describe how calculated members work.
! Explain the mechanics of the Calculated Member Builder and create
calculated members.
! Create calculated members in non-Measure dimensions.
! Understand the use of functions in calculated members.
! Understand other calculation methods in Analysis Services.
! Understand the importance of Solve Order to generate accurate results.

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 Microsoft PowerPoint® file 2074A_11.ppt

Preparation Tasks
To prepare for this module, you should:
! Read all the student materials.
! Read the instructor notes and margin notes.
! Complete all the demonstrations.
! Practice the lecture presentation and demonstration.
! Complete the labs.
! 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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


iv Module 11: Implementing Calculations Using MDX

Demonstration: Using the Calculated Member Builder


The following demonstration procedures provide information that will not fit in
Demonstration: the margin notes or is not appropriate for student notes.
15 Minutes
You create calculated members to enhance analysis in cubes and virtual cubes.
The Calculated Member Builder dialog box provides a simple interface for
creating expressions and assists in developing calculated members.
In this demonstration, you will open the Calculated Member Builder and will
navigate the Data box to view dimensions, levels, and members in the Sales
cube. You then will create a new calculated member, Average Price, and will
browse the results in the Cube Editor.

! 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\L11\Module
11.CAB, click Open, click Restore, and then click Close.
2. Double-click Module 11 to expand the database.
3. Below Module 11, double-click the Data Sources folder, right-click the
Module 11 data source, and then click Edit.
4. Click the Connection tab of the Data Link Properties dialog box, and then
verify that localhost is selected in step 1.
5. In step 2, click Use Windows NT Integrated security.
6. In step 3, click Module 11.
7. Click Test Connection and verify that the test succeeded, click OK, and
then click OK to exit the Data Link Properties dialog box.

! To review Bad Price


1. In the Module 11 database, open the Cube Editor for the Sales cube.
2. Browse the cube in the Data pane.
3. In the cube tree view, click the Bad Price measure.
Notice that Bad Price is a derived measure. What expression is defined for
Bad Price in the Source Column?
"dbo"."SalesFact"."Sales_Dollars" /
"dbo"."SalesFact"."Sales_Units"
____________________________________________________________

4. What is the value for the All Product, All Time, North American Bad
Price?
$13,061.94
____________________________________________________________

5. The value is incorrect. What should the value be equal to for the All
Product, All Time, North American Bad Price?
$2.17
____________________________________________________________

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 11: Implementing Calculations Using MDX v

Bad Price is a derived measure that uses an expression to calculate Sales


Dollars divided by Sales Units. Measures calculate at cube processing time
and aggregate across all dimensions in the cube, based on the Aggregate
Function associated with the measure. Bad Price incorrectly sums its value
across all dimensions.
Instead of creating a derived measure for average price, you will create a
new calculated member that calculates the average. Because calculated
members do not aggregate, you will see correct values for the price.

! To open the Calculated Member Builder


1. In the Cube Editor for the Sales cube, right-click the Calculated Members
folder, and then click New Calculated Member.
The Calculated Member Builder dialog box opens. Here you create and
modify calculated members in Analysis Manager.
2. Notice the Measures dimension in the Parent dimension list.
Having the Measures dimension defined in the Parent dimension list
indicates that the new calculated member resides in the Measures
dimension. You have the option of selecting any of the cube dimensions in
the Parent dimension list. However, do not change Measures.
3. Delete the default name and then type Average Price in the Member name
box.
4. In the Data box, click the plus sign (+) to the left of the Measures
dimension.
Notice the one item, MeasuresLevel, positioned immediately below the
Measures dimension. The fact that Measures contains only one item below
it indicates that Measures contains only one level. All measures dimensions
contain only one level, because they are flat dimensions.
5. Click MeasuresLevel. Notice the status box at the bottom of the
Calculated Member Builder.
The status box contains two lines— Level: MeasuresLevel and
[Measures].[MeasuresLevel]. The first line indicates the object type of
MeasuresLevel. In this instance, MeasuresLevel is a level object. The next
line presents the official name of the object used in calculated member
expressions. In this instance, the official name of the level is
[Measures].[MeasuresLevel].
6. Click the plus sign (+) to the left of MeasuresLevel.
Notice the seven measures below MeasuresLevel. The measures exist in the
one level of the Measures dimension.
7. Click each of the seven measures and notice the object type and official
name of each one.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


vi Module 11: Implementing Calculations Using MDX

! To explore other dimensions


1. Click the plus sign (+) to the left of the State dimension.
Notice the four levels in the State dimension—(All), Country, Region, and
State.
2. Expand each of the levels in the State dimension and notice the members
below each level. Compare the State dimension to the Measures
dimension.
3. Notice that you can drill down to lower level members in each of the State
dimension levels.
4. Notice the four property templates below each member that you use to insert
various member properties into expressions.
5. Expand the Time dimension. Notice the two hierarchies in the Time
dimension—Calendar and Fiscal. Expand each of the hierarchies to the
members found at all the levels.
The Calculated Member Builder shows the hierarchy construct in
dimensions and presents hierarchies below dimensions, with the appropriate
levels and members below.

! To create Average Price


1. In the Calculated Member Builder, expand the Measures dimension to the
individual measures.
2. Double-click Sales Dollars.
Notice that [Measures].[Sales Dollars] appears in the Value expression
box. The format of the name is:
[DimensionName].[MemberName]

3. Click the division sign button (/) below the Insert button.
Notice the Value expression box contains the following expression:
[Measures].[Sales Dollars]/

4. Drag Sales Units to the Value expression box, after


[Measures].[Sales Dollars]/

The expression is now:


[Measures].[Sales Dollars]/[Measures].[Sales Units]

5. Click Check to verify that the expression is correct, and then click OK.
6. Remove the right bracket from Sales Units. Notice the red left bracket,
indicating that the measure name is not correct and requires a right bracket.
7. Add the right bracket to the Sales Units measure to finish the calculation
expression.

! To browse Average Price

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 11: Implementing Calculations Using MDX vii

1. In the Calculated Member Builder, click OK.


In the Data pane, you see the cube browser retrieving cube data.
2. Scroll to the right of Unique Product Count. You see the newly created
calculated member, Average Price.
When you add a new calculated member to a cube, you do not need to
reprocess the cube. The calculated member automatically produces the
correct values, assuming that the calculation expression is correct.
3. In the Calculated Members folder, click Average Price, and then click the
Advanced tab of the properties pane.
4. For the Format String property, click the Currency format.
5. Browse the cube and notice the value of the All Product, All Time, North
American Average Price. What is the value?
$2.17
____________________________________________________________

6. The value is correct, because the price calculation occurs after the
aggregation of the cube instead of before the aggregation.
7. Save the Sales cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


viii Module 11: Implementing Calculations Using MDX

Demonstration: Creating a Product Rollup


The following demonstration procedures provide information that will not fit in
Demonstration: the margin notes or is not appropriate for student notes.
15 Minutes
In this demonstration, you will create a non-measure dimension calculated
member. The new calculated member, Dairy + Meat, will calculate a product
rollup, summing Dairy and Meat.

! To create a new calculated member


1. In the Cube Editor for the Sales cube, create a new calculated member.
2. In the Parent dimension list, click Product.
The calculated member will reside in the Product dimension.
3. Notice the Parent member box.
When Measures is selected in the Parent dimension list, the Parent
member box is disabled, because Measures is a flat dimension with no
parents and no children. However, the Parent member box is enabled when
non-measure dimensions are selected in the Parent dimension list.
4. To the right of the Parent member box, click Change.
5. Expand the Product dimension and notice the levels included in the Select
the parent member dialog box.
The Select the parent member dialog box contains all levels of the
dimension, except for the lowest level of the selected dimension.
6. Click the All Product member, and then click OK.

! To define the calculation


1. In the Calculated Member Builder, delete the default name and then type
Dairy + Meat in the Member name box.
2. Insert the Dairy Product member into the Value expression box.
Notice the official name of Dairy—[Product].[Category].&[Dairy]. The
format of the name is:
[DimensionName].[LevelName].&[MemberKeyName]

The ampersand (&) before the member indicates the use of the key for the
member, and not the name.
3. Add the plus sign (+) to the Value expression box, adding it to the end of
Dairy.
4. Insert the Meat Product member.
The expression should be the following:
[Product].[Category].&[Dairy]+[Product].[Category].&[Meat]

5. Click Check to verify that the expression is correct.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 11: Implementing Calculations Using MDX ix

! To browse Dairy + Meat


1. In the Calculated Member Builder, click OK.
In the Data pane, you see the cube browser retrieving cube data.
2. Scroll to the right of the existing Measures.
Why do you not see the Dairy + Meat calculated member?
The Dairy + Meat calculated member is located in the Product
dimension. Therefore, you must examine the Product dimension to see
Dairy + Meat.
____________________________________________________________

____________________________________________________________

3. Notice the Product dimension and Dairy + Meat below the Meat member.
Dairy + Meat intersects with all measures in the Sales cube. It also
intersects all other members in all other dimensions.
4. Verify that the calculation is correct for Dairy + Meat.
5. Save the Sales cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


x Module 11: Implementing Calculations Using MDX

Demonstration: Creating a Product Average


The following demonstration procedures provide information that will not fit in
Demonstration: the margin notes or is not appropriate for student notes.
15 Minutes
In this demonstration, you will create a non-measure dimension calculated
member that uses the Avg function. The new calculated member, Average
Product Category, calculates the average of all Category level members.

! To create a new calculated member


1. In the Cube Editor for the Sales cube, create a new calculated member.
2. In the Parent dimension list, click Product, and then change the Parent
member box value to All Product.
3. Name the new calculated member Average Product Category.
Average Product Category needs to calculate an average value for the
members at the Category level of the Product dimension, across all
measures and all other dimensions.
4. In the Functions list, expand the Numeric folder.
Because the function required for this calculation produces a numeric result,
it is located in the Numeric folder.
5. Click the Avg function.
You see the required syntax for Avg and a short description of the function
in the status box at the bottom of the Calculated Member Builder.
6. Drag Avg to the Value expression box.
The Avg template appears, and includes placeholders for the required and
optional function parameters.

! To define the Set function


1. In the Calculated Member Builder, notice the Avg template:
Avg(«Set»[, «Numeric Expression»])

The chevrons (« ») indicate a placeholder for a function parameter. The


brackets ( [ ] ) indicate an optional function parameter.
2. Remove the optional parameter Numeric Expression, along with the
surrounding brackets:
[, «Numeric Expression»]

Because Average Product Category calculates all measures, you do not


need to specify a numeric expression.
3. The Value expression box contains the following template:
Avg(«Set»)

The «Set» parameter indicates that the Avg function requires a Set as its
only parameter.
In the context of this exercise, a Set defines multiple members from the
same dimension.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 11: Implementing Calculations Using MDX xi

Note Sets are important fundamental MDX constructs, and are defined
thoroughly in course 2093A, Implementing Business Logic with MDX in
Microsoft SQL Server 2000.

4. In the Functions box, expand the Set folder.


The Avg function indicates the type of construct required for the
calculation—a Set function. You will define a Set function to finish the Avg
function.
5. Click the function Members – Level in the Set folder.
6. Notice the short description of the function in the Status box:
“Returns the set of all members at a specified level in a dimension.”
You will use the Members – Level function, because it returns the set of all
members at the Category level of the Product dimension.
7. Click the «Set» parameter in the Value expression box.
8. Drag Members – Level to the «Set» parameter.

! To define the Level


1. Expand the Product dimension in the Data box.
Here you see the levels found in the Product dimension. You will define
the level as the Category level, because you want the calculated member to
determine the average of all members in the Category level.
2. Click the «Level» parameter in the Value expression box.
3. Drag the Category level to the «Level» parameter.
4. The Value expression box contains the following expression:
Avg([Product].[Category].Members)

5. Verify that the syntax is correct for Average Product Category.


6. Click OK to close the Calculated Member Builder.

! To browse Average Product Category


1. Find Average Product Category in the cube browser.
2. Verify that the calculation is correct for Average Product Category.
Notice the format applied to the Average Product Category values. The
values are formatted with the currency format string.
3. Save the Sales cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


xii Module 11: Implementing Calculations Using MDX

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. Where do calculated members process?
Calculated members process on both the server and client computers.
Analysis Services is designed for client-server environments, with
clients sharing a significant amount of the work in processing
calculations.
2. Can you force Analysis Services to process all calculations on the server
computer?
Yes. If you do not want the client computers processing calculations,
you can update the Analysis Server connection string in custom client
applications. An execute location property exists that can be set to force
calculations to process entirely on the server, therefore enabling a more
thin-client deployment.
3. Are there other MDX and calculated member resources?
Yes. The course 2093A, Implementing Business Logic with MDX in
Microsoft SQL Server 2000 is a very good resource for developing
calculations in Analysis Services cubes by using MDX.
4. Can calculated members affect query performance?
Yes. Calculated members with inefficient designs can severely affect
query times. It is important to understand the proper way in which to
design complex calculated members.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 11: Implementing Calculations Using MDX xiii

Module Strategy
Use the following strategy to present this module:
! Understanding Calculated Members
Teach students that a key mechanism for performing calculations with
Analysis Server is the use of calculated members. Explain that the
expressions used to define calculated members use a language called MDX,
which stands for multidimensional expressions.
! Building Calculated Members
Introduce the Calculated Member Builder and describe its components
that assist in creating calculated members. Introduce the interface for
building calculated members in Analysis Manager—the Calculated
Member Builder, which is a dialog box used for creating calculated
members in regular and virtual cubes.
! Creating Non-Measure Calculated Members
Introduce the concept of creating calculated members in non-Measure
dimensions. Tell students that a calculated member can belong to any
dimension.
! Using Functions within Calculated Members
Discuss functions and their use in calculated members. Show that the MDX
language has many functions that are available to create complex calculated
members.
! Understanding Other Calculation Methods
Explain to students that there are calculation methods other than the creation
of calculated members. Analysis Services provides a variety of methods for
defining calculations by using MDX.
! Introducing Solve Order
Discuss the importance of setting Solve Order for calculated members. The
Solve Order feature in Analysis Services allows you to specify the order in
which calculations execute.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 11: Implementing Calculations Using MDX 1

Overview
Topic Objective
To provide an overview of
the module topics and
objectives. ! Understanding Calculated Members
Lead-in ! Building Calculated Members
In this module, you will learn
about calculated members ! Creating Non-Measure Calculated Members
and how to use them in
OLAP cubes to enhance ! Using Functions within Calculated Members
analysis.
! Understanding Other Calculation Methods
! Introducing Solve Order

In addition to performance and the intuitive nature of the multidimensional


model, the ability to perform complex calculations is one of the key benefits of
online analytical processing (OLAP). In some respects, an OLAP database is
something between a relational database and a spreadsheet. This is why OLAP
is a tool used extensively by analysts. Calculated members in Microsoft® SQL
Server™ 2000 Analysis Services play a vital role in cube functionality and
analysis.
After completing this module, you will be able to:
! Describe how calculated members work.
! Explain the mechanics of the Calculated Member Builder and create
calculated members.
! Create calculated members in non-Measure dimensions.
! Understand the use of functions in calculated members.
! Understand other calculation methods in Analysis Services.
! Understand the importance of Solve Order to generate accurate results.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


2 Module 11: Implementing Calculations Using MDX

# Understanding Calculated Members


Topic Objective
To introduce the concept of
calculated members.
Lead-in ! Comparing to Spreadsheet Formulas
A key mechanism for ! Defining Calculated Members
performing calculations with
Analysis Server is the use of
calculated members.

A key mechanism for performing calculations with Analysis Server is the use of
calculated members. A calculated member is a dimension member whose value
is based on an expression that is calculated at query time. You typically base
the calculation on existing cube data and other calculated members. You
construct calculated members from arithmetic operators, numeric constants, and
a rich set of built-in functions.
The expressions used to define calculated members employ a language called
multidimensional expressions (MDX). MDX is the query language used by
OLE DB for OLAP and thus Analysis Server. You define calculated members
by using a subset of MDX.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 11: Implementing Calculations Using MDX 3

Comparing to Spreadsheet Formulas


Topic Objective
To compare spreadsheet
formulas to calculated
members in OLAP cubes.
Lead-in
In spreadsheets, you define
calculations by using one or
many functions, numeric
computations, and cell
references. In Analysis
Services, you define
calculations by using the
same types of references.

In spreadsheets, you define calculations by using one or many functions,


numeric computations, and cell references. In Analysis Services, you define
calculations by using the same types of references.
The key difference between spreadsheet calculations and Analysis Services
calculations is that spreadsheet calculations work with a two-dimensional data
space. In Analysis Services, you define calculations across multiple dimensions.
Calculations that span multiple dimensions are difficult to understand when you
work with calculations defined in multidimensional databases.
In the preceding illustration, a spreadsheet defines the calculation, Variance,
which equals Sales minus Forecast. The Variance calculation uses cell
references to define the Sales and Forecast values. In addition, the calculation
uses the minus (-) operator to perform the calculation. As you learn more about
calculated members, notice the similarities between spreadsheet formulas and
calculated members.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


4 Module 11: Implementing Calculations Using MDX

Defining Calculated Members


Topic Objective
! Can Belong to Any Dimension
To describe the
characteristics of calculated ! Calculate at Query Time
members.
! Do Not Impact Cube Size
Lead-in
Calculated members are ! Are Usually Defined by Stored Members
usually calculated ! Can Also Be Defined by
measures, or calculations
defined in the Measures $ Other calculated members
dimension, leaving many to $ Arithmetic operators
believe that a calculated
member must be a $ Numeric constants
measure. In fact, a $ MDX functions
calculated member can
belong to any dimension. ! Can Make Use of External Function Libraries
! Appear as Stored Members to Clients

Calculated members are very different from stored dimension members. It is


important to understand the characteristics of calculated members, because
knowing how they perform will help you determine how to use them in cubes.
! Calculated members are usually calculated measures, or calculations
defined in the Measures dimension. Many believe that a calculated member
must be a measure. In fact, a calculated member can belong to any
dimension.
! All calculated members calculate at query time. Only the calculated member
definition is stored on the Analysis Server. The returned values are stored
temporarily in memory.
! Because they calculate in memory at query time, calculated members do not
increase the size of the cube.
! The expressions used to define calculated members typically refer to
existing cube data, or in other words, stored members. For example, a
calculated member named Gross Profit bases itself on two existing
members—Sales minus COGS.
! The definition of a calculated member can also refer to:
• Other calculated members
• Arithmetic operators
• Numeric constants
• A rich set of functions that are part of the MDX language

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 11: Implementing Calculations Using MDX 5

! In addition to the built-in MDX functions, Analysis Services supports


external function libraries.
• The Microsoft Visual Basic® for Applications function library is
included with Analysis Services.
• The extensive Microsoft Excel function library can be used if Excel is
installed on the client computers and Analysis Server.
• Other third-party function libraries can be used, and custom functions
can be built for use in calculated members.
! To most client front-ends, such as Excel 2000, calculated members do not
appear different from regular members.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


6 Module 11: Implementing Calculations Using MDX

Building Calculated Members


Topic Objective
To introduce the Calculated
Member Builder and
describe its components
that assist in creating
calculated members.
Lead-in
The interface for building
calculated members in
Analysis Manager is the
Calculated Member
Builder—a dialog box used
for creating calculated
members in regular and
virtual cubes.

The interface for building calculated members in Analysis Manager is the


Calculated Member Builder—a dialog box used to create calculated members
in regular and virtual cubes. The Calculated Member Builder interface
simplifies expression construction of calculated members.

Starting the Calculated Member Builder


From inside the Cube and Virtual Cube Editors, you have a variety of ways to
start the Calculated Member Builder:
! On the Insert menu, click Calculated Member.
! Click Insert Calculated Member.
! Right-click the Calculated Members folder, and then click New
Calculated Member.
! Right-click an existing calculated member, and then click Edit.
! Click an existing calculated member, and then, on the Basic tab of the
Properties pane, click Value.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 11: Implementing Calculations Using MDX 7

Components of the Calculated Member Builder


The Calculated Member Builder provides various components that assist in
developing expressions:
! Parent dimension. Defines the dimension in which you create the calculated
member. By default, the Parent dimension value is Measures.
! Parent member. Defines the member that is the parent of the calculated
member you create. The calculated member appears below the parent
member in the dimension hierarchy. You enable Parent member when the
Parent dimension selected is not the Measures dimension, and therefore
may contain more than one level in the dimension.

Note The Parent member does not determine the aggregation of the
calculated member, because calculated members do not aggregate. The Parent
member merely dictates the placement of the calculated member in the
dimension hierarchy.

! Member name. Defines the name of the calculated member. For example,
the calculated member in the preceding illustration is Average Selling
Price.
! Check. Validates the expression in the Value expression box.
! Value expression. Contains the expression used to define the calculated
member. You either type the expression into the Value expression box, or
drag dimension and function values to the box.
! Data. Defines the cube metadata containing dimension, hierarchy, level, and
member information. Add metadata to an expression by double-clicking the
object, clicking Insert, or dragging the object to the Value expression box.
! Functions. Contains the MDX functions available for creating calculated
members. Similar to the Data box, it allows you to double-click, click
Insert, or use a drag and drop operation to add functions to your
expressions. The MDX function library is included in the Function box,
plus any external function libraries that you registered in the Calculated
Member Builder.
! Insert. Inserts objects or functions from the Data or Functions box into the
Value expression box.
! Numbers and Operators. Gives you the ability to add numeric constants or
arithmetic operators to expressions without having to use the keyboard.
! Register. Allows you to register external function libraries.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


8 Module 11: Implementing Calculations Using MDX

Demonstration: Using the Calculated Member Builder


Topic Objective
To demonstrate the
Calculated Member
Builder and the
components used to create
calculated members.
Lead-in
In this demonstration, we
will create a new calculated
member in the Calculated
Member Builder.

You create calculated members to enhance analysis in cubes and virtual cubes.
Delivery Tips The Calculated Member Builder provides a simple interface for creating
The steps for this
demonstration are included
expressions and assists in developing calculated members.
in the Instructor Notes. In this demonstration, you will learn how to create a calculated member by
Encourage students to
using the Calculated Member Builder.
follow along with your
demonstration.

Tell students that they will


be performing the same
steps later in lab A, Creating
Average Price. If students
follow along with your
demonstration, they can
skip the identical procedures
when they perform the lab.

Explain each component as


you build Average Price
and encourage students to
ask questions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 11: Implementing Calculations Using MDX 9

Lab A: Creating Average Price


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will create a
new calculated member,
Average Price.

Explain the lab objectives.


Objectives
After completing this lab, you will be able to:
! Work with the Calculated Member Builder.
! Create a simple calculated member.

Prerequisites
Before working on this lab, you must have:
! Experience working with the Cube Editor.
! An understanding of dimensions, cubes, and measures.

Estimated time to complete this lab: 15 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


10 Module 11: Implementing Calculations Using MDX

Exercise 1
Creating Average Price
In this exercise, you will open the Calculated Member Builder and navigate
the Data box to view dimensions, levels, and members in the Sales cube. You
then will create a new calculated member, Average Price, and will browse the
results in the Cube Editor.

! 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\L11\Module
11.CAB, click Open, click Restore, and then click Close.
2. Double-click Module 11 to expand the database.
3. Below Module 11, double-click the Data Sources folder, right-click the
Module 11 data source, and then click Edit.
4. Click the Connection tab of the Data Link Properties dialog box, and then
verify that localhost is selected in step 1.
5. In step 2, click Use Windows NT Integrated security.
6. In step 3, click Module 11.
7. Click Test Connection and verify that the test succeeded, click OK, and
then click OK to exit the Data Link Properties dialog box.

! To review Bad Price


1. In the Module 11 database, open the Cube Editor for the Sales cube.
2. Browse the cube in the Data pane.
3. In the cube tree view, click the Bad Price measure.
Notice that Bad Price is a derived measure. What expression is defined for
Bad Price in the Source Column?
"dbo"."SalesFact"."Sales_Dollars" /
"dbo"."SalesFact"."Sales_Units"
____________________________________________________________

4. What is the value for the All Product, All Time, North American Bad
Price?
$13,061.94
____________________________________________________________

5. The value is incorrect. What should the value be equal to for the All
Product, All Time, North American Bad Price?
$2.17
____________________________________________________________

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 11: Implementing Calculations Using MDX 11

Bad Price is a derived measure that uses an expression to calculate Sales


Dollars divided by Sales Units. Measures calculate at cube processing time
and aggregate across all dimensions in the cube, based on the Aggregate
Function associated with the measure. Bad Price incorrectly sums its value
across all dimensions.
Instead of creating a derived measure for average price, you will create a
new calculated member that calculates the average. Because calculated
members do not aggregate, you will see correct values for the price.

! To open the Calculated Member Builder


1. In the Cube Editor for the Sales cube, right-click the Calculated Members
folder, and then click New Calculated Member.
The Calculated Member Builder dialog box opens. Here you create and
modify calculated members in Analysis Manager.
2. Notice the Measures dimension in the Parent dimension list.
Having the Measures dimension defined in the Parent dimension list
indicates that the new calculated member resides in the Measures
dimension. You have the option of selecting any of the cube dimensions in
the Parent dimension list. However, do not change Measures.
3. Delete the default name and then type Average Price in the Member name
box.
4. In the Data box, click the plus sign (+) to the left of the Measures
dimension.
Notice the one item, MeasuresLevel, positioned immediately below the
Measures dimension. The fact that Measures contains only one item below
it indicates that Measures contains only one level. All measures dimensions
contain only one level, because they are flat dimensions.
5. Click MeasuresLevel. Notice the status box at the bottom of the
Calculated Member Builder.
The status box contains two lines— Level: MeasuresLevel and
[Measures].[MeasuresLevel]. The first line indicates the object type of
MeasuresLevel. In this instance, MeasuresLevel is a level object. The next
line presents the official name of the object used in calculated member
expressions. In this instance, the official name of the level is
[Measures].[MeasuresLevel].
6. Click the plus sign (+) to the left of MeasuresLevel.
Notice the seven measures below MeasuresLevel. The measures exist in the
one level of the Measures dimension.
7. Click each of the seven measures and notice the object type and official
name of each one.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


12 Module 11: Implementing Calculations Using MDX

! To explore other dimensions


1. Click the plus sign (+) to the left of the State dimension.
Notice the four levels in the State dimension—(All), Country, Region, and
State.
2. Expand each of the levels in the State dimension and notice the members
below each level. Compare the State dimension to the Measures
dimension.
3. Notice that you can drill down to lower level members in each of the State
dimension levels.
4. Notice the four property templates below each member that you use to insert
various member properties into expressions.
5. Expand the Time dimension. Notice the two hierarchies in the Time
dimension—Calendar and Fiscal. Expand each of the hierarchies to the
members found at all the levels.
The Calculated Member Builder shows the hierarchy construct in
dimensions and presents hierarchies below dimensions, with the appropriate
levels and members below.

! To create Average Price


1. In the Calculated Member Builder, expand the Measures dimension to the
individual measures.
2. Double-click Sales Dollars.
Notice that [Measures].[Sales Dollars] appears in the Value expression
box. The format of the name is:
[DimensionName].[MemberName]

3. Click the division sign button (/) below the Insert button.
Notice the Value expression box contains the following expression:
[Measures].[Sales Dollars]/

4. Drag Sales Units to the Value expression box, after


[Measures].[Sales Dollars]/

The expression is now:


[Measures].[Sales Dollars]/[Measures].[Sales Units]

5. Click Check to verify that the expression is correct and then click OK.
6. Remove the right bracket from Sales Units. Notice the red left bracket,
indicating that the measure name is not correct and requires a right bracket.
7. Add the right bracket to the Sales Units measure to finish the calculation
expression.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 11: Implementing Calculations Using MDX 13

! To browse Average Price


1. In the Calculated Member Builder, click OK.
In the Data pane, you see the cube browser retrieving cube data.
2. Scroll to the right of Unique Product Count. You see the newly created
calculated member, Average Price.
When you add a new calculated member to a cube, you do not have to
reprocess the cube. The calculated member automatically produces the
correct values, assuming that the calculation expression is correct.
3. In the Calculated Members folder, click Average Price, and then click the
Advanced tab of the properties pane.
4. For the Format String property, click the Currency format.
5. Browse the cube and notice the value of the All Product, All Time, North
American Average Price. What is the value?
$2.17
____________________________________________________________

6. The value is correct, because the price calculation occurs after the
aggregation of the cube instead of before the aggregation.
7. Save the Sales cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


14 Module 11: Implementing Calculations Using MDX

Lab B: Creating Sales Variance Calculations


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will create
two new calculated
members, Sales Variance
and Sales Variance %.

Explain the lab objectives.


Objectives
After completing this lab, you will be able to:
! Create a simple calculated member.
! Create a calculated member that references another calculated member.

Prerequisites
To complete this lab, you must first complete lab A, Creating Average Price,
found earlier in this module.

Estimated time to complete this lab: 10 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 11: Implementing Calculations Using MDX 15

Exercise 1
Creating Sales Variance
In this exercise, you will create a new calculated member, Sales Variance, by
using the Calculated Member Builder.

! To create Sales Variance


1. In the Sales cube, create a new calculated member.
2. Name the calculated member Sales Variance.
3. Define the calculation expression as Sales Dollars minus Projected
Dollars.
4. Check the syntax of Sales Variance to verify that the expression is correct,
and then click OK.

! To verify Sales Variance


1. In the Cube Editor for Sales, browse the cube and notice the Sales Variance
values.
2. Verify that the calculation for Sales Variance is correct.
3. Save the Sales cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


16 Module 11: Implementing Calculations Using MDX

Exercise 2
Creating Sales Variance %
In this exercise, you will create a new calculated member, Sales Variance %,
by using the Calculated Member Builder. You will learn how to reference a
calculated member in the expression of another calculated member.

! To create Sales Variance %


1. In the Sales cube, create a new calculated member.
2. Name the calculated member Sales Variance %
3. Define the calculation expression as Sales Variance divided by Projected
Dollars.
Notice that Sales Variance appears as a measure below the Measures
dimension. You can reference calculated members in expressions of other
calculated members.
4. Check the syntax of Sales Variance % to verify that the expression is
correct, and then click OK.

! To verify Sales Variance %


1. In the Cube Editor for Sales, browse the cube and notice the Sales Variance
% values.
2. Change the Format String property for Sales Variance % to Percent, and
then browse Sales Variance % again to notice the change.
3. Verify that the calculation for Sales Variance % is correct.
4. Save the Sales cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 11: Implementing Calculations Using MDX 17

Creating Non-Measure Calculated Members


Topic Objective
To introduce the concept of
creating calculated ! Common Applications
members in non-Measure
dimensions. $ Calculate the difference between two members
Lead-in $ Calculate the average of multiple members
Though you created all the
calculated members in lab A
$ Create rollups outside of the normal hierarchy
and lab B in the Measures ! Aggregation Behavior
dimension, a calculated
member can belong to any $ Do not roll up in the parent dimension
dimension.
$ Do not affect or add to cube aggregations
! Calculated Member Intersections
$ Intersect with every member of every other dimension

Though you created all the calculated members in lab A, Creating Average
Price, and lab B, Creating Sales Variance Calculations, in the Measures
dimension, a calculated member can belong to any dimension.

Common Applications
A common application of calculated members outside the Measures dimension
is a calculated member that compares the performance of one member to
another. You can also create non-Measure calculated members to create rollups
outside the natural dimension hierarchy.
The following list contains examples of non-Measure calculated members:
! A time dimension contains members 2000 and 2001. You can create a
calculated member in the time dimension that calculates the difference, or
variance, between the two years.
! A sales representative dimension can contain a calculated member that
calculates the average performance for all sales representatives.
! A product dimension can contain a calculated member that sums products
outside their regular hierarchy aggregations.

Aggregation Behavior
Calculated members do not roll up in the parent dimension. Therefore,
calculated member values do not affect or add to cube aggregations.

Important It is possible to create calculated members that intersect with other


calculated members. When calculated members intersect, the calculation order
can affect the resulting values. The Solve Order property, discussed later in
this module, is used to prioritize the calculations.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


18 Module 11: Implementing Calculations Using MDX

Calculated Member Intersections


Like any other member, a calculated member intersects with every member of
every other dimension.
This means that if you define a calculated member in a dimension other than
Measures, it intersects with each member of the Measures dimension.
Consider a cube with a Region dimension and a Measures dimension,
containing the members shown here:
Region
East
West
East-West Average (calculated member)
Measures
Profit
Sales
COGS
The calculated member East-West Average intersects other dimensions in the
same way as the real members, East and West. It intersects with all three
measures. The intersection is virtual, however, because the calculated member
is not stored in the cube.
This intersection occurs regardless of the type of measure—dollars, units,
percentage, and so on.
When determining the placement of calculated members, consider how the
calculated member intersects with the other dimensions, especially the
Measures dimension. Include a calculated member in a non-Measures
dimension when you want the calculated member to intersect with all the
measures. If it does not seem sensible for the calculated member to intersect
with all measures, the calculated member almost certainly belongs in the
Measures dimension.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 11: Implementing Calculations Using MDX 19

Demonstration: Creating a Product Rollup


Topic Objective
To demonstrate how to
create non-Measure
dimension calculated
members.
Lead-in
In this demonstration, you
will learn how to create a
non-Measure dimension
calculated member by using
the Calculated Member
Builder.

In this demonstration, you will learn how to create a non-Measure dimension


Delivery Tips calculated member by using the Calculated Member Builder.
The steps for this
demonstration are included
in the Instructor Notes.
Encourage students to
follow along with your
demonstration.

Tell students that they will


be performing the same
steps later in lab C, Creating
Non-Measure Dimensions. If
students follow along with
your demonstration, they
can skip the identical
procedures when they
perform the lab.

Explain each component as


you build Dairy + Meat and
encourage students to ask
questions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


20 Module 11: Implementing Calculations Using MDX

Lab C: Creating a Non-Measure Dimension


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will create a
non-Measure dimension
calculated member.

Explain the lab objectives.


Objectives
After completing this lab, you will be able to:
! Create a calculated member in the Time dimension.

Prerequisites
Before working on this lab, you must have:
! Experience working with the Cube Editor.
! An understanding of dimensions, cubes, and measures.
! Experience working with the Calculated Member Builder.
! Completed lab A, Creating Average Price, found earlier in this module.
! Completed lab B, Creating Sales Variance Calculations, found earlier in this
module.

Estimated time to complete this lab: 10 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 11: Implementing Calculations Using MDX 21

Exercise 1
Creating Time Variance
In this exercise, you will create a non-Measure dimension calculated member.
The new calculated member, Time Variance, will calculate the difference
between years 2000 and 2001.

! To create a new calculated member


1. In the Cube Editor for the Sales cube, create a new calculated member.
2. In the Parent dimension list, click Time.Calendar.
The calculated member will reside in the Time.Calendar dimension.
3. Leave the Parent member box empty.
The new calculated member will exist at the same level as All Time.

! To define the calculation


1. In the Calculated Member Builder, delete the default name and name the
new calculated member Time Variance
2. Define the calculation as 2001 minus 2000.
[Time].[Calendar].[Year].&[2001]-
[Time].[Calendar].[Year].&[2000]
3. Click Check and make changes to the expression until it is correct and then
click OK.

! To browse Time Variance


1. In the Calculated Member Builder, click OK.
In the Data pane, you see the cube browser retrieving cube data.
2. Find Time Variance in the cube browser.
3. Verify that the calculation is correct for Time Variance.
4. Save the Sales cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


22 Module 11: Implementing Calculations Using MDX

Using Functions within Calculated Members


Topic Objective
To discuss functions and
their use in calculated
members. ! Used for Complex Calculations
Lead-in ! Included in the Calculated Member Builder
The MDX language contains
a rich library of functions ! Located in Specific Folders
that are available to create
complex calculated
members.

You have seen how to use simple arithmetic operators and members to define
calculated members. In addition to these simple expressions, the MDX
language contains a rich library of functions that are available to create complex
calculated members.
You create calculated members in the Calculated Member Builder. In the
Calculated Member Builder, the Functions list contains several folders. Each
folder contains MDX functions used to create calculated members.
When searching for functions in the Functions list, ask the question, “What
data or object type does the function return?” If the function returns a number,
you can find the function in the Numeric folder. If it returns a string, you can
find the function in the String folder.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 11: Implementing Calculations Using MDX 23

Demonstration: Creating a Product Average


Topic Objective
To demonstrate the use of
functions in calculated
members.
Lead-in
In this demonstration, you
will learn how to create a
calculated member by using
MDX functions.

In this demonstration, you will learn how to create a calculated member by


Delivery Tips using MDX functions.
The steps for this
demonstration are included
in the Instructor Notes.
Encourage students to
follow along with your
demonstration.

Tell students that they will


be performing the same
steps later in lab D, Creating
Calculated Members with
Functions. If students follow
along with your
demonstration, they can
skip the identical procedures
when they perform the lab.

Explain each component as


you build Average Product
Category and encourage
students to ask questions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


24 Module 11: Implementing Calculations Using MDX

Lab D: Creating Calculated Members with Functions


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will create
non-Measure dimension
calculated members that
use MDX functions.

Explain the lab objectives.


Objectives
After completing this lab, you will be able to:
! Create a calculated member that uses the Avg function.
! Create a calculated member that uses the Sum function.

Prerequisites
Before working on this lab, you must have:
! Experience working with the Cube Editor.
! An understanding of dimensions, cubes, and measures.
! Experience working with the Calculated Member Builder.
! Completed lab A, Creating Average Price.
! Completed lab B, Creating Sales Variance Calculations.
! Completed lab C, Creating a Non-Measure Dimension.

Estimated time to complete this lab: 10 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 11: Implementing Calculations Using MDX 25

Exercise 1
Creating Average Product Category
In this exercise, you will create a non-Measure dimension calculated member
that uses the Avg function. The new calculated member, Average Product
Category, calculates the average of all Category level members.

! To create a new calculated member


1. In the Cube Editor for the Sales cube, create a new calculated member.
2. In the Parent dimension list, click Product, and then change the Parent
member box value to All Product.
3. Name the new calculated member Average Product Category
Average Product Category needs to calculate an average value for the
members at the Category level of the Product dimension, across all
measures and all other dimensions.
4. In the Functions list, expand the Numeric folder.
Because the function required for this calculation produces a numeric result,
it is located in the Numeric folder.
5. Click the Avg function.
You see the required syntax for Avg and a short description of the function
in the status box at the bottom of the Calculated Member Builder.
6. Drag Avg to the Value expression box.
The Avg template appears, and includes placeholders for the required and
optional function parameters.

! To define the Set function


1. In the Calculated Member Builder, notice the Avg template:
Avg(«Set»[, «Numeric Expression»])

The chevrons (« ») indicate a placeholder for a function parameter. The


brackets ( [ ] ) indicate an optional function parameter.
2. Remove the optional parameter Numeric Expression, along with the
surrounding brackets:
[, «Numeric Expression»]

Because Average Product Category calculates all measures, you do not


need to specify a numeric expression.
3. The Value expression box contains the following template:
Avg(«Set»)

The «Set» parameter indicates that the Avg function requires a Set as its
only parameter.
In the context of this exercise, a Set defines multiple members from the
same dimension.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


26 Module 11: Implementing Calculations Using MDX

Note Sets are important fundamental MDX constructs, and are defined
thoroughly in course 2093A, Implementing Business Logic with MDX in
Microsoft SQL Server 2000.

4. In the Functions box, expand the Set folder.


The Avg function indicates the type of construct required for the
calculation—a Set function. You will define a Set function to finish the Avg
function.
5. In the Set folder, click the function Members – Level.
6. Notice the short description of the function in the Status box:
“Returns the set of all members at a specified level in a dimension.”
You will use the Members – Level function, because it returns the set of all
members at the Category level of the Product dimension.
7. Click the «Set» parameter in the Value expression box.
8. Drag Members – Level to the «Set» parameter.

! To define the Level


1. Expand the Product dimension in the Data box.
Here you see the levels found in the Product dimension. You will define
the level as the Category level, because you want the calculated member to
determine the average of all members in the Category level.
2. Click the «Level» parameter in the Value expression box.
3. Drag the Category level to the «Level» parameter.
4. The Value expression box contains the following expression:
Avg([Product].[Category].Members)

5. Verify that the syntax is correct for Average Product Category.


6. Click OK to close the Calculated Member Builder.

! To browse Average Product Category


1. Find Average Product Category in the cube browser.
2. Verify that the calculation is correct for Average Product Category.
Notice the format applied to the Average Product Category values. The
values are formatted with the currency format string.
3. Save the Sales cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 11: Implementing Calculations Using MDX 27

Exercise 2
Creating Total Quarter
In this exercise, you will create a calculated member in the Time.Calendar
dimension to test the value for the aggregated All Time member. You will use
the Sum function to add all members in the Quarter level.

! To create a new calculated member


1. In the Cube Editor for the Sales cube, create a new calculated member.
2. In the Parent dimension list, click Time.Calendar.
The calculated member will reside in the Time.Calendar dimension.
3. Leave the Parent member box empty.
The new calculated member will exist at the same level as All Time.
4. Name the new calculated member Total Quarter
Total Quarter will be used to test the All Time total. It needs to sum all
members at the Quarter level of the Time.Calendar dimension, across all
measures and all other dimensions.
5. In the Functions list, expand the Numeric folder.
6. Click the Sum function.
You see the required syntax for Sum and a short description of the function
in the status box at the bottom of the Calculated Member Builder.
7. Drag Sum to the Value expression box.

! To define the Set function


1. In the Value Expression box, remove the optional parameter Numeric
Expression, along with the surrounding brackets:
[, «Numeric Expression»]

Because Total Quarter calculates all measures, you do not need to specify
a numeric expression.
2. The Value expression box contains the following template:
Sum(«Set»)

3. In the Functions list, expand the Set folder and find the Members – Level
function.
4. Click the «Set» parameter in the Value expression box.
5. Drag Members – Level to the «Set» parameter.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


28 Module 11: Implementing Calculations Using MDX

! To define the Level


1. Expand the Time dimension, and the Calendar hierarchy in the Data box.
2. Click the «Level» parameter in the Value expression box.
3. Drag the Quarter level to the «Level» parameter.
4. The Value expression box contains the following expression:
Sum([Time].[Calendar].[Quarter].Members)

5. Verify that the syntax is correct for Total Quarter.


6. Close the Calculated Member Builder.

! To browse Total Quarter


1. Find Total Quarter in the cube browser.
2. Verify that the calculation is correct for Total Quarter by comparing it to
the value of All Time across all measures and dimensions.
3. Save the Sales cube.
4. Close the Cube Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 11: Implementing Calculations Using MDX 29

Understanding Other Calculation Methods


Topic Objective
To describe three other ! Custom Rollup Formulas
methods of defining
calculations in Analysis $ Override the Aggregate Function properties across a dimension
level
Services.
$ Apply to all members of a level
Lead-in
Analysis Services provides ! Custom Member Formulas
a variety of methods for
defining calculations by $ Replace the definition of a single member without affecting other
using MDX. members
$ Enable members to aggregate with the other dimension members
! Calculated Cells
$ Supply data values to existing cube cells based on MDX logic
$ Allow for specific calculation scope and logic

There are calculation methods other than the creation of calculated members.
Delivery Tips Analysis Services provides a variety of methods for defining calculations by
Quickly describe each type
of calculation, but do not
using MDX.
spend too much time here.
The calculations are outside Note For more information on other calculation methods, refer to SQL Server
the scope of this course, Books Online or see course 2093A, Implementing Business Logic with MDX in
and you should therefore Microsoft SQL Server 2000.
refer students to course
2093A, Implementing
Business Logic with MDX in
Microsoft SQL Server 2000 Custom Rollup Formulas
and SQL Server Books You create custom rollup formulas in dimensions by using MDX expressions.
Online for more information. The following list describes custom rollup formulas:

Give students brief ! Custom rollup formulas override the Aggregate Function properties
examples of when they use defined for the cube measures across a dimension level.
each type of calculation.
! You use custom rollup formulas when you need members to aggregate
differently from the standard Aggregate Function properties defined for
measures.
For example, if you do not want Quarter member values to sum to the
Year level, you can create a custom rollup formula for the Year level,
defining its calculation as the following expression:
Time.CurrentMember.LastChild

The expression references the last child, or Quarter 4, of the


CurrentMember, or the current year. Now, the value for each Year is
equal to the value for its Quarter 4 child.
! The MDX calculations defined for custom rollup formulas apply to all
members in the specified level.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


30 Module 11: Implementing Calculations Using MDX

! You create custom rollup formulas by updating level properties in the


Dimension Editor or Cube Editor, depending on whether the dimension is
shared or private.
• You update the Custom Rollup Formula property for lower levels of a
dimension.
• You update the All Member Formula property for the All level of a
dimension.
! You cannot use a custom rollup formula in a cube containing a Distinct
Count measure.

Custom Member Formulas


You use a custom member formula to define a calculation for a member across
all dimensions in a cube. The following list describes custom member formulas:
! A custom member formula allows you to replace the definition of a single
member of a dimension without affecting any other members in the
dimension.
! Custom member formulas override the Aggregate Function properties
defined for the cube measures across a dimension member.
! Custom member formulas are calculations developed by using MDX, like
custom rollup formulas.
! You use custom member formulas when you need individual members to
aggregate differently from the standard Aggregate Function properties
defined for measures.
For example, in an Account dimension, you can define the calculation for
Gross Sales in one cube as being equal to a Sales value from another cube,
by using the LookUpCube MDX function.
Because you want only Gross Sales to use this calculation, you define the
calculation as a custom member formula instead of a custom rollup formula.
The value for Gross Sales is then included in any cube aggregations.
! Custom member formulas are stored in the dimension table.
• You can use an existing column in the dimension table to store the
member formulas.
• You can create a new column in the dimension table and can update the
dimension in Analysis Manager if the dimension is write-enabled.
Otherwise, you must update the table through an interface other than
Analysis Manager.
! Because the member is defined in the dimension table, it participates in any
aggregations or rollups defined in the cube.
! You enable custom member formulas by updating level properties in the
Dimension Editor or Cube Editor, depending on whether the dimension is
shared or private.
• You update the Custom Members property for levels of a dimension.
! The MDX calculations defined for custom member formulas apply to the
specified member across all dimensions.
! If a level contains a custom rollup formula and custom member formulas,
the custom member formulas will override the custom rollup formula.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 11: Implementing Calculations Using MDX 31

Calculated Cells
Calculated cells are similar to calculated members, except that they supply data
for an existing range of cells, or even a single cell, instead of creating a single
member applied across all other dimensions. The following list describes
calculated cells:
! Calculated cells are calculations developed by using MDX that supply
values for cells in a specified range of existing cells.
! You create calculated cells when you require a calculation applied to a finite
number of cube cells and not to all cells across a single dimension.
For example, to apply a Budget Expense allocation calculation to only
those stores in Illinois that produce Sales in excess of $500,000, you can
create a calculated cell that focuses on those specific cells. You therefore
avoid creating a separate calculated member that calculates across all stores
for Budget and Actual values.
! The original cell values are not lost when you create calculated cells.
Therefore, you do not affect underlying data when adding calculated cells to
a cube.
! Calculated cell results are not stored, they evaluate at query time.
! You create calculated cells by first defining a calculation subcube, or a
range of cells in a cube.
! You must also define a calculation condition and a calculation formula.
• The calculation condition determines which cells perform the calculation
formula.
• The calculation formula is the MDX used to calculate the cells specified
by the calculation condition.
! You create calculated cells by using the Calculated Cells Wizard.
! If a cube cell contains a custom member formula and a calculated cell
formula, the calculated cell formula overrides the custom member formula.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


32 Module 11: Implementing Calculations Using MDX

Introducing Solve Order


Topic Objective
To discuss the importance Sales $ Units Sales $ / Units
of setting Solve Order for
calculated members.
Bread 100 150 0.67
Lead-in
Dairy 100 75 1.33
The Solve Order feature in Meat 300 75 4.00
Analysis Services allows
you to specify the order in Dairy + Meat 400 150 2.67
which calculations execute.
Sales $ Units Sales $ / Units
Bread 100 150 0.67
Dairy 100 75 1.33
Meat 300 75 4.00
Dairy + Meat 400 150 5.33

The Solve Order property in Analysis Services allows you to specify the order
Delivery Tips in which calculations execute.
Present this build slide in
the following order: In the preceding illustration, two calculations exist in the cube—Average Sales
1. Explain that the two and Dairy + Meat. Average Sales equals Sales divided by Units, and Dairy +
spreadsheets demonstrate
Meat equals Dairy plus Meat.
two orders of calculation for
the same data values. Because the two calculations exist in separate dimensions, Measures and
2. Sequentially explain the Product, the calculations intersect. The two calculations define the intersection:
calculations in the top
spreadsheet, with Dairy + ! Dairy + Meat
Meat calculating first.
3. Next, sequentially explain ! Sales / Units
the calculations in the If the Dairy + Meat member calculates before the Average Sales member, the
bottom spreadsheet, with intersection result is equal to $2.67. The calculation steps are as follows:
Average Sales calculating
first. 1. Dairy + Meat for Sales = 400
4. Ask students which
calculation they prefer. They 2. Dairy + Meat for Units = 150
should say the top 3. (Dairy + Meat for Sales) / (Dairy + Meat for Units) = 400 / 150 = 2.67
calculation.
5. Finally, explain that you This is the expected result. However, if the Dairy + Meat member calculates
set the calculation order by after the Average Sales member, the result is equal to $5.33. Consider the
using the Solve Order calculation order:
property, and describe
where and how to define it 1. Sales / Units for Dairy = $1.33
in the Cube Editor.
2. Sales / Units for Meat = $4.00
3. (Sales / Units for Dairy) + (Sales / Units for Meat) = $1.33 + $4.00 =
$5.33

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 11: Implementing Calculations Using MDX 33

The two results are very different. You can define the order of the two
calculations by updating the Solve Order property. Managing Solve Order is
critical in a multidimensional environment when calculations intersect. It is
important that you understand Solve Order and update the property in specific
situations.

Setting Solve Order


Solve Order can be set on the Advanced tab of the calculated member
Properties pane in the Cube Editor. This is the only place in Analysis Manager
where you can set Solve Order.
Following are characteristics of the Solve Order:
! The Solve Order property accepts an integer value that determines the
priority for solving the formula.
! The higher the integer of Solve Order for a calculated member, the later the
member calculates.
! A Solve Order value of 1 calculates after a Solve Order of 0. Solve Order
2 calculates after Solve Order 1, and so on.

Set the Solve Order property in calculated members that exist in separate
dimensions, and therefore intersect at cells. If you do not set the Solve Order
property, Analysis Services sets the calculation order based on order
declarations, which could give you misleading results. Different calculation
types—for example calculated cells, custom member formulas, and calculated
members—use different solve orders. You can refer to SQL Server Books
Online for a listing of the default solve orders for each type of calculation.

Note Solve Order and Pass Order (the order of calculation stages) are very
complex concepts. For more information on both concepts, refer to SQL Server
Books Online or course 2093A, Implementing Business Logic with MDX in
Microsoft SQL Server 2000.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


34 Module 11: Implementing Calculations Using MDX

Review
Topic Objective
To reinforce module
objectives by reviewing key
points. ! Understanding Calculated Members
Lead-in ! Building Calculated Members
The review questions cover
some of the key concepts ! Creating Non-Measure Calculated Members
taught in the module.
! Using Functions within Calculated Members
! Understanding Other Calculation Methods
! Introducing Solve Order

1. How does a calculated member differ from a derived measure?


A calculated member is not stored in the cube, but a derived measure is
stored in the cube.
A calculated member uses MDX to perform calculations, and a derived
measure uses SQL.
When you add a calculated member to a cube, you do not need to
process the cube. You must reprocess the cube after adding a derived
measure.
Derived measures must exist in the Measures dimension. Calculated
members can exist in any dimension.
You can only have 1,024 derived measures. You can have 65,535
calculated members.
Calculated members do not aggregate and derived measures do
aggregate.

2. Do calculated members increase cube size?


No, only cube metadata size.

3. When you add a calculated member to a cube, must the cube be


reprocessed?
No.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 11: Implementing Calculations Using MDX 35

4. Can SQL expressions be used to define a calculated member?


No.

5. What types of cube calculations use MDX?


Calculated members, custom rollup formulas, custom member
formulas, and calculated cells use MDX.

6. Where do you update the Solve Order property? Give an example of when
the solve order might be used.
You update the Solve Order property on the Advanced tab of the
Properties pane in the Cube Editor.
Use Solve Order when calculated members intersect, or when multiple
calculations depend on each other.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 12: Working
with Virtual Cubes

Contents

Overview 1
Understanding Virtual Cubes 2
Obtaining Logical Results 4
Building a Virtual Cube 5
Lab A: Creating Virtual Cubes 10
Creating Calculated Members 14
Lab B: Adding Calculated Members to a
Virtual Cube 16
Review 19
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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 12: Working with Virtual Cubes iii

Instructor Notes
Presentation: A virtual cube is an online analytical processing (OLAP) cube that combines or
25 Minutes extracts data from one or more source cubes. These cubes are called virtual
because they consume no disk storage, other than metadata. In this module,
Labs: students learn when to use virtual cubes and the mechanics of how to build
20 Minutes them in Microsoft® SQL Server™ 2000 Analysis Services.
After completing this module, students will be able to:
! Understand when to use virtual cubes and know their benefits.
! Know the rules for constructing meaningful virtual cubes.
! Build virtual cubes by using the Virtual Cube Wizard.
! Define calculated members in virtual cubes by using the Calculated Member
Builder.

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 Microsoft PowerPoint® file 2074A_12.ppt.

Preparation Tasks
To prepare for this module, you should:
! Read all of the student materials for this module.
! Read the instructor notes and margin notes.
! Complete the labs.
! 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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


iv Module 12: Working with Virtual Cubes

Other Activities
Difficult Questions
Below are difficult questions that students may ask you during the delivery of
this module and answers to the questions. There 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 does the enabling or disabling of levels in the source cube affect the
enabling or disabling of levels in the virtual cube?
Enabling or disabling levels in the source cube does not affect the
enabling or disabling of levels in the virtual cube. Levels in the source
cube are completely separate from levels in the virtual cube, so that,
when users are using a virtual cube, they can access members for
querying or for creating calculations down to the lowest level in the
dimension, regardless of level enabling or disabling in the source cube.
2. Can you add a virtual dimension to a virtual cube without also adding the
dimension on which the virtual dimension depends?
No. When you add a virtual dimension to a virtual cube, the regular
dimension is added to the virtual cube automatically.
3. Can you base virtual cubes on linked cubes?
Yes.
4. When you process a source cube, are all virtual cubes that use the source
cube data automatically processed?
No.
5. Can a virtual cube combine source cubes that use multidimensional OLAP
(MOLAP), relational OLAP (ROLAP), and hybrid OLAP (HOLAP) storage
modes?
Yes.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 12: Working with Virtual Cubes v

Module Strategy
Use the following strategy to present this module:
! Understanding Virtual Cubes
Begin with a definition of virtual cubes and describe their characteristics.
Discuss virtual cube limitations and storage.
! Obtaining Logical Results
Explain that, when building a virtual cube from more than one source cube,
students must follow some simple rules to obtain logical results. Explain
that they need to use dimensions and measures that the source cubes have in
common—otherwise there is no analytical value in combining the cubes.
! Building a Virtual Cube
Introduce students to the Virtual Cube Wizard. While giving the lecture,
open the Virtual Cube Wizard on your computer and show students the
various interfaces. Describe the steps involved in creating a virtual cube—
choosing the source cube, choosing the measures, choosing the dimensions,
and finalizing the cube.
! Creating Calculated Members
Explain that calculated members can be added to virtual cubes by using the
Virtual Cube Editor. Describe the different ways to add calculated members
to virtual cubes—creating calculated members and importing them.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 12: Working with Virtual Cubes 1

Overview
Topic Objective
To provide an overview of
the module topics and
objectives. ! Understanding Virtual Cubes
Lead-in ! Obtaining Logical Results
In this module, you will learn
about virtual cubes and how ! Building a Virtual Cube
to create them.
! Creating Calculated Members

A virtual cube is an online analytical processing (OLAP) cube that combines or


extracts data from one or more source cubes. These cubes are called virtual
because they consume no disk storage other than metadata. In this module, you
will learn when to use virtual cubes and the mechanics of how to build them in
Microsoft® SQL Server™ 2000 Analysis Services.
After completing this module, you will be able to:
! Understand when to use virtual cubes and know their benefits.
! Know the rules for constructing meaningful virtual cubes.
! Build virtual cubes by using the Virtual Cube Wizard.
! Define calculated members in virtual cubes by using the Calculated Member
Builder.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


2 Module 12: Working with Virtual Cubes

Understanding Virtual Cubes


Topic Objective
To introduce the
! Virtual Cube Characteristics
characteristics, limitations, # Combine data from multiple cubes
and storage of virtual cubes.
Lead-in
# Provide users with a subset of a single cube
A virtual cube combines or # Are used to limit user access to cube data
extracts data from one or
more source cubes. In many ! Dimension Limitations
respects, a virtual cube is to
Analysis Server what a view # Cannot slice dimensions
is to a relational database
management system
# Cannot include only some of a dimension’s levels
(RDBMS). ! Storage and Performance
# Can include MOLAP, ROLAP, and HOLAP cubes
# Provide endless cube flexibility

A virtual cube is a cube that combines or extracts data from one or more source
cubes. In many respects, a virtual cube is to Analysis Server what a view is to a
relational database management system (RDBMS)—it provides a different view
of the underlying data without storing any additional data except the metadata
that defines the virtual cube.

Note This module defines virtual cubes as being derived from source cubes.
Source cubes are the cubes from which a virtual cube is derived.

Virtual Cube Characteristics


To users and applications, a virtual cube is simply a cube. It looks and behaves
exactly like a source cube. A virtual cube can be used to:
! Combine data from two or more source cubes. For example, a cube
containing sales data might be combined with a cube containing forecasts to
measure actual sales versus forecast sales.

Note If a virtual cube is based on more than one source cube, when the
virtual cube is queried, it queries the source cubes in parallel.

A virtual cube can combine up to 64 source cubes.


! Provide users with a subset of the dimensions and measures from a single
source cube. This is useful when a source cube contains a great many
measures and dimensions, and a group of users is interested in only a subset.
! Provide users with a subset of the dimensions and measures from a single
source cube as a security measure. For instance, the source cube might
contain a profit measure that certain users or groups of users are not allowed
to see.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 12: Working with Virtual Cubes 3

There is no limit to the number of virtual cubes that can be defined in a


database.

Dimension Limitations
Following are limitations of virtual cubes:
! Virtual cubes cannot slice the dimensions of the source cubes. For example,
suppose a source cube contains the dimension Region. If Region is placed
in a virtual cube, the entire dimension is included. You cannot include only
the Western region.
! You cannot choose which levels of the dimension are included. For
example, you cannot include summary levels and exclude bottom-level
members. The entire dimension, with all levels, must be included.

The Measures dimension is an exception to these rules. You can pick the
specific measures that populate a virtual cube.

Storage and Performance


Because virtual cubes consume no disk space, they rely on the underlying
storage of the source cubes. Therefore:
! A single virtual cube can include multidimensional OLAP (MOLAP),
relational OLAP (ROLAP), and hybrid OLAP (HOLAP) source cubes.
! Because a single source cube can contain MOLAP, ROLAP, and HOLAP
partitions, there is endless flexibility in designing virtual cubes.

Virtual cubes automatically use aggregations from the source cubes. The
performance overhead imposed by the virtual cube on top of the source cubes is
negligible.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


4 Module 12: Working with Virtual Cubes

Obtaining Logical Results


Topic Objective
To explain the importance of
using common measures
and dimensions from the
source cubes.
Lead-in
When building a virtual cube
based on more than one
source cube, you must
follow some simple rules to
obtain logical results.

When building a virtual cube based on more than one source cube, you must
Delivery Tips follow some simple rules to obtain logical results.
Explain the preceding
illustration by comparing two Common dimensions and measures are required from source cubes:
cubes with different
dimensionality. Combining ! The source cubes should contain one or more shared dimensions that are the
them into a virtual cube same, and at least one of the common shared dimensions should be included
would produce nonsensical in the virtual cube.
results.
! Analysis Manager does not enforce this rule, but the result will be
nonsensical if it is not followed. This can be easily visualized from the
preceding spreadsheet illustration. The first cube contains region and time
dimensions. The second cube contains sales representatives and scenario
dimensions. Because the two cubes have nothing in common, it makes no
sense to base a virtual cube on them.

Note There is no analytical value in combining cubes if they do not share a


dimension.

! Include at least one measure from each source cube in the virtual cube or
there is no reason to combine the cubes. Again, Analysis Manager will not
prevent you from doing this.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 12: Working with Virtual Cubes 5

$ Building a Virtual Cube


Topic Objective
To go through the steps of
creating a virtual cube.
Lead-in ! Choosing the Source Cubes
To create a virtual cube, you ! Choosing the Measures
use the Virtual Cube
Wizard. ! Choosing the Dimensions
! Finalizing the Virtual Cube

You build a virtual cube simply by using the Virtual Cube Wizard. To display
the wizard, right-click the Cubes folder and then click New Virtual Cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


6 Module 12: Working with Virtual Cubes

Choosing the Source Cubes


Topic Objective
To show how to choose
source cubes for a virtual
cube.
Lead-in
The first step in creating a
virtual cube is to select the
source cube or cubes for the
virtual cube.

At the first step of the Virtual Cube Wizard, select the source cube or cubes
Delivery Tip from which the virtual cube will be derived.
Enhance your lecture by
opening the Virtual Cube
Wizard and showing Tip Remember that if you select multiple source cubes, these cubes should
students the corresponding have at least one shared dimension in common.
interfaces.

Encourage students to To select a source cube, either click a cube from the Available cubes box and
follow along with your then click the arrow (>), or double-click the cube. To select all the cubes, click
demonstration on their the double arrow (>>). The names of the selected cubes appear in the Virtual
computers. cube includes box. To remove a cube from this list, either click the cube and
then click the back arrow (<), or double click the cube in the Virtual cube
includes box.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 12: Working with Virtual Cubes 7

Choosing the Measures


Topic Objective
To show how to select
measures for a virtual cube.
Lead-in
The next step is to add
measures to the virtual
cube.

The next step is to add measures to the virtual cube. The wizard displays the
Delivery Tip measures from the selected source cube or cubes in the Available measures
Encourage students to box.
follow along with your
informal demonstration on
their computers. Tip Remember to include at least one measure from each source cube. The
source cube name appears in the second column of the Available Measures
box.

To select a measure, either click a measure from the Available measures box
and then click the arrow (>), or double-click the measure. To select all the
measures, click the double arrow (>>). The names of the selected measures
appear in the Selected measures box. To remove a measure from this list,
either click the measure and then click the back arrow (<), or double click the
measure in the Selected measures box.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


8 Module 12: Working with Virtual Cubes

Choosing the Dimensions


Topic Objective
To show how to choose
dimensions for a virtual
cube.
Lead-in
The next step is to choose
the dimensions for the
virtual cube.

Next, choose the dimensions. The wizard displays the dimensions from the
Delivery Tip selected source cube or cubes in the Available dimensions box.
Encourage students to
follow along with your
informal demonstration on Tip If the virtual cube is based on more than one source cube, you must select
their computers. at least one shared dimension in common between the cubes to obtain a logical
result.

To select a dimension, either click a dimension from the Available dimensions


box and then click the arrow (>) or double-click the dimension. To select all the
dimensions, click the double arrow (>>). The names of the selected dimensions
appear in the Selected dimensions box. To remove a dimension from this list,
either click the dimension and then click the back arrow (<) or double-click the
dimension in the Selected dimensions box.
The list of dimensions includes all virtual dimensions defined in the source
cubes. A virtual dimension can be placed in a virtual cube. The dimension from
which it is derived will be placed in the virtual cube automatically. You cannot
include a virtual dimension in a virtual cube without also including the
dimension on which it is based.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 12: Working with Virtual Cubes 9

Finalizing the Virtual Cube


Topic Objective
To explain how to name and
process a virtual cube.
Lead-in
The last two steps are to
name the cube and process
it.

The last steps are to name the cube and process it. Because a virtual cube
Delivery Tip contains no data, it processes quickly. Type the name of the virtual cube in the
Encourage students to Virtual cube name box and then decide when to process the cube—now or
follow along with your later. Click the appropriate radio button and then click Finish.
informal demonstration on
their computers.
Note If the source cubes or dimensions are not available at the time of
processing a virtual cube, the Analysis Server processes the cubes and
dimensions automatically as part of the virtual cube process.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


10 Module 12: Working with Virtual Cubes

Lab A: Creating Virtual Cubes


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will create
two virtual cubes. You first
will create a virtual cube as
a subset of a source cube.
You will then create a virtual
cube from two source
cubes.

Explain the lab objectives.


Objectives
After completing this lab, you will be able to:
! Create a virtual cube that is a subset of an existing cube.
! Create a virtual cube from multiple source cubes.

Prerequisites
Before working on this lab, you must have:
! Experience working with Analysis Manager.
! An understanding of virtual cubes.

Estimated time to complete this lab: 10 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 12: Working with Virtual Cubes 11

Exercise 1
Creating the Basic Sales Virtual Cube
In this exercise, you will build a virtual cube, Basic Sales, that is a subset of the
Sales cube. This virtual cube does not contain certain sensitive data, such as
Sales by Employee. By giving users access to the Basic Sales virtual cube
instead of the Sales cube, you can limit their access to certain data.

! 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, find and click the file
C:\Moc\2074A\Labfiles\L12\Module 12.CAB, click Open, click Restore,
and then click Close.
2. To expand the database, double-click Module 12.
3. Double-click the Data Sources folder below Module 12, right-click the
Module 12 data source, and then click Edit.
4. In the Data Link Properties dialog box, click the Connection tab, and then
verify that localhost is selected in step 1.
5. In step 2, verify that Use Windows NT Integrated security is selected.
6. In step 3, verify that Module 12 is selected.
7. Click Test Connection and verify that the test succeeded, click OK, and
then click OK to exit the Data Link Properties dialog box.

! To start the Virtual Cube Wizard


1. In the Module 12 database, right-click the Cubes folder, and then click
New Virtual Cube.
2. To bypass the welcome page, click Next.

! To select the source cube


• In the Available cubes box, double-click the Sales cube, and then click
Next.
The wizard shows the regular measures (not calculated members) in the
selected database.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


12 Module 12: Working with Virtual Cubes

! To select measures and dimensions


1. In the Available measures box, double-click the following measures:
• Sales Units
• Sales Dollars
2. Click Next.
3. In the Available dimensions box, double-click the following dimensions:
• Time.Calendar
• Product
• State
4. Click Next.

! To finalize the cube


1. Type Basic Sales in the Virtual cube name box, click Process now, and
then click Finish. Close the Process dialog box.
The Virtual Cube Wizard leaves you in the Virtual Cube Editor.
2. Browse the cube data, and then close the Virtual Cube Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 12: Working with Virtual Cubes 13

Exercise 2
Creating the Actual and Forecast Cube
In this exercise, you will build a virtual cube combining the Sales and Sales
Forecast cubes. The Sales cube contains sales information and the Sales
Forecast cube contains forecast information. You will combine the two cubes
to compare forecast units with sales units.

! To start the Virtual Cube Wizard


1. In the Module 12 database, right-click the Cubes folder, and then click
New Virtual Cube.
2. To bypass the welcome page, click Next.

! To select the source cubes


• In the Available cubes box, double-click the Sales cube, and then double-
click the Sales Forecast cube. Click Next.

! To select measures and dimensions


1. In the Available measures box, double-click the following measures:
• Sales Units from the Sales cube.
• Sales Units from the Sales Forecast cube.
You want to compare the same measure from two different cubes. Note that,
because the virtual cube requires a unique name for each measure, the
wizard names the second Sales Units measure Sales Units 1.
2. To rename the Sales Units 1 measure, click it, and then press F2.
3. When the name appears highlighted, type Forecast Units as the new name
for the measure. Click Next.
4. In the Available dimensions box, double-click the following dimensions:
• Product
• Time.Calendar
• Scenario
5. Click Next.

! To finalize the cube


1. Type Actual and Forecast in the Virtual cube name box, click Process
now, and then click Finish. Close the Process dialog box.
The Virtual Cube Wizard leaves you in the Virtual Cube Editor.
2. Notice the cube intersections where no data exists.
3. Browse the cube data, and then close the Virtual Cube Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


14 Module 12: Working with Virtual Cubes

Creating Calculated Members


Topic Objective
To explain how to create
calculated members in a
virtual cube.
Lead-in
You can create or import
calculated members in
virtual cubes.

You can create calculated members in virtual cubes. In addition, you can import
calculated members from the source cubes. The interface for managing
Delivery Tip calculated members in virtual cubes is very similar to the interface used in
Encourage students to regular cubes.
follow along with your
informal demonstration on Working with the Virtual Cube Editor
their computers.
After you create a virtual cube, it appears in the list of cubes below the Cubes
folder in Analysis Manager. If you need to edit a virtual cube, right-click the
cube and then click Edit. The Virtual Cube Editor opens.
The Virtual Cube Editor is similar to the Cube Editor that you use to manage
regular cubes.
! Like the Cube Editor, the Virtual Cube Editor contains the cube tree view
and the Properties pane.
! Whereas the Cube Editor has a schema and data pane, the Virtual Cube
Editor has only a data pane containing the Cube Browser.
! You can create new calculated members, calculated cells, actions, and
named sets in the Cube Editor and the Virtual Cube Editor.
! In addition to creating new calculated members, calculated cells, actions,
and named sets, you can import these objects into virtual cubes by using the
Virtual Cube Editor.
! As in the Cube Editor, when you create new calculated members in the
Virtual Cube Editor, you use the Calculated Member Builder to define and
edit the calculations.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 12: Working with Virtual Cubes 15

Importing Calculated Members


As you modify a virtual cube, you can reuse calculations created in the source
cubes. You import the calculations into the virtual cube by using the Virtual
Cube Editor.

Note In addition to calculated members, you can also import calculated cells,
actions, and named sets defined in the source cubes. For more information on
actions, see module 14, “Using Actions, Drillthrough, and Writeback,” in
course 2074A, Designing and Implementing OLAP Solutions with Microsoft
SQL Server 2000.

To import calculated members into a virtual cube by using the Virtual Cube
Editor, right-click the Calculated Members folder and click Import
Calculated Member. This opens the Import Calculated Members dialog box.
From this dialog box, you can select individual or all calculated members from
source cubes.
As you import a calculated member into a virtual cube, the Virtual Cube Editor
verifies that the syntax remains correct in the new cube definition. All
measures, dimensions, and members defined in the calculated member must
exist in the virtual cube for the calculated member to be valid.
If you receive an error when importing a calculated member, the Virtual Cube
Editor indicates the problem, but still imports the calculated member so that
you can edit the calculation if you choose.
If the syntax is incorrect, edit calculated members in the Virtual Cube Editor by
right-clicking the imported calculated member that requires editing and then
clicking Edit.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


16 Module 12: Working with Virtual Cubes

Lab B: Adding Calculated Members to a Virtual Cube


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will create a
calculated member in the
Actual and Forecast virtual
cube. In addition, you will
import a calculated member
from the Sales source cube.

Explain the lab objectives.


Objectives
After completing this lab, you will be able to:
! Create a calculated member in a virtual cube.
! Import a calculated member into a virtual cube.

Prerequisites
Before working on this lab, you must have:
! Experience working with Analysis Manager.
! An understanding of virtual cubes.
! An understanding of calculated members.
! Experience working with the Calculated Member Builder.

Lab Setup
To complete this lab, you need the following:
! To have completed lab A, Creating Virtual Cubes, found earlier in the
module.

Estimated time to complete this lab: 10 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 12: Working with Virtual Cubes 17

Exercise 1
Creating a Calculated Member
In this exercise, you will create a calculated member in a virtual cube. When
you create a virtual cube from multiple source cubes, include at least one
measure from each source cube. Often, it makes sense to create a calculated
member to compare the measures. In this case, you will create a calculated
member in the Actual and Forecast virtual cube that subtracts Sales Units
from Forecast Units.

! To open the Virtual Cube Editor


• In the Module 12 database, right-click the Actual and Forecast virtual
cube, and then click Edit.
The Virtual Cube Editor opens.

! To create a calculated member


1. In the Virtual Cube Editor, on the toolbar, click Insert Calculated
Member.
The Calculated Member Builder opens.
2. Type Delta Units in the Member name box.
3. Expand Measures and MeasuresLevel in the Data box. Double-click
Forecast Units, click the minus sign (-), and then double-click Sales Units.
Click OK.
4. Browse the cube data.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


18 Module 12: Working with Virtual Cubes

Exercise 2
Importing a Calculated Member
In this exercise, you will import a calculated member from a source cube into a
virtual cube. The virtual cube must include any members used by the calculated
member. The Sales cube contains a calculated member called Average Units,
which uses the Sales Units and Count measures. In this exercise, you will
import the Average Units calculated member from the Sales cube into the
Actual and Forecast virtual cube.

! To import a calculated member


1. In the Virtual Cube Editor, click Import Calculated Members.
The Import Calculated Members dialog box opens.
2. Select the Average Units check box, and then click OK.
You receive an error after the import. The Average Units calculated
member from the Sales cube uses the Count measure in the calculation.
However, the Actual and Forecast virtual cube does not contain the Count
measure. You will add the Count measure before finishing the Average
Units calculated member.
3. Click OK.

! To add the Count measure


1. In the Virtual Cube Editor, right-click the Measures folder, and then click
Edit Structure (Wizard).
2. Click Yes to save the virtual cube.
The Virtual Cube Wizard opens.
3. Click Next when asked to select the source cubes.
4. In the Available measures pane, double-click Count. Click Next twice,
click Finish, and close the Process dialog box.
5. Browse the cube, and notice that Average Units appears in the cube
browser and is retrieving correct data.
Also, notice that the Count measure is not visible in the virtual cube. The
Visible property value of Count from the Sales cube persists in the virtual
cube.
6. Close the Virtual Cube Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 12: Working with Virtual Cubes 19

Review
Topic Objective
To reinforce module
objectives by reviewing key
points. ! Understanding Virtual Cubes
Lead-in ! Obtaining Logical Results
The review questions cover
some of the key concepts ! Building a Virtual Cube
taught in the module.
! Creating Calculated Members

1. Does a virtual cube consume disk storage?


No, except for the underlying metadata defining the virtual cube.

2. Can you specify the levels in a shared dimension that display in a virtual
cube?
No. A shared dimension added to a virtual cube must include all
defined levels. You cannot include only some of the levels.

3. Is it possible to build a virtual cube when the source cubes do not contain a
dimension in common?
Yes, but it is not recommended.

4. Where do you create and import calculated members in virtual cubes?


In the Virtual Cube Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 13: Using Excel
as an OLAP Client

Contents

Overview 1
Office 2000 OLAP Components 2
Using Excel PivotTables 4
Using PivotCharts 11
Lab A: Creating PivotTables and
PivotCharts 14
Working with Local Cubes 20
Creating OLAP-Enabled Web Pages 24
Lab B: Working with Local Cubes and Web
Pages 26
Review 29
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.

 1999 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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 13: Using Excel as an OLAP Client iii

Instructor Notes
Presentation: Microsoft® PivotTable® Service (PTS) is bundled with Microsoft Office 2000.
30 Minutes PTS works not only with Microsoft SQL Server™ 2000 Analysis Services, but
also with data sources such as relational databases.
Lab:
30 Minutes Microsoft Excel 2000, a major component of Office 2000, provides powerful
online analytical processing (OLAP) functionality to developers and users.
This module is an overview of Excel 2000 OLAP features. It gives students the
opportunity to create and manipulate the various Office 2000 OLAP interfaces.
After completing this module, students will be able to:
! Understand the various Microsoft Office 2000 OLAP features.
! Create a PivotTable from an OLAP cube.
! Create PivotCharts.
! Create local cube files.
! Create a Web page containing Pivot Web components.

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_13.ppt

Preparation Tasks
To prepare for this module, you should:
! Read all the student materials.
! Read the instructor notes and margin notes.
! Complete the demonstration.
! Practice integrating the demonstrations with the lecture.
! Complete the labs.
! 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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


iv Module 13: Using Excel as an OLAP Client

Demonstration: Creating a PivotTable


The following demonstration procedures provide information that will not fit in
Demonstration: the margin notes or is not appropriate for student notes.
10 Minutes
In this demonstration, you will learn how to create a PivotTable that connects to
OLAP cubes.

! 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\L13\Module
13.CAB, click Open, click Restore, and then click Close.
2. Double-click Module 13 to expand the database.
3. Below Module 13, double-click the Data Sources folder, right-click the
Module 13 data source, and then click Edit.
4. Click the Connection tab of the Data Link Properties dialog box, and then
verify that localhost is selected in step 1.
5. In step 2, verify that Use Windows NT Integrated security is selected.
6. In step 3, verify that Module 13 is selected.
7. Click Test Connection and verify that the test succeeded. Click OK twice.

! To define a data source


1. Click Start, point to Programs, and then click Microsoft Excel.
2. From the empty Excel worksheet, click the Data menu, and then click
PivotTable and PivotChart Report.
Step1 of the PivotTable and PivotChart Report Wizard appears.
3. From the Where is the data you want to analyze pane, click External data
source, and then click Next.
Step 2 of the wizard appears, which contains a button to specify the external
data source.
4. Click Get Data.
Microsoft Query starts and the Choose Data Source dialog box opens.
5. Click the OLAP Cubes tab and then click <New Data Source> from the
list. Click OK.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 13: Using Excel as an OLAP Client v

! To define the cube


1. In the Create New Data Source dialog box, type Sales for the data source
in entry 1.
2. For entry 2, click Microsoft OLE DB Provider for OLAP Services 8.0
from the list, and then click Connect
The Multidimensional Connection dialog box appears.
3. Click the Analysis Server option, and type localhost in the Server box.
Click Next.
A list of databases defined on the Analysis Server displays.
4. From the database list, click the Module 13 database, and then click Finish.
The Create New Data Source dialog box appears again.
5. For entry 4, click the Sales cube from the list. Click OK to close the dialog
box.

Note Creating an OLAP Cube data source creates a file in the


Application Data\Microsoft\Queries folder for the current user. The location
of the Application Data folder varies depending on the version of Microsoft
Windows® you are using, and whether Windows is set up for multiple users.
The file has the name you gave to the data source, with .oqy—for OLAP
Query—as the extension, and is registered with the Microsoft Excel OLAP
Query file type. Double-clicking the OLAP query data source file starts
Excel and creates a new PivotTable report based on that data source.

6. The Choose Data Source dialog box appears again. Click OK.
7. Step 2 of the PivotTable Wizard appears again. Click Next and then click
Finish.
A skeletal PivotTable report appears on the worksheet, along with a
PivotTable toolbar that displays all the dimensions and measures in the
cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


vi Module 13: Using Excel as an OLAP Client

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. Can you export an Office PivotList back to an Excel PivotTable report?
Yes. To do so, click the Export To Excel toolbar button. Interestingly, if
you show only selected levels in a PivotTable list and then export that
list to Excel, the resulting PivotTable report will include only the
selected levels.
2. Can you update the subtotal labels in a PivotTable so that they match the
total of only the visible cells?
Unfortunately, you cannot make the subtotals match the total of only
visible cells. However, you can turn off subtotals for dimensions.
3. What happens if the PivotTable toolbar becomes small and does not include
all the dimensions and measures?
Click the PivotTable in the worksheet. The toolbar should return to its
original state.
4. How do you retrieve the PivotTable toolbar if you accidentally close it?
Right-click the Excel toolbar, and click PivotTable from the list of
possible toolbars.
5. Does an Office PivotList support events?
If you write Microsoft Visual Basic® code and are familiar with creating
event handlers to react to the behavior of users, you might be interested
to know that an Office PivotList supports events for numerous user
actions. In contrast, an Excel PivotTable report does not have any
events.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 13: Using Excel as an OLAP Client vii

Module Strategy
Use the following strategy to present this module:
! Office 2000 OLAP Components
Begin by defining the Office 2000 OLAP components—PivotTable
Services, Excel 2000 PivotTables, Office Pivot Web control, and local
cubes—and describe how each component is used to access OLAP data.
! Using Excel PivotTables
In this section, you show how to create, manipulate, and format a
PivotTable based on an OLAP cube. Integrate your lecture with a
demonstration. First, show how to define the data source. Next, show how
to use the PivotTable toolbar and how to drill down and pivot in a
PivotTable. Describe how to use various methods that enhance PivotTable
reports, such as filtering and refreshing. Finish the section by describing
various formatting options for PivotTables.
! Using PivotCharts
Explain that Excel 2000 creates PivotChart® reports that are fully interactive
and integrated with PivotTable reports. Emphasize that a PivotChart is
always linked to a PivotTable. Describe the two methods of creating a
PivotChart and integrate your lecture with a demonstration showing students
how to create a PivotChart from an existing PivotTable report. Finish by
describing some unique characteristics of PivotCharts.
! Working with Local Cubes
Define local cubes as structurally complete OLAP cubes that reside on
client computers. Compare and contrast local cubes and server-based cubes.
Explain that you can create a local cube from either an OLAP source or a
relational source. Combine your lecture with a demonstration showing how
to create a local cube from an OLAP source.
! Creating OLAP Enabled-Web Pages
Explain to students that Office 2000 makes it easy to create Web pages from
Office documents. Describe and show how to create a Web page from a
PivotTable report, combining the lecture and demonstration. Next, describe
how to manipulate a PivotList—using the Field List, adding and removing
items, and filtering and pivoting.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 13: Using Excel as an OLAP Client 1

Overview
Topic Objective
To provide an overview of
the module topics and
objectives. ! Office 2000 OLAP Components
Lead-in ! Using Excel PivotTables
In this module, you will learn
about the OLAP ! Using PivotCharts
components available in
Office 2000. ! Working with Local Cubes
! Creating OLAP-Enabled Web Pages

Microsoft® PivotTable® Service (PTS) is bundled with Microsoft Office 2000.


PTS works not only with Microsoft SQL Server™ 2000 Analysis Services, but
also with other data sources, such as relational databases.
Microsoft Excel 2000, a major component of Office 2000, provides powerful
online analytical processing (OLAP) functionality to developers and users.
This module is an overview of Excel 2000 OLAP features. It gives you the
opportunity to create and manipulate the various Office 2000 OLAP interfaces.
After completing this module, you will be able to:
! Understand the various Office 2000 OLAP features.
! Create a PivotTable from an OLAP cube.
! Create PivotCharts.
! Create local cube files.
! Create a Web page containing Pivot Web components.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


2 Module 13: Using Excel as an OLAP Client

Office 2000 OLAP Components


Topic Objective
To introduce the various
Office 2000 OLAP
components. ! PivotTable Service
Lead-in ! Excel 2000 PivotTables
These are the Office 2000
OLAP components that are ! Office Pivot Web Control
discussed in this module.
! Local Cubes

Excel 2000 PivotTables are the focus of this module. Other important OLAP
Delivery Tips features exist, however, in Office 2000. This module reviews the various OLAP
Briefly describe each of the
components and define how
components of Office 2000.
they are used to access
OLAP data. PivotTable Service
PivotTable Service (PTS) is the mandatory client component for querying
Except for PTS, do not go
into detail, because each
Analysis Server.
component is covered later While PTS is a component of Analysis Services, it is also bundled with Office
in the module.
2000. PTS places OLAP functionality on every Office 2000 desktop, regardless
of whether users have access to an Analysis Server.
PTS has no built-in user interface. It is an invisible component that provides
OLAP functionality to Excel 2000, third-party applications, and custom
applications. PTS provides the OLE DB for OLAP and Microsoft ActiveX®
Data Objects (Multidimensional) (ADO MD) object interface.
Because PTS communicates with relational databases, PTS provides OLAP
functionality for organizations that do not use Analysis Server.

Tip You do not need to install PTS on every client computer. To provide
OLAP capability in a thin-client environment that does not require much
memory usage on client computers, you can install PTS on another computer
that acts as a middle tier and provides OLAP access for the client computers.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 13: Using Excel as an OLAP Client 3

Excel 2000 PivotTables


In Excel 2000, PivotTables are Analysis Server-aware and, more precisely,
OLE DB for OLAP-aware. As a result, you use PivotTables to analyze large
data sets, unlike earlier versions of Excel.

Note An Excel PivotTable is not the same object as PivotTable Service (PTS).
However, Excel uses PTS when manipulating PivotTables.

PivotTables provide basic OLAP functionality to Excel users. They provide an


intuitive interface that allows slice and dice functionality—pivoting, drill-down,
drill-up, and so on.
In addition, charts are now OLAP-aware and provide OLAP functionality with
direct manipulation of the chart.

In order to create PivotTables based on external data from OLAP or relational


databases, you must install Microsoft Query. Query is not installed by default as
part of the Office 2000 installation. You must specify it explicitly during setup.

Office Pivot Web Control


Several ActiveX components are bundled with Office 2000 and are designed for
use on Web pages, Microsoft Visual Basic® forms, and other ActiveX
containers.
One of the ActiveX components is the Pivot Web control. The pivot component
functions similarly to an Excel PivotTable. In this module, you will learn how
to create a Web page that includes the pivot component.

Local Cubes
PTS supports the ability to create local cubes derived from an Analysis Server
or from a relational source. This feature is available to users in two forms:
! Excel 2000 contains an interface for defining local cubes that is covered in
this module.
! Local cubes can be created programmatically.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


4 Module 13: Using Excel as an OLAP Client

# Using Excel PivotTables


Topic Objective
To introduce the concept of
PivotTables.
Lead-in ! Defining a Data Source
In this section, you learn ! Interacting with a PivotTable
how to create, manipulate,
and format a PivotTable ! Working with PivotTables
based on an Analysis
Server cube. ! Formatting PivotTables

In versions of Excel before version 2000, a PivotTable report used a memory-


Delivery Tips cache method for providing values to the report. In this method, the PivotTable
Present this entire section
as an informal
imported values from an Excel list or a database table, and stored the values in
demonstration, integrating memory. When a user manipulated the PivotTable report, the report retrieved
your lecture from the slide- necessary values from the memory cache.
driven sections with a
demonstration of building
PivotTable reports have been an extremely popular feature of Excel, but the
and manipulating a memory-cache method for retrieving values limited the amount of data that
PivotTable report from the could be manipulated.
Module 13 Sales cube.
In Office 2000, Excel provides a second method for providing values to a
Encourage students to PivotTable report—an OLAP cube. A PivotTable report can now communicate
follow you on their with the PivotTable Service to retrieve values from Analysis Server.
computers. In the following
lab, students are asked to
In this section, you learn how to create, manipulate, and format a PivotTable
build a PivotTable report by based on an Analysis Server cube.
using the wizard.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 13: Using Excel as an OLAP Client 5

Defining a Data Source


Topic Objective
To define a data source in
Excel.
Lead-in
The first time you build a
PivotTable against an OLAP
cube, there are many steps
involved, including the
definition of a data source.

Creating an Excel PivotTable report based on an OLAP cube is a


Delivery Tips straightforward process. You use the Excel PivotTable Report Wizard, which
Begin your informal
demonstration starting with
uses the Microsoft Query application to define and create an OLAP query file.
this procedure for defining The OLAP query file provides all the information necessary to connect to the
an OLAP cube and an Excel OLAP Server cube. When Microsoft Query returns control to the Excel
data source. PivotTable Report Wizard, the wizard uses the OLAP query file to connect to
the server cube.
Encourage students to
follow along with your You can connect to a regular cube, a virtual cube, or a linked cube in a
informal demonstration on PivotTable. Before you can connect to a cube—whether regular, virtual, or
their computers. linked—the cube must be processed and available for client queries. In addition,
you must be given security access to the cubes on the Analysis Server before
In the lab that follows, you can connect to them.
students will create
PivotTable reports on their After you create the PivotTable report, neither Microsoft Query nor the OLAP
own. query file is used again unless you want to create a new PivotTable report.
The first time you build a PivotTable against an OLAP cube, there are many
steps involved. A number of these steps relate to defining a data source.
Defining the source is a one-time process per cube per client computer.
Key Point
You can connect to a
regular cube or to a virtual
cube in a PivotTable. Before
you can connect to a cube,
either regular or virtual, the
cube must be processed
and available for client
queries. In addition, you
must be given security
access to the cubes on the
Analysis Server before you
can connect to them.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


6 Module 13: Using Excel as an OLAP Client

Interacting with a PivotTable


Topic Objective
To describe the mechanics
of interacting with a
PivotTable.
Lead-in
A PivotTable report consists
of four areas. The first three
areas—the page area, the
column area, and the row
area—contain member
names, and are called axes.
The fourth area, the data
area, contains the values of
the measures.

An Excel PivotTable report is similar in some ways to the cube browser


Delivery Tips included with the Analysis Manager, but it allows more control over the
Continue with the informal
demonstration showing
appearance of the resulting values.
various selection, pivot, and A PivotTable report consists of four areas. The first three areas—the Page
drill down operations.
Fields area, the Column Fields area, and the Row Fields area—contain member
Encourage students to
names, and are called axes. The fourth area, the Data Items area, contains the
follow along with your values of the measures.
informal demonstration,
including trying out toolbar The PivotTable Toolbar
options on their own.
The PivotTable toolbar contains one button for each measure, plus one button
In the lab that follows, for each non-measure dimension. Following are the button identifications:
students will create
! A single row of buttons in the toolbar contains either measures or
PivotTable reports on their
own.
dimensions, but not both.
! An icon at the left of the row of buttons indicates whether the buttons in the
row are measures or dimensions.
! You can drag measure buttons—and only measures—to the data area.
! You can drag buttons for other dimensions—but not measures—to any of
the axes—page, column, or row.
If a dimension or measure has a long name, the toolbar button does not show
the entire name. If you hover the mouse over a button, Excel displays a screen
tip showing the full name and an additional indicator of whether the button is a
dimension or a measure.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 13: Using Excel as an OLAP Client 7

The following are things you can do from the toolbar to arrange the layout of
the PivotTable:
! Drag one or more dimensions from the PivotTable toolbar to the Row Fields
area.
! Drag one or more dimensions to the Column Fields area.
! Drag one or more dimensions to the Page Fields area.
! Drag at least one measure to the Data Items area—a PivotTable must have
at least one data item.
You can place more than one dimension in the page, row, and column regions.
You can pivot page, row, and column data to the other axes by dragging the
dimension tiles.

Drilling Down in Dimensions


Much of the benefit of working with an OLAP cube is the ability to drill down
to detailed members, and to drill back up to see higher-level members. An
Excel PivotTable report allows you to navigate members in this manner, either
one at a time, or all the members of a level together.
To drill-down a dimension hierarchy, double-click the member. The children of
the member are displayed unless the member is already at the bottom level.
You can also drill down on a member by selecting the member label and
clicking Show Detail on the PivotTable toolbar. Click Hide Detail to drill up.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


8 Module 13: Using Excel as an OLAP Client

Working with PivotTables


Topic Objective
To introduce various
methods to enhance
PivotTable reports. ! Filtering
Lead-in ! Highlighting a Structured Selection
The following are additional
capabilities that enhance the ! Displaying Specific Members
ability to manage the data
and organization of a ! Refreshing a PivotTable
PivotTable report.

The following are additional capabilities that enhance the ability to manage the
data and organization of a PivotTable report.

Delivery Tips Filtering


Continue with the informal You use page fields—slicer dimensions, in OLAP terminology—to filter the
demonstration showing data in a PivotTable. Click the dropdown arrow next to the member name, and
various features from this
select a member from the outline to act as the filter.
section.
When you select a member in a page field, the entire PivotTable report retrieves
Encourage students to data for that one member of the dimension. If you want to include multiple
follow along with your
members from a dimension, move the dimension from the page field to a
informal demonstration on
their computers.
column or a row field.

In the lab that follows, Highlighting a Structured Selection


students will create
Structured selection is a feature that simplifies viewing complex PivotTables.
PivotTable reports on their
own.
When you click a member, data pertaining to that member is highlighted, even
when the cells are not contiguous.
To select cells in this manner, point just to the left of a row member, or just
above a column member, until the mouse pointer becomes a small black arrow,
and then click the member.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 13: Using Excel as an OLAP Client 9

Displaying Specific Members


When a dimension is oriented as a row or a column, by default all the members
of the displayed level are shown. However, there may be occasions when you
want to show only certain members.
Use the drop-down arrows next to the dimension names. Clicking a drop-down
arrow causes an outline to be displayed. Select the check boxes for members
you want to display, and clear the check boxes for the members you want to
hide. Two small check marks will cause a drill-down—that is, the children of
the member to be displayed.

Refreshing a PivotTable
If the data in a cube changes, right-click any cell in the table and click Refresh
Data. Analysis Server is re-queried and the data is refreshed.
A pivot operation will also re-query the Analysis Server. There is no option to
turn off a data refresh on pivot operations.
A user might create a PivotTable, save it, and open it several weeks later but
forget to refresh the report. In this case, the user can unwittingly view old data.
To avoid this problem, you can automate the refresh process. Right-click any
cell in the PivotTable and then click Table Options. This displays the
PivotTable Options dialog box. Select the Refresh on Open check box. The
PivotTable then automatically refreshes when the workbook opens.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


10 Module 13: Using Excel as an OLAP Client

Formatting PivotTables
Topic Objective
To describe various
formatting options for
PivotTables.
Lead-in
A PivotTable report has
many formatting options.
You will learn about some of
the most useful ones.

You use the PivotTable Options dialog box to implement various formatting
Delivery Tips options. You can access this dialog box by right-clicking any cell in the
Continue with the informal
demonstration showing
PivotTable and then clicking Table Options.
various features from this There are other ways to apply formatting to PivotTables and PivotTable cells:
section.
! Applying AutoFormats
Encourage students to
follow along with your The easiest way to format a PivotTable is by using an AutoFormat. Right-
informal demonstration on click any cell in the PivotTable, and then click Format Report. The
their computers. AutoFormat dialog box opens. You then choose from a gallery of styles.
The AutoFormat persists, even as you manipulate the PivotTable.
In the lab that follows,
students will create
! Formatting cells
PivotTable reports on their You can format specific cells in a PivotTable by right-clicking the cell and
own. clicking Format Cells.
! Formatting Measures
Another method for formatting a measure is to right-click any single cell in
the given measure and click Field Settings. Next, click the Number button
to display Excel’s standard numerical formatting dialog.
The advantage of this technique is that the formatting is applied to the entire
measure, even if the cells are not contiguous, and the formatting persists
even as the measure is pivoted.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 13: Using Excel as an OLAP Client 11

Using PivotCharts
Topic Objective
To demonstrate
PivotCharts.
Lead-in
Excel 2000 creates
PivotChart reports that are
fully interactive and
integrated with PivotTable
reports.

In Excel versions before Excel 2000, it was possible to create charts based on
Delivery Tips the data in a PivotTable. However, such charts were not entirely integrated with
Continue with the informal
demonstration showing
PivotTables—for example, the chart would not update properly to synchronize
students how to create a with changes in the PivotTable layout.
PivotChart.
Excel 2000 creates Microsoft PivotChart® reports that are fully interactive and
Encourage students to
integrated with PivotTable reports. A PivotChart is always linked to a
follow along with your PivotTable. For example:
informal demonstration on
! Changing a PivotTable report automatically updates a PivotChart.
their computers.
! Manipulating buttons on a PivotChart changes the layout of the PivotTable
In the lab that follows, report.
students will create
PivotCharts on their own. Because of this linkage, there is no way, for example, to create a chart that
shows dates as the X-axis labels if that chart is based on a PivotTable that
shows dates as column headings. Moving the dates to the X-axis of the chart
will move dates to the row axis of the PivotTable report.
If you want the layout of a PivotTable report to be independent of a PivotChart
report, you must copy the PivotTable report before creating the PivotChart.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


12 Module 13: Using Excel as an OLAP Client

Creating a PivotChart
There are two methods for creating a PivotChart:
! When creating a new PivotTable, at the first step of the PivotTable wizard,
click the PivotChart option.
! After you create a PivotTable, right-click any cell in the table, and then click
PivotChart.

To create and manipulate a PivotChart from an existing PivotTable report,


perform the following steps:
1. From an existing PivotTable report, right-click any cell, and then click
PivotChart.
A new sheet, Chart 1, is added to the workbook immediately before the
worksheet containing the PivotTable.
2. Manipulate the dimensions and measures by using the same PivotTable
toolbar you worked with earlier.
Any changes that you make to the PivotChart update the original
PivotTable.
3. Switch back to the PivotTable worksheet to see the changes made by the
PivotChart manipulations.

Charting Characteristics
PivotCharts are similar to normal Excel charts in many respects, but they have
special characteristics:
! Dragging the dimension buttons can manipulate the chart and underlying
table. These buttons provide functionality similar to the PivotTable
counterparts.
! When the layout of the PivotTable is changed, the chart responds to the
change, and vice versa.

Note Changing the chart type entails the same techniques as with normal Excel
charts, and is outside the scope of this course. For more information, refer to the
Microsoft Excel Help.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 13: Using Excel as an OLAP Client 13

Demonstration: Creating a PivotTable


Topic Objective
To demonstrate the creation
of a PivotTable that
connects to OLAP cubes.
Lead-in
In this demonstration, you
will learn how to create a
PivotTable that connects to
OLAP cubes.

In this demonstration, you will learn how to create a PivotTable that connects to
Delivery Tips OLAP cubes.
The steps for this
demonstration are included
in the Instructor Notes.

If you performed an
extensive demonstration
throughout your lecture, and
covered all topics found in
this demonstration, you may
want to skip this
demonstration, and have
students perform lab A now.

Tell students that some of


the demonstration
procedures are repeated in
the lab. If students follow
along with your
demonstration, they can
skip the identical procedures
in the lab.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


14 Module 13: Using Excel as an OLAP Client

Lab A: Creating PivotTables and PivotCharts


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will create a
PivotTable and a PivotChart
from the Sales cube.

Objectives
Explain the lab objectives.
After completing this lab, you will be able to:
! Create a PivotTable.
! Create a PivotChart.

Estimated time to complete this lab: 15 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 13: Using Excel as an OLAP Client 15

Exercise 1
Creating a PivotTable
In this exercise, you will create and manipulate a PivotTable by using the
Module 13 database.

! 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\L13\Module
13.CAB, click Open, click Restore, and then click Close.
2. Double-click Module 13 to expand the database.
3. Below Module 13, double-click the Data Sources folder, right-click the
Module 13 data source, and then click Edit.
4. Click the Connection tab of the Data Link Properties dialog box, and then
verify that localhost is selected in step 1.
5. In step 2, verify that Use Windows NT Integrated security is selected.
6. In step 3, verify that Module 13 is selected.
7. Click Test Connection and verify that the test succeeded. Click OK twice.

! To define a data source


1. Open Microsoft Excel.
If Excel is already open, switch to an empty worksheet.
2. From an empty Excel worksheet, click the Data menu, and then click
PivotTable and PivotChart Report.
Step 1 of the PivotTable and PivotChart Report Wizard appears.
3. From the Where is the data you want to analyze pane, click External data
source, and then click Next.
Step 2 of the wizard appears, which contains a button to specify the external
data source.
4. Click Get Data.
Microsoft Query starts and the Choose Data Source dialog box opens.
5. Click the OLAP Cubes tab and then click <New Data Source> from the
list. Click OK.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


16 Module 13: Using Excel as an OLAP Client

! To define the cube


1. In the Create New Data Source dialog box, type Market Sales for the data
source in entry 1.
2. For entry 2, click Microsoft OLE DB Provider for OLAP Services 8.0
from the list, and then click Connect.
The Multidimensional Connection dialog box appears.
3. Click the Analysis Server option, and type localhost in the Server box.
Click Next.
A list of databases defined on the Analysis Server displays.
4. From the database list, click the Module 13 database, and then click Finish.
The Create New Data Source dialog appears again.
5. From the list, click the Sales cube from the list. Click OK to close the
dialog.
6. The Choose Data Source dialog appears again. Click OK.
7. Step 2 of the PivotTable Wizard appears again. Click Next and then click
Finish.
A skeletal PivotTable report appears on the worksheet, along with a
PivotTable toolbar that displays all the dimensions and measures in the
cube.

! To define the PivotTable dimensions.


1. On the PivotTable toolbar, hover the mouse pointer over the button labeled
Sales U…
The screen tip gives the full name of the measure, Sales Units, and informs
you that you can drag the button to the PivotTable data area. This message
confirms that the button is a measure.
2. Drag the Sales Units button from the PivotTable toolbar onto the data area,
which is labeled Drop Data Items Here.
The PivotTable report changes from a skeletal framework to an actual
report, showing a single cell, the total of Sales Units.
3. Hover the mouse pointer over the button labeled Product.
The screen tip repeats the name of the dimension and informs you that you
can drag the button to the PivotTable. This message confirms that the button
is a dimension. You can drag this button to any axis on the PivotTable
report.
4. Drag the Product dimension button to the row axis of the PivotTable report,
which is cell A4 on the worksheet.
The Category level members appear as row headings.
5. Drag the Time dimension button to the column axis of the PivotTable
report, which is cell B3 on the worksheet.
The Year members appear as column headings.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 13: Using Excel as an OLAP Client 17

6. Drag the State dimension button to the page axis of the PivotTable report,
which is cell A1 of the worksheet.
You can choose whether to display a dimension button on the page axis. If
you do not include a dimension on a PivotTable report, it behaves as if it
were on the page axis with the default member selected.

! To drill down to descendants


1. Double-click the Bread category member in the row axis.
The subcategories that are children of Bread appear.
2. Double-click Bread again to hide the children.
3. Click the Category level button above the Bread member.
4. On the PivotTable toolbar, click Show Detail to drill down to the children
of all members at the Category level.
5. Click the drop-down arrow next to the Category button.
The members of the Category level appear, each with a check box that
contains a double check mark. The double check mark indicates that the
member is visible, along with at least some of its children.
6. Expand Bread, and then clear the check box next to Bread.
This hides the Bread member along with all its children.
7. Select the check box to put a single check in the box, and then click OK.
All the descendants of Bread disappear. A single check mark indicates that
the member is visible but all its children are hidden.
8. Click the drop-down arrow next to the State dimension button in the page
axis.
9. Expand North America, USA, and North West, click Washington, and
then click OK.
The list for a dimension on the page axis contains a hierarchy of members,
and each member has a plus sign but not a check box. On the page axis, you
can select only a single member from a dimension. The list for a dimension
on the row or column axis also contains a hierarchy of members, but each
member has a check box. On the row or column axes, you can select
multiple members from a dimension.

! To add multiple dimension to a single axis


1. Drag the Year level button from the column axis to the left edge before the
row axis, to the left of column A.
The row axis now has three columns of labels—one for the Year level of
the Time dimension, one for the Category level of the Product dimension,
and one for the Subcategory level of the Product dimension. The drop-
down arrow that appears only on the top level of each dimension is the only
visible indicator of which label starts a new dimension.
2. Drag the Employee dimension button from the toolbar to the row axis, to
the left of the Year level.

Tip Be sure that you drag the Employee dimension and not the Employee
Count measure.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


18 Module 13: Using Excel as an OLAP Client

Multiple dimensions—and multiple levels for a single dimension—can exist


on a single axis.
3. Drag the Sales Dollars measure button from the toolbar to the data area.
As soon as you add a second measure to the PivotTable report, the measures
act as if they form a new Data dimension. The default location for the Data
dimension is the row axis, but you can move the dimension to the column
axis.
4. Drag the Data dimension button to the column axis.
You cannot drag the Data dimension to the page axis; it can go on either the
column axis or the row axis. To remove a measure from the Data
dimension, follow the same procedure that you use to hide a member from
an ordinary dimension.
5. Click the drop-down arrow next to the Data dimension button.
6. Clear the check box next to the Sales Dollars measure, and then click OK.
Hiding a measure from the Data dimension simply deletes the measure from
the report. If only one measure remains on the report, the Data dimension
goes away.

! To format a PivotTable report


1. In the PivotTable, right-click any cell, and then click Table Options.
2. Select the Merge Labels check box.
3. Look over some of the other formatting options available in the PivotTable,
and then click OK.
Each member’s label is now centered in a single, merged cell next to its
children.
4. On the toolbar, click Undo to change the labels back to the unmerged form.
You might want to show the Category and Subcategory labels for the
Product dimension in a single column, with the Subcategory indented.
You cannot do that directly in a PivotTable report, but you can get the same
effect by applying various formats.
5. Double-click the Category level button.
6. In the PivotTable Field dialog box, click Layout.
7. In the PivotTable Field Layout dialog box, click Show Items In Outline
Form. Leave all the check boxes clear, and then click OK
8. Click OK to close the PivotTable Field dialog box.
Each Category label now has a blank cell to its right in the Subcategory
column. You can now adjust the width of the Category column to make the
row columns appear as one.
9. With the Category level button selected, click the Format menu, point to
Column, and then click Width.
10. Type 1.5 and then click OK.
The Category and Subcategory labels now appear to be part of a single,
indented list.
11. Leave the PivotTable open for the following exercise.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 13: Using Excel as an OLAP Client 19

Exercise 2
Creating a PivotChart
In this exercise, you will create and manipulate a PivotChart starting from the
PivotTable you created in Exercise 1.

! To prepare to create a PivotChart


1. In the PivotTable report, drag the Year level button up to the page axis.
2. Drag the State button to the column axis.
3. Drag the CEO button off the PivotTable.
4. Click the Category level button, and then on the toolbar, click Hide Detail.

! To create a PivotChart
1. Right-click any cell in the PivotTable, and then click PivotChart.
A new worksheet appears, containing a chart with product category labels
across the bottom, countries listed in the legend, and a Time button above
the chart. These are interactive PivotChart controls.
2. Click the drop-down arrow adjacent to the Time button.
3. Expand the tree, click Quarter 1 under 2001, and then click OK.
You use the PivotChart buttons just as you use the PivotTable report
buttons.
4. Click the Category button, and then on the PivotTable toolbar, click Show
Detail.
The chart changes to show columns for only the subcategories. The
PivotChart is intelligent enough not to show totals from the report; it
displays the Category labels under the appropriate Subcategory labels.
5. Click Country, and then click Show Detail.
6. Click Region, and then click Show Detail again.
Once again, the PivotChart shows the appropriate detail, by using the parent
levels of the hierarchy only as part of the labels.
7. On the PivotTable toolbar, click the PivotChart menu, and click Hide
PivotChart Field Buttons.
This removes the buttons, making the chart suitable for printing or for
displaying in a meeting.
8. Switch back to the PivotTable, and notice the changes made to the report
layout.
When you manipulate PivotCharts, the source PivotTables reflect the
changes.
9. Leave the workbook open to create local cubes in the next lab.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


20 Module 13: Using Excel as an OLAP Client

# Working with Local Cubes


Topic Objective
To introduce the concept of
local cubes.
Lead-in ! Defining Local Cubes
Structurally complete OLAP ! Creating Local Cubes
cubes that reside on client
computers are called local
cubes.

Office 2000 includes all the necessary components to create and use cubes
offline—that is, a structurally complete OLAP cube that resides on client
computers. Such offline cubes are called local cubes.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 13: Using Excel as an OLAP Client 21

Defining Local Cubes


Topic Objective
To define local cubes.
Lead-in
A local cube functions in
! Are Similar to Server-Based Cubes, but Contain Less
much the same way as a Data
server-based cube.
! Can Communicate with Any PTS-Based Client
Application
! Can Be Created Two Ways
$ Excel PivotTable Report
$ Microsoft Query

A local cube functions in much the same way as a server-based cube. It contains
dimensions complete with hierarchies, and it contains measures. You typically
store much less data in a local cube than in a server-based cube, and a local
cube does not include many of the capabilities of a server-based cube. For
example, a local cube does not include aggregations, member properties, shared
dimensions, virtual dimensions, virtual cubes, partitions, or write-back tables.
Any client application that can interact with a server-based cube can also
interact with a local cube, because the client application communicates with
PTS, and PTS can communicate either with the Analysis Server or with a local
cube. PTS is also the component that creates local cubes.
Office 2000 includes two different approaches for creating a local cube. With
either approach, PTS creates the local cube, but the steps to create the local
cube are different in each case.
One option for creating local cubes is to connect to an Analysis Server by using
an Excel PivotTable report, and then use the PivotTable report to create a local
cube that is a subset of the server-based cube. The other option is to use
Microsoft Query to define a local cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


22 Module 13: Using Excel as an OLAP Client

Creating Local Cubes


Topic Objective
To explain the two types of
data sources that are used
to create local cubes. ! Creating a Local Cube from an OLAP Source
Lead-in ! Creating a Local Cube from a Relational Source
You can create local cubes
either from an OLAP source
or from a relational
database source.

You can create a local cube from either an OLAP source or a relational
Delivery Tips database source.
Continue with the informal
demonstration showing
students how to create a Creating a Local Cube from an OLAP Source
local cube from a By using Excel 2000, you can create a local cube that uses an OLAP cube as its
PivotTable.
source. To create a local cube from an OLAP source, perform the following
Encourage students to
steps:
follow along with your 1. Create a PivotTable based off an OLAP cube.
informal demonstration on
their computers. 2. From the PivotTable toolbar, click the PivotTable menu, and then click
Client-Server Settings.
The PivotTable toolbar is the only place in Excel 2000 where the Client-
Server Settings command is located.
3. Click Create local data file.
4. Step through the Create Cube File Wizard, and specify the dimensions,
levels, and top-level members included in the local cube.
5. Name and save the local cube file.

Note You can also create a local cube from an OLAP source
programmatically.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 13: Using Excel as an OLAP Client 23

Creating a Local Cube from a Relational Source


Even if you do not have an Analysis Server available to you, you can create and
use a local cube by creating it directly from a relational data source.
The PivotTable Service, which is included with Office 2000, can create and
access a local cube. To create a local cube directly from a relational data source,
you use the Microsoft Query application. Microsoft Query includes a wizard for
turning a relational data set into a cube.
When you create a local cube, you first create a relational rowset by using
standard SQL. In that rowset, you can join dimension tables with the fact table,
and can create calculated columns.
Once you define the relational rowset, you then use the Create Cube File
Wizard to design dimensions, hierarchies, and measures for the cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


24 Module 13: Using Excel as an OLAP Client

Creating OLAP-Enabled Web Pages


Topic Objective
To describe the creation of
OLAP-enabled Web pages
in Excel 2000. ! Saving PivotTables as Web Pages
Lead-in ! Manipulating the OLAP Control
Office 2000 makes it easy to
create Web pages from ! Displaying the Field List
Office documents.
! Adding and Removing Items
! Filtering and Pivoting

Office 2000 makes it easy to create Web pages from Office documents. Excel
Delivery Tips 2000 facilitates the creation of OLAP Web pages that use the Office Pivot
Continue with the informal
demonstration, showing
component.
students how to create a The PivotTable converts to an ActiveX Web component. This page is viewable
Web page from a
by any user, though a license for Office 2000 is required even if Office 2000 is
PivotTable.
not installed on the computer.
Encourage students to
follow along with your Saving PivotTables as Web Pages
informal demonstration on
You create Web pages from existing PivotTable reports that access an Analysis
their computers.
Server cube or a local cube as the data source.
To create a Web page from an existing PivotTable report, perform the following
steps:
1. From the File menu in your PivotTable worksheet, click Save as Web
Page.
2. In the Save pane, click Selection:Sheet, and then select the Add
interactivity check box.
3. Click Publish, click PivotTable in the Item to publish list, select the Add
interactivity with check box, and then click PivotTable functionality in
the Viewing options pane.
4. Define the Web page name and file location in the File name box.
5. Select the Open published web page in browser check box, and then click
Publish.

The default browser opens and includes the Pivot Web component. From
here, you manipulate the Pivot Web component and interact with
dimensions, levels, and measures.
Microsoft calls the Pivot Web component a PivotList. PivotLists are similar in
many respects to Excel PivotTables.
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
Module 13: Using Excel as an OLAP Client 25

Manipulating the OLAP Control


In an Excel PivotTable report, you interact frequently with dimensions and
members, but not with levels. Levels of a dimension appear and disappear as
you show or hide detail for members on the report. You must display levels in
order from top to bottom—you cannot skip a level—and the button for the top
level is the only one that ever displays a drop-down list.
In an Office PivotList, you interact much more directly with levels in a
dimension. In addition to how PivotLists approach levels, there are several
differences between a PivotList and a PivotTable. The main difference is the
use of the field list in a PivotList.

Displaying the Field List


Adding a dimension to the PivotList requires that the Field List be displayed.
You do this by clicking the Field List toolbar button.
Using the Field List is similar to using the PivotTable toolbar. The Field List
gives you the ability to add dimensions, levels, and members to areas in the
PivotList.

Adding and Removing Items


To add or remove items, you drag a dimension, level or total (measure) from
the Field List to the PivotList.
Like an Excel PivotTable, a PivotList has four distinct regions: Filter region,
row region, column region, and data region.
To remove an item, drag its button outside the PivotList, until a red X displays,
and then drop the item.

Filtering and Pivoting


Filtering in PivotLists is identical to filtering in PivotTables. You click the
drop-down arrow, and then select a member from the outline.
Pivoting in PivotLists is also identical to pivoting in Excel. You drag the
dimension buttons to different regions of the PivotList.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


26 Module 13: Using Excel as an OLAP Client

Lab B: Working with Local Cubes and Web Pages


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will create a
local cube and a Web page
from a PivotTable.

Explain the lab objectives.


Objectives
After completing this lab, you will be able to:
! Create a local cube.
! Create a Web page from a PivotTable.

Prerequisites
! To complete this lab, you must first complete lab A, Creating PivotTables
and PivotCharts, found earlier in the module.

Estimated time to complete this lab: 15 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 13: Using Excel as an OLAP Client 27

Exercise 1
Creating a Local Cube
In this exercise, you will create and manipulate a local cube by using the
Module 13 database.

! To create a local cube from an OLAP source


1. Switch to the PivotTable you created in lab A, Creating PivotTables and
PivotCharts.
2. From the PivotTable toolbar, click the PivotTable menu and then click
Client-Server Settings.
The Client-Server Settings dialog box appears.
3. Click Create local data file.
This starts the Create Cube File Wizard.
4. In the introduction page, click Next.
5. At step 2 of the wizard, select the Employee dimension checkbox.
Here you specify the dimensions and the levels that you want to include in
the local cube. You do this by selecting the checkboxes of the dimensions
and levels.
6. Click Next.

Note The list of dimensions includes all dimensions in the source cube,
regardless of whether all the dimensions exist in the PivotTable.

7. At step 3 of the wizard, select the CEO check box, and then expand each of
the levels to determine the members that are included in the local cube.
Here you specify which members from the top level of each dimension will
be included in the cube. You do this by selecting the members in the top
levels you previously selected.
8. Click Next.
9. At step 4 of the wizard, save the Sales.cub cube file in
C:\Moc\2074A\Labfiles\L13, and then click Finish.
10. Click OK, and realize that your PivotTable connects to the Sales.cub local
cube file that you created.
11. Open Microsoft Windows® Explorer, and find the Sales.cub cube file in
C:\Moc\2074A\Labfiles\L13.
The file contains all data and structures necessary to connect to the local
cube.
12. Close Windows Explorer, and leave the Excel workbook open for the
following exercise.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


28 Module 13: Using Excel as an OLAP Client

Exercise 2
Creating a Web Page from a PivotTable
In this exercise, you will create a Web page from a PivotTable by using the
Module 13 database.

! To create a Web page from a PivotTable report


1. From the open PivotTable report, click the File menu and then click Save as
Web Page.
2. In the Save In list, navigate to C:\Moc\2074A\Labfiles\L13.
3. In the middle of the dialog box, click Selection: Sheet, and then select the
Add Interactivity checkbox.
4. Click Publish.
The Publish as Web Page dialog box appears.
5. Below the Item to Publish pane, click PivotTable in the Choose list.
6. In the Add interactivity with list, click PivotTable functionality.
7. Select the Open published web page in browser checkbox.
8. Click Publish.
Microsoft Internet Explorer opens, and the PivotTable Web control appears.
It connects to the local cube that you created in the previous exercise.

! To manipulate the PivotList


1. In Internet Explorer, on the PivotList toolbar, click Field List.
2. Click the Employee dimension, click Filter Area in the list at the bottom of
the Field List, and then click Add to.
The Employee dimension appears in the page axis, or in other words the
filter area.
3. Drag the Time dimension from the page axis to the column axis.
You manipulate the dimensions, levels, and members in the PivotList by
using the Field List or by dragging the appropriate tiles to the axes.
4. Create various report layouts by using the Field List and by dragging
dimensions and levels.
5. Close Internet Explorer, and then close Excel.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 13: Using Excel as an OLAP Client 29

Review
Topic Objective
To reinforce module
objectives by reviewing key
points. ! Office 2000 OLAP Components
Lead-in ! Using Excel PivotTables
The review questions cover
some of the key concepts ! Using PivotCharts
taught in the module.
! Working with Local Cubes
! Creating OLAP-Enabled Web Pages

1. When you define an OLAP data source for a PivotTable, is the definition
located on the Analysis Server or the client computer?
The definition is located on the client computer.

2. Can a PivotTable use a virtual cube as its source?


Yes.

3. Is Analysis Server required to create a PivotTable?


No.

4. Can you derive local cubes from relational data sources?


Yes.

5. To browse a Web page that includes a PivotList, must the user have Office
2000 installed?
No. However, the user must have a valid Office 2000 license.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 14: Using
Actions, Drillthrough,
and Writeback
Contents

Overview 1
Creating Actions 2
Performing Drillthrough 16
Understanding Writeback 22
Review 27
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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 14: Using Actions, Drillthrough, and Writeback iii

Instructor Notes
Presentation: This module introduces three analysis features of Microsoft® SQL Server™
60 Minutes 2000 Analysis Services—actions, drillthrough, and writeback. All three of the
features add layers of analysis to online analytical processing (OLAP)
Lab: applications.
00 Minutes
In this module, students create an action that opens a Web page. Students learn
how to enable drillthrough to explore the underlying detailed data of a cell. In
addition, students learn the importance of writeback and how to implement
cube writeback.
After completing this module, students will be able to:
! Create and view actions.
! Implement and test drillthrough.
! Understand the applications for cube writeback.

Materials and Preparation


This section lists the required materials and preparation tasks that you will need
to teach this module.

Required Materials
To teach this module, you need the following materials:
! Microsoft PowerPoint® file 2074A_14.ppt

Preparation Tasks
To prepare for this module, you should:
! Read all the student materials.
! Read the instructor notes and margin notes.
! Complete all the demonstrations.
! Practice the lecture presentation and demonstration.
! 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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


iv Module 14: Using Actions, Drillthrough, and Writeback

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. Are actions, drillthrough, and writeback supported in Microsoft Excel 2000?
You have no built-in support for these features. To implement these
features in Excel 2000 you must write custom Microsoft Visual Basic®
for Applications code.
2. Is it possible for a custom application to support actions, drillthrough, and
writeback?
Yes. These features are exposed in the client object model.
3. Why would an action target a dimension object or level object instead of the
members of the dimension or level?
An action that targets a dimension object or a level object can be used
to display cube metadata. For example, you can display the date and
time of the most recent dimension process.
4. When you create a Data Set type action, why are you unable to test the
action in the Cube Browser?
The Cube Browser in Analysis Manager does not support Data Set
actions.
5. How do you implement what-if analysis in Analysis Services?
You can implement what-if analysis in Analysis Services by using cube
writeback to store temporary cube values in memory. This allows a
user, given a what-if-enabled application, to change cell values. The
changes are temporary—the cube values do not persist in the cube and
other users do not see the values until they are stored permanently in
the cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 14: Using Actions, Drillthrough, and Writeback v

Module Strategy
Use the following strategy to present this module:
! Creating Actions
Teach students that an information system ultimately has no value unless the
information causes decisions to be made, or is otherwise acted on. The
action feature permits different types of actions to be designed into a cube,
and subsequently executed by users. Demonstrate how to create and test
actions.
! Performing Drillthrough
Teach students that the purpose of drillthrough is to provide users with an
added level of detailed data coming from the data warehouse. Show how to
implement and test drillthrough.
! Understanding Writeback
Teach students that when writeback is enabled for a given cube, cube cells
can be written to from a client application. Demonstrate that this is a key
feature for financial planning applications, such as budgeting and
forecasting. Teach the applications for cube writeback and implement cube
writeback.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 14: Using Actions, Drillthrough, and Writeback 1

Overview
Topic Objective
To provide an overview of
the module topics and
objectives. ! Creating Actions
Lead-in ! Performing Drillthrough
In this module, you will learn
about three features in ! Understanding Writeback
Microsoft SQL Server 2000
Analysis Services—actions,
drillthrough, and writeback.

This module introduces three analysis features of Microsoft® SQL Server™


2000 Analysis Services—actions, drillthrough, and writeback. All three of the
features add layers of analysis to online analytical processing (OLAP)
applications.
In this module, you will learn how to create an action that opens a Web page.
You will learn how to enable drillthrough to explore the underlying detailed
data of a cell. In addition, you will learn the importance of writeback and how
to implement cube writeback.
After completing this module, you will be able to:
! Create and view actions.
! Implement and test drillthrough.
! Understand the applications for cube writeback.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


2 Module 14: Using Actions, Drillthrough, and Writeback

# Creating Actions
Topic Objective
To introduce the concept of
actions.
Lead-in ! Defining Actions
By building actions into a ! Selecting the Action Target
cube, users can act on the
information they are ! Choosing the Action Type
viewing.
! Defining the Action Syntax
! Creating Actions in Virtual Cubes

The purpose of an OLAP application is to provide users with valuable


information to drive business decisions. Actions provide a means by which
users make decisions and implement solutions based on the information that
they find in cubes.
In this section, you will learn about actions and how to create them in Analysis
Services. You will learn about the following topics:
! Defining actions.
! Selecting the action target.
! Choosing the action type.
! Defining the action syntax.
! Creating actions in virtual cubes.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 14: Using Actions, Drillthrough, and Writeback 3

Defining Actions
Topic Objective
! Describing Actions
To define actions and show
when and how to create $ Are user-initiated operations related to cube objects
actions.
$ Pass cube objects as parameters to client or external applications
Lead-in
An action is a user-initiated $ Are defined on the Analysis Server
operation related to an $ Must be supported by client application
object in a cube.
! Examining Action Examples
$ View customer Web sites
$ Purchase a stock
$ Generate a related report
! Creating a New Action
$ Use the Action Wizard within Analysis Manager

Actions can be designed into a cube and executed by users. By using actions,
users can act on the information that they are viewing.

Describing Actions
The following are characteristics of actions:
! An action is a user-initiated operation related to an object in a cube.
! A selected object, such as a member or a cell, serves as a parameter used by
an action to initiate a specific operation defined in the action definition.
! Actions are defined on the Analysis Server, but are executed on the client
computer. An action can be acted on by a client application or an external
application, such as a Web browser.
! In order for a user to use actions, the client application, whether a third-
party OLAP client or a custom application, must support actions.

Examining Action Examples


Common examples of actions include the following:
! Suppose you browse cube data for a certain customer. You want to visit the
customer’s Web site. You click the customer, and then click a command
that automatically starts your Web browser and navigates to the customer’s
Web site.
! Suppose you browse a cube containing stock market data. You see a stock
you want to buy. You click the stock, and then click a command that
initiates a transaction and passes a parameter to a custom application that
processes the order.
! Suppose you browse a cube containing sales analysis data. You click a cell,
and then click an action that causes a custom application to generate a report
based on the data in the cell.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


4 Module 14: Using Actions, Drillthrough, and Writeback

Creating a New Action


You define an action inside a cube by using the Action Wizard.
To create a new action, perform the following steps:
1. Open the Cube Editor for the cube in which you want to create an action.
2. Right-click the Actions folder, and then click New Action.
The Action Wizard appears. You define the action here.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 14: Using Actions, Drillthrough, and Writeback 5

Demonstration: Viewing Actions


Topic Objective
To demonstrate how users
view actions.
Lead-in
In this demonstration, you
will view an action from a
user perspective by
browsing the FoodMart
2000 HR cube.

In this demonstration, you will view an action from a user perspective by


Delivery Tips browsing the FoodMart 2000 HR cube.
Encourage students to
follow along with your
demonstration. ! To execute an action
1. In Analysis Manager, expand the FoodMart 2000 database, and then
Explain that the HR cube expand the Cubes folder.
action relates to members of
the Employees dimension. 2. Right-click the HR cube, and then click Browse Data.
3. Drag the Employees dimension to a row, replacing the Department
Explain that no client-side
programming is involved,
dimension.
other than generic support 4. Right-click Sheri Nowmer, and then click Show Sheri Nowmer Employee
for actions built into the Card.
Cube Browser. The Cube
Browser opens the Web Information about Sheri Nowmer displays in your Web browser.
browser, and this operation
is driven entirely by the
action defined on the server.

Explain that, when you


define an action correctly,
the action is context-
sensitive. The action you
are demonstrating applies to
any employee in the HR
cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


6 Module 14: Using Actions, Drillthrough, and Writeback

! To execute other actions


1. Return to the Cube Browser dialog box.
2. Double-click Sheri Nowmer to display the employees who report to Sheri
Nowmer.
3. Right-click Donna Arnold, and then click Show Donna Arnold Employee
Card.
Information about Donna Arnold displays in your Web browser.
4. Return to the Cube Browser dialog box.
5. Drag the Store dimension to a row, replacing the Employees dimension.
6. Right-click USA.
7. Notice that the Show Employee Card action does not appear on the menu.
USA is not a member of the Employees dimension, and no actions exist for
the Store dimension.
8. Close the Cube Browser dialog box.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 14: Using Actions, Drillthrough, and Writeback 7

Selecting the Action Target


Topic Objective
To explain how to target
portions of the cube for the
action. ! This Cube
Lead-in ! A Dimension in this Cube
The target of an action is the
portion of the cube to which ! A Level in this Cube
the action relates.
! Cells in this Cube
! Sets in this Cube

The target of an action is the portion of the cube to which the action relates. The
Delivery Tip target is the object that launches the action. The first step of the Action Wizard
Start the Action Wizard and,
with the wizard displayed,
prompts you to specify the target. Several types of targets that you can specify
select each of these options are described below.
as you discuss them. Point
out the interface elements This Cube
for each target type.
When you click This cube as the target, the action relates to the entire cube.
When you select this option, no further inputs are required to define the target.
In the client application, the action will be available for all cube objects—every
member, every cell, every dimension, and every level.

A Dimension in This Cube


When you click A dimension in this cube, you select the cube dimension and
then specify whether the target defines all members of the dimension, or the
dimension object itself:
! If the target defines the members of the dimension, the action is available
for all members of the dimension at all levels. For example, suppose your
cube contains a Geography dimension consisting of Country, State, and
City levels. You can define an action that displays the population for the
selected Country, State, or City member.
! If the target defines the dimension object, the action is available for the
dimension itself. For instance, the action can display the number of
members belonging to the dimension, or the time at which the dimension
was last processed.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


8 Module 14: Using Actions, Drillthrough, and Writeback

A Level in this Cube


When you click A level in the cube, you select the level, and then specify
whether the target defines all members of the level, or the level object itself:
! If the target defines the members of the level, the action is available for all
members of the level.
! If the target defines the level object, the action is available for the level
object itself. For example, the action displays all members of the level, and
certain properties for those members.

Cells in this Cube


When you click Cells in this cube, the action relates to all cube cells. Unlike
the This cube choice that includes all cube objects, the dimension and level
objects are not included in the Cells in this cube target. When you select this
option, no further steps are required to define the target.
For example, a user can click a cell and can then click an action that passes the
cell value as a parameter to a cell in a spreadsheet.

Sets in this Cube


When you click Sets in this cube, the action relates to all named sets in the
cube. A named set is a set of defined members from the same dimension in a
cube. When you select this option, no further steps are required to define the
target.

Note For more information on named sets, refer to SQL Server Books Online.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 14: Using Actions, Drillthrough, and Writeback 9

Choosing the Action Type


Topic Objective
To introduce action types.
Lead-in
After you define the target,
you specify the type of
action you are defining.

After you define the target, you specify the type of action you are defining.
Delivery Tip There are several different types of actions. The Action Wizard prompts for the
With the wizard displayed, action type, and displays sample syntax.
select each of these options
as you discuss them.
Command Line
A Command Line action executes an MS-DOS® command prompt. For
example, you can use the path C:\Winnt\Notepad.exe to start the Notepad
application in Microsoft Windows NT® 4.0 or Microsoft Windows® 2000.

HTML
An HTML action executes a Hypertext Markup Language (HTML) script in
client Web browsers. For example, you can create an action that displays
member properties in client Web browsers. A pre-existing Web page is not
needed. The entire page can be defined in the action.

URL
A uniform resource locator (URL) action displays a Web page in client Web
browsers. For example, suppose your cube contains a Customer dimension.
You can define an action that displays the Web site of a customer in users’ Web
browsers.

Data Set
A Data Set action executes a multidimensional expression (MDX) statement
that returns a multidimensional cell set. The Cube Browser does not support the
Data Set action type.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


10 Module 14: Using Actions, Drillthrough, and Writeback

Rowset
A Rowset action executes an MDX or SQL statement that returns a tabular
rowset. For example, a Rowset action can execute an MDX query by using the
target object as a parameter.

Delivery Tip Statement


Point out that Statement
A Statement action executes an SQL statement through OLE-DB from the
and Proprietary actions are
created by programmers
client application.
and are outside the scope of
this course. Proprietary
A Proprietary action executes a custom, non-generic function specific to a
client application.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 14: Using Actions, Drillthrough, and Writeback 11

Defining the Action Syntax


Topic Objective
To introduce action syntax.
Lead-in
The next step in creating an
action is to define the action
syntax.

The next step in creating an action is to define the action syntax. You construct
Delivery Tip the action syntax by using MDX. You reference the selected cube object
Demonstrate a Command
Line action by entering
dynamically with the MDX syntax. In this way, the action applies to the
explorer c:\ as the action selected cube object.
syntax. When executed, the
You enter the MDX directly into the Syntax box in the Action Wizard, or you
action displays the contents
of the c: drive in Windows
click MDX Builder to display the MDX Builder dialog box.
Explorer. Action syntax must adhere to the following guidelines:
! You enclose constant text in double quotes.
! You use the MDX CurrentMember function and other cube object
functions to provide cube object context sensitivity.
! You concatenate MDX functions with constant text by using the + sign.
The above rules apply to all types of actions regardless of the action type—
URL, HTML, and so on. Beyond these basic guidelines, each type of action
uses its own syntax based on its syntax requirements.

Note The CurrentMember function is an important MDX function used in a


variety of contexts. For more information on this function, see Module 2,
"Using MDX Expressions," in course 2093A Implementing Business Logic with
MDX in Microsoft SQL Server 2000.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


12 Module 14: Using Actions, Drillthrough, and Writeback

Command Line Example


Suppose a cube has an Employee dimension. Each employee uses a disk
directory on a server with the same name as the employee name. The following
action will display Windows Explorer, displaying the directory for a selected
employee name:
“explorer ” + [Employee].[CurrentMember].Name

URL Example
Suppose a cube contains a Customer dimension. The members of the
Customer dimension are associated with a member property named
HomePage, which contains the URL for each customer’s home page. The
URLs do not include the “http://www.” prefix.
The following is a URL action that displays the home page for the current
member of the Customer dimension:
“http://www.” +
[Customer].[CurrentMember].Properties(“HomePage”)

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 14: Using Actions, Drillthrough, and Writeback 13

Demonstration: Creating an HTML Action


Topic Objective
To create an HTML action.
Lead-in
In this demonstration, you
will learn how to create an
HTML action that displays
the name of the store
manager.

This demonstration shows how to create an HTML action by using the


Delivery Tip FoodMart 2000 database. In members of the Store dimension, you will display
Encourage students to the name of Store Manager, which is a member property defined in the Store
follow along with your dimension.
demonstration on their own
computers. ! To start the Action Wizard
1. In Analysis Manager, expand the FoodMart 2000 database, expand the
Cubes folder, right-click the HR cube, and then click Edit.
2. In the Cube Editor, right-click the Actions folder, and then click New
Action.
3. Click Next at the Welcome page.
The Select target page appears.

! To select target
1. In the Target box, click A level in this cube.
2. In the Dimension box, click Store.
3. In the Levels box, click Store Name.
4. Click Members of the selected level, and then click Next.

! To select the action type


• In the Type box, click HTML, and then click Next.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


14 Module 14: Using Actions, Drillthrough, and Writeback

! To define action syntax


1. Type the following in the Syntax box:
“<HTML><P>” + Store.CurrentMember.Properties(“Store
Delivery Tips Manager”) + “</P></HTML>”
Explain that the syntax is
concatenating HTML code
with a member property. Note Do not press ENTER at the end of the line—the Syntax box wraps
the code for you.
The <HTML><P> tags at the
beginning of the code define
the syntax as HTML and
indicate the beginning of a 2. Click Next.
paragraph.
Store.CurrentMember.Prope
rties(“Store Manager”) is the Note If the MDX syntax contains a syntax error, an error message displays
MDX that returns the value as soon as you click Next. If, on the other hand, an error exists in the non-
of Store Manager for the MDX syntax (for example, an error exists in the HTML syntax) an error
requested Store dimension message does not display when you click Next. You must test the action to
member. The </P></HTML> discover non-MDX errors.
tags at the end of the code
define the end of the
paragraph and the end of ! To complete the action
the HTML syntax.
1. Name the action Display Store Manager, and then click Finish.
2. Save the cube.

Note When you define or edit an action, the cube must be saved for your
changes to take effect.

! To test the action


1. Click the Data tab to browse the data in the cube.
2. Drag the Store dimension to the row area.
3. Double-click USA, double-click CA, and then double-click San Diego.
4. Right-click Store 24 and then click Display Store Manager.
The store manager name for Store 24 displays in your Web browser.
5. Close the Web browser, and then close the Cube Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 14: Using Actions, Drillthrough, and Writeback 15

Creating Actions in Virtual Cubes


Topic Objective
To describe how to create
actions in virtual cubes.
Lead-in ! Defining New Actions
You have the ability to ! Importing Existing Actions
create actions in virtual
cubes.

You have the ability to create actions in virtual cubes. To do so, perform one of
the following steps:
! Create a new action by using the same method that you use to create an
action in a regular cube.
! Import an existing action from in a regular cube into a virtual cube.

Note For more information on virtual cubes, see Module 12, "Working with
Virtual Cubes," in course 2074A Designing and Implementing OLAP Solutions
with Microsoft SQL Server 2000.

Defining New Actions


To create a new action in a virtual cube, perform the following steps:
1. Right-click a virtual cube, and then click Edit.
2. In the Virtual Cube Editor, right-click the Actions folder, and then click
New Action.
The same Action Wizard that you use in regular cubes appears.

Importing Existing Actions


To import an action into a virtual cube, perform the following steps:
1. Right-click a virtual cube, and then click Edit.
2. In the Virtual Cube Editor, right-click the Actions folder, and then click
Import Action.
3. In the Import Actions dialog box, select the check box for the action that
you want to import, and then click OK.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


16 Module 14: Using Actions, Drillthrough, and Writeback

# Performing Drillthrough
Topic Objective
To introduce the concept of
drillthrough.
Lead-in ! Understanding Drillthrough Basics
Drillthrough is a mechanism ! Implementing Drillthrough
for providing an extra level
of detail data from the data
warehouse.

Users often require access to detailed data that is not contained in the OLAP
cube. Drillthrough is a mechanism for providing an extra level of detailed data
from the data warehouse.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 14: Using Actions, Drillthrough, and Writeback 17

Understanding Drillthrough Basics


Topic Objective
To introduce the
characteristics of
drillthrough. ! Provides a Level of Detail Behind a Cube Cell
Lead-in ! Executes an SQL Query Against the Same Data Source
Drillthrough provides an
added level of detail behind
as Fact Table
a cube cell. ! Works in All Cube Types
! Is Accessed in Supported Client Applications

Analysts use drillthrough to access more detailed information than is provided


in their OLAP cubes.
The following list contains characteristics of drillthrough:
! Drillthrough provides users with a level of detail behind a cube cell.
! Drillthrough queries the relational warehouse that is the source for the cube.
You can drill through to the fact table, or to a separate table containing data
at a greater level of detail than the fact table.
! Drillthrough can be defined for all cubes, including:
• Regular cubes
• Virtual cubes
• Linked cubes
! Drillthrough can be accessed only in supported client applications.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


18 Module 14: Using Actions, Drillthrough, and Writeback

Implementing Drillthrough
Topic Objective
To explain how to enable
drillthrough.
Lead-in ! Specifying Columns
You enable drillthrough in ! Specifying Additional Source Tables
the Cube Drillthrough
Options dialog box in the ! Adding a Filter
Cube Editor.

You enable drillthrough in the Cube Drillthrough Options dialog box in the
Cube Editor. To display the Cube Drillthrough Options dialog box, perform
Delivery Tip the following steps:
Display the Cube
Drillthrough Options 1. Open the Cube Editor.
dialog box as you discuss
the interface elements. 2. On the Tools menu, click Drillthrough Options.

Note To implement drillthrough, you must first select the Enable


drillthrough check box.

Specifying Columns
To include a column in the drillthrough result set, select the check box for that
column. Click Select all to select all the columns, or Deselect all to deselect all
the columns.

Specifying Additional Source Tables


By default, the Cube Drillthrough Options dialog box displays all the
columns from the cube’s fact table and dimension tables.
Often the data you want to include for drillthrough is stored in a separate table.
The separate table may contain detail not found in the fact table. In this
situation, you can click Add Table in the Cube Drillthrough Options dialog
box. You then see a list of additional data source tables.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 14: Using Actions, Drillthrough, and Writeback 19

Adding a Filter
The filter is a WHERE clause for the drillthrough SQL statement. To define a
filter, click the Filter tab on the Cube Drillthrough Options dialog box. Do
not type the WHERE keyword—type only the text that follows the WHERE
keyword.
If your drillthrough includes a table other than the fact table or a dimension
table, you must specify a filter. A filter creates a join to the added table.
The SQL WHERE clause, created by the filter expression, is a pass-through
expression. The Cube Drillthrough Options dialog box does not validate the
expression; the expression is not validated until the drillthrough executes. If the
expression contains a syntax error, you do not see an error message until you
attempt to perform the drillthrough.

Note After you define drillthrough for a cube, you must also set permissions
enabling users to execute drillthrough. For more information, see Module 15,
"Implementing Security," in course 2074A, Designing and Implementing OLAP
Solutions with Microsoft SQL Server 2000.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


20 Module 14: Using Actions, Drillthrough, and Writeback

Demonstration: Enabling Drillthrough in a Cube


Topic Objective
To demonstrate how to
enable drillthrough.
Lead-in
In this demonstration, you
will see how to enable
drillthrough for the
Warehouse cube.

This demonstration shows how to enable drillthrough for the Warehouse cube
Delivery Tip by using the FoodMart 2000 database.
Encourage students to
follow along with your ! To display the Cube Drillthrough Options dialog box
demonstration on their
computers.
1. In Analysis Manager, expand the FoodMart 2000 database, and then open
the Cube Editor for the Warehouse cube.
2. Click the Tools menu, and then click Drillthrough Options.

! To select columns
1. In the Cube Drillthrough Options dialog box, select the Enable
drillthrough check box.
2. Select the “units_shipped” column check box in the
“inventory_fact_1997” table.
3. Select the “store_street_address” column check box in the “store” table.
4. Select the “store_city” column check box in the “store” table, and then
click OK.
5. Click OK when the Drillthrough Settings dialog box appears.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 14: Using Actions, Drillthrough, and Writeback 21

! To test drillthrough
1. In the Cube Editor, save the Warehouse cube.

Note When you enable drillthrough or edit drillthrough settings, you must
save the cube for your changes to take effect.

2. Click the Data tab.


3. Right-click a data cell, and then click Drill Through. Notice the
drillthrough columns that you previously selected.
4. Close the Drillthrough Data window, and then close the Cube Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


22 Module 14: Using Actions, Drillthrough, and Writeback

# Understanding Writeback
Topic Objective
To introduce the concept of
writeback.
Lead-in ! Writeback Architecture
Some applications demand ! Writeback Server Mechanics
a flexible data model and
the ability to view and enter
data from different
perspectives at different
levels of detail.

Financial planning applications, such as budgeting and forecasting applications,


Delivery Tip demand a flexible data model, and the ability to view and enter data from
Define the term writeback
before starting this section.
different perspectives at different levels of detail. Financial planning
applications can use OLAP solutions to store and model their data and business
processes. By using Analysis Services OLAP solutions, financial users can
update, or writeback, data in their cubes.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 14: Using Actions, Drillthrough, and Writeback 23

Writeback Architecture
Topic Objective
To introduce writeback
architectural components.
! Cube Cells Are Not Modified
Lead-in
When you enable a cube for $ Writeback data is stored in an incremental change table
writeback, a new table is
automatically created in the $ Writeback is transparent to users
same database that
contains the fact table. This ! Cubes Do Not Require Reprocessing
table is referred to as the $ When a query executes, cell values are adjusted at
writeback table. query time by using the writeback table
! Writeback Table Can Be Merged into the Cube
$ Converting the writeback table requires SQL Server
2000 Enterprise Edition

When you enable a cube for writeback, a new table is automatically created in
Delivery Tip the same database that contains the fact table. This table is referred to as the
Explain that performing writeback table.
writeback requires a client
application that is writeback- When users perform writeback, the users update the writeback table, and not the
enabled. Neither Excel 2000 actual cube cells. The updated data appends to the writeback table without users
nor the Cube Browser is realizing it—writeback is transparent to users.
enabled for writeback. For
Only incremental changes are recorded in the writeback table. For example, if a
this reason, this module
teaches students how to cell contains the number 100, and you writeback the number 105, the writeback
enable writeback on the table stores a +5 value for that cell.
server. However, students Cubes do not require reprocessing to view updated cells when you enable a
will not actually perform a cube for writeback. Incremental changes stored in the writeback table are
writeback operation. applied to query results at run time, as queries are executed. When a user
executes a query, cell values are adjusted at query time.
Writeback data can be merged into the cube, eliminating the incremental
change table. You merge the writeback table into a cube by converting the table
to a cube partition. Converting the writeback table to a partition is available
only if you use Analysis Services for SQL Server 2000 Enterprise Edition.

Note Performing writeback requires a writeback-enabled client application.


Neither Excel 2000 nor the Cube Browser is enabled for writeback.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


24 Module 14: Using Actions, Drillthrough, and Writeback

Writeback Server Mechanics


Topic Objective
To explain how to enable a
cube for writeback, and how
to administer writeback. ! Enabling a Cube for Writeback
Lead-in ! Viewing Writeback Data
By default, users cannot
write back cubes. You ! Converting Writeback Data to a Partition
enable writeback for a cube
in Analysis Manager. ! Disabling Writeback

By default, users cannot write back cubes. You enable writeback for a cube in
Analysis Manager.

Enabling a Cube for Writeback


Users cannot write back cube data until you enable writeback for a cube in
Analysis Manager. To enable a cube for writeback, perform the following steps:
1. Right-click a cube, and then click Write-Enable.
2. Enter the name of the writeback table.
3. Specify the source database where the writeback table will be stored. By
default, this is the same database as the cube data source.

Note After a cube is enabled for writeback, you must grant users permission to
writeback cube data. For more information about security and permissions, see
Module 15, "Implementing Security," in course 2074A Designing and
Implementing OLAP Solutions with Microsoft SQL Server 2000.

Viewing Writeback Data


After a cube has been enabled for writeback, several commands become
available on the context-sensitive cube menu accessed by right-clicking the
cube.
To browse writeback data, perform the following steps:
1. Right-click a cube, and then click Writeback Options.
2. Click Browse Writeback Data.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 14: Using Actions, Drillthrough, and Writeback 25

Tip Because writeback data is stored in a relational table, you can use any
table-browsing tool to view the writeback data.

Converting Writeback Data to a Partition


You can convert your writeback data to a cube partition. This automatically
removes writeback permissions and disables writeback in your cube. After the
partition is created, the writeback table is automatically deleted.
The benefit of converting the writeback table is that run-time performance is
improved. The writeback changes are incorporated into the cube, and the server
no longer needs to apply incremental writeback data to query results at query
time.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


26 Module 14: Using Actions, Drillthrough, and Writeback

Note To convert writeback data to a partition, you must use SQL Server 2000
Enterprise Edition. For more information on partitions, see Module 10,
"Managing Partitions," in course 2074A Designing and Implementing OLAP
Solutions with Microsoft SQL Server 2000.

To convert writeback data to a partition, perform the following steps:


1. Right-click a cube, and then click Writeback Options.
2. Click Convert to Partition.
3. Enter a name for the partition, and specify the aggregation design.

Disabling Writeback
Disabling writeback automatically removes writeback permissions and deletes
the writeback table. In some applications, disabling writeback is a standard
procedure, because the writeback data is used only as temporary cube values.
For example, a common objective of a budgeting application is the budget
report. The cube administrator deletes all budgeting inputs after printing and
distributing the final report.
To disable writeback, perform the following steps:
1. Right-click a cube, and then click Writeback Options.
2. Click Disable Writeback. Click Yes when the confirming dialog box
displays.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 14: Using Actions, Drillthrough, and Writeback 27

Review
Topic Objective
To reinforce module
objectives by reviewing key
points. ! Creating Actions
Lead-in ! Performing Drillthrough
The review questions cover
some of the key concepts ! Understanding Writeback
taught in the module.

1. What is the difference between a URL action and an HTML action?


A URL action navigates to a pre-existing Web page. An HTML action
executes HTML that is self-contained in the action, without the need for
a pre-existing Web page.

2. Is it possible to drill through to a data source other than the source database
for the cube?
No.

3. Does drillthrough generate an MDX statement or an SQL statement?


An SQL statement. It cannot generate MDX.

4. You implement drillthrough for a cube. Your users use a client application
that is enabled for drillthrough, yet they are unable to perform drillthrough.
What is the likely cause?
Users must be given drillthrough permission.

5. Does writeback require SQL Server Enterprise Edition?


No. However, SQL Server 2000 Enterprise Edition is required to merge
writeback data into a cube partition.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 15:
Implementing Security

Contents

Overview 1
Introducing Analysis Services Security 2
Understanding Administrator Security 3
Securing User Authentication 5
Understanding Database Roles 6
Implementing Dimension Security 13
Managing Cube Roles 17
Lab A: Implementing Cube Security 27
Review 32
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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 15: Implementing Security iii

Instructor Notes
Presentation: In this module, students will gather the skills necessary to implement security in
60 Minutes Microsoft® SQL Server™ 2000 Analysis Services. Students will learn the
concepts and mechanics of administrative permissions, database roles, and cube
Lab: roles. In the lab, students create and test a role that uses dimension and cell
30 Minutes security.
After completing this module, students will be able to:
! Understand the use of security in Analysis Services.
! Explain administrator security.
! Describe authentication methods.
! Assign database roles.
! Apply dimension security.
! Manage cube roles.

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_15.ppt

Preparation Tasks
To prepare for this module, you should:
! Read all the student materials.
! Read the instructor notes and margin notes.
! Complete all the demonstrations.
! Practice the lecture presentation and demonstration.
! Complete the lab.
! 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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


iv Module 15: Implementing Security

Module Strategy
Use the following strategy to present this module:
! Introducing Analysis Services Security
Explain that Analysis Services allows security to be defined at different
levels in online analytical processing (OLAP) databases and cubes—from
the server level down to the cell level.
! Understanding Administrator Security
Explain that to administer Analysis Services, you must be a member of the
Microsoft Windows® 2000 or Microsoft Windows NT® OLAP
Administrators group.
! Securing User Authentication
Introduce ways to connect to Analysis Server. Explain that user security is
controlled by authentication.
! Understanding Database Roles
Introduce roles by defining what they are and by giving some key
parameters. Introduce the Database Role Manager dialog box and describe
its use. Show how to define, delete, edit, and copy a new role. Define
database role properties and introduce the Create a Database Role dialog
box and how it allows you to define properties of a role. Display the dialog
box as you discuss the user interface elements.
! Implementing Dimension Security
Introduce dimension security. Explain that, with dimension security, you
can prevent users from viewing specified dimension members, and data
associated with those members. Show how dimension security is defined by
using the Custom Dimension Security dialog box. Display the dialog box
as you discuss the user interface elements.
! Managing Cube Roles
Introduce the Cube Role Manager, explain dimension and cell security,
describe advanced cell security permissions, and introduce administration
and custom options.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 15: Implementing Security 1

Overview
Topic Objective
To provide an overview of
the module topics and
objectives. ! Introducing Analysis Services Security
Lead-in ! Understanding Administrator Security
In this module, you will learn
about Analysis Services ! Securing User Authentication
security.
! Understanding Database Roles
! Implementing Dimension Security
! Managing Cube Roles

This module teaches you how to implement security in Microsoft® SQL


Server™ 2000 Analysis Services. You will learn the concepts and mechanics of
administrative permissions, database roles, and cube roles. In the lab, you will
create and test a role that uses dimension and cell security.
After completing this module, you will be able to:
! Understand the use of security in Analysis Services.
! Explain administrator security.
! Describe authentication methods.
! Assign database roles.
! Apply dimension security.
! Manage cube roles.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


2 Module 15: Implementing Security

Introducing Analysis Services Security


Topic Objective
To introduce the concept of
security.
Lead-in ! Administrator Security
By implementing security in ! Cube Security
Analysis Services, you limit
access to data. ! Dimension Security
! Cell Security
! Special Options

By implementing security in Analysis Services, you limit access to data.


Key Point Analysis Services allows security to be defined at different levels and for
Database security can be
applied in Analysis Services
different reasons in databases and cubes. For example, the following are types
only when the Analysis of Analysis Services security:
Server is installed on an
! Administrator security defines who can administer an Analysis Server.
NTFS file system.
Therefore, it is ! Cube security allows you to specify which users can read and write to an
recommended that Analysis online analytical processing (OLAP) cube.
Services always be installed
on an NTFS partition. ! Dimension security allows you to restrict users from viewing specified
dimension members.
! Cell security, the most granular level of security, allows you to define the
cells that users can read and write to.
! Special options define security for drillthrough, cube linking, and SQL
queries.

Important Database security can be applied in Analysis Services only when the
Analysis Server is installed on an NTFS file system. Therefore, it is
recommended that Analysis Services always be installed on an NTFS partition.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 15: Implementing Security 3

Understanding Administrator Security


Topic Objective
To explain administrator
security.
Lead-in ! Administrator Security Is Based on Windows 2000 or
Administrator security Windows NT 4.0 Security
defines who can administer
an Analysis Server.
! The User Who Installs Analysis Services Is
Automatically Placed in the OLAP Administrators Group
! Additional Administrators Must Be Added to the OLAP
Administrators Group
! All Administrators Have Identical Privileges
! An Administrator Retains Full Access Privileges when
Connected through a Client

Administrator security defines who can administer an Analysis Server. It is


important to understand how to grant administrators the required rights needed
to gain access to the Analysis Server.
The following are characteristics of administrator security:
! To administer Analysis Services, you must be a member of the Microsoft
Windows® 2000 or Microsoft Windows NT® 4.0 OLAP Administrators
group. When Analysis Services is installed, a user group named OLAP
Administrators is automatically created on the Analysis Server.
! The user who performs the installation is automatically placed in the OLAP
Administrators group.
! Any additional administrators must be added to the OLAP Administrators
group. You add administrators to the OLAP Administrators group outside
Analysis Manager by using Windows 2000 or Windows NT 4.0 user
administration.
! Only one level of administrator privilege exists in Analysis Services. An
administrator can perform all operations in a database—they can even delete
the database.
! When connected to a cube through a client, administrators retain full read
and write access to all cubes, dimensions, and cells, regardless of any
defined cube, dimension, or cell security.

Note Administrators maintain write access to only those cubes that are
write-enabled.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


4 Module 15: Implementing Security

It is recommended that you establish specific Windows 2000 or Windows NT


accounts to administer Analysis Services. Administrators should refrain from
accessing Web pages, productivity applications, and e-mail applications that
support scripts or macros when using the administrative accounts because of the
extensive data access rights of administrative account holders.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 15: Implementing Security 5

Securing User Authentication


Topic Objective
To introduce ways to
connect to Analysis Server.
Lead-in ! Direct Connection
User security is controlled # A user connects to Analysis Server directly
by authentication.
# Authentication is based on credentials granted in the
user domain account
! HTTP Connection through IIS
# A user connects to Analysis Server through IIS by using
HTTP
# Analysis Server relies on IIS authentication

User security is controlled by authentication. There are two ways to connect to


an Analysis Server, each with its own authentication method.
! Direct Connection
When a user attempts to connect to an Analysis Server directly, the server
attempts to authenticate based on credentials granted in the domain account
of the user.
If the connection string specifies a user name and password different from
the login account of the user, the specified name and password are ignored.
If the credentials of the user do not permit access to the Analysis Server
from the network, authentication is unsuccessful and the connection fails.
Analysis Services uses Security Support Provider Interface (SSPI), and
supports various providers that use SSPI.
! Internet Information Services (IIS)
Users can connect to an Analysis Server through IIS by using Hypertext
Transfer Protocol (HTTP). A connection string specifies the data source
property.
When a user attempts to connect through IIS, Analysis Server relies on IIS
authentication. If authentication on IIS is unsuccessful, the connection to the
Analysis Server is denied.

Note IIS provides several authentication methods. For additional


information, refer to the Internet Information Services online
documentation.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


6 Module 15: Implementing Security

$ Understanding Database Roles


Topic Objective
To describe the concept of
roles in Analysis Services.
Lead-in ! Defining Roles
To give users access to ! Using the Database Role Manager
Analysis Services
databases and cubes, you ! Defining Database Role Properties
must first create roles to
assign the access.

To give users access to Analysis Services databases and cubes, you must first
create roles to assign the access. To effectively manage roles, you need to
understand the use of roles in Analysis Services, and how to create roles by
using Analysis Manager.
In the next section, you will learn about the following security topics relating to
roles:
! Defining roles.
! Using the Database Role Manager.
! Defining database role properties.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 15: Implementing Security 7

Defining Roles
Topic Objective
To define Analysis Services
roles.
! Are Used to Grant Access to Analysis Services
Lead-in Databases and Cubes
You create roles to define
the access of users to cube ! Must Be Created—None Exist By Default
data or data mining models
while they connect to ! Cannot Be Shared Across Multiple Databases
Analysis Server through
client applications. ! Are Automatically Created at the Database Level if You
Create Roles at the Cube Level
! Are Managed in the Database Role Manager and the
Cube Role Manager

You create roles to define the access of users to cube data or data mining
models while they connect to Analysis Server through client applications. Each
role includes a list of user accounts and groups, and defines the access
permissions that these users share.
The following are key parameters regarding roles:
! You define roles for Analysis Services databases and for the cubes in the
databases.
! By default, OLAP databases and cubes have no roles. When no roles are
defined, only OLAP Administrators have access to the cubes.
! You cannot share roles across multiple databases.
! When you create a cube role, a database role of the same name is
automatically created.
• When you delete a cube role, the database role of the same name is not
deleted.
• Some properties of a database role are overridden by the corresponding
cube or virtual cube roles without changing the properties of the
database role.

Note Database roles cannot be overridden for a data mining model. For
more information on data mining, see Module 17, “Introduction to Data
Mining,” in course 2074A, Designing and Implementing OLAP Solutions
with Microsoft SQL Server 2000.

! There are two user interfaces for defining and managing roles—the
Database Role Manager dialog box and the Cube Role Manager dialog
box.
To display the Database Role Manager for a database, right-click the
database, and then click Manage Roles. To display the Cube Role
Manager for a cube, right-click the cube, and then click Manage Roles.
BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY
8 Module 15: Implementing Security

Using the Database Role Manager


Topic Objective
To introduce the Database
Role Manager dialog box.
Lead-in
You use the Database Role
Manager dialog box to
define and administer roles
for the database.

You use the Database Role Manager dialog box to define and administer roles
Delivery Tip for databases. Roles can be assigned to cubes, including virtual and linked
Display the Database Role
Manager dialog box as you
cubes, and data mining models.
discuss the user interface
elements. Defining a Role
To define a new role for a database, perform the following steps:
1. Right-click the database, and then click Manage Roles.
2. Click New in the Database Role Manager dialog box.
3. Define the role properties by using the Create a Database Role dialog box
that is discussed later in this section.

Deleting a Role
To delete a role in a database, perform the following steps:
1. Right-click the database, and then click Manage Roles.
2. In the Database Role Manager dialog box, click the role you want to
delete.
3. Click Delete.

Editing a Role
To edit a role in a database, perform the following steps:
1. In the Database Role Manager dialog box, click the role you want to edit.
2. Click Edit.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 15: Implementing Security 9

Copying a Role
To copy a role in a database, perform the following steps:
1. In the Database Role Manager dialog box, click the role you want to copy.
2. Click Duplicate.
3. Enter a name for the new role, and then click OK.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


10 Module 15: Implementing Security

Defining Database Role Properties


Topic Objective
To explain database role
properties.
Lead-in
The Create a Database
Role dialog box allows you
to define properties of a
role.

The Create a Database Role dialog box allows you to define the following
Delivery Tip properties of a role:
Display the Create a
Database Role dialog box ! The users and user groups that belong to the role
as you discuss the user
interface elements. ! The cubes to which the role is assigned
! The data mining models to which the role is assigned
! The shared dimensions for which you want to restrict user access
The Create a Database Role dialog box contains interface elements similar to
the Create a Cube Role dialog box. Both interfaces are straightforward to use
when defining database and cube security.

Role Name
The role name can be up to 50 characters long. After a role is defined, the role
name cannot be changed.

Enforce On
Roles can be enforced on either the client or the server. By default, roles are
enforced on the client. Client enforcement provides superior performance, but
increases the risk of unauthorized access. Server enforcement is more secure,
but may affect performance.

Note Cell security, discussed later, requires that security be enforced on the
client.

Membership
On the Membership tab, you specify which users or user groups belong to the
role. Users and user groups must be predefined by using Windows 2000 or
Windows NT 4.0 user administration.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 15: Implementing Security 11

Cubes
On the Cubes tab, you specify the cubes to which the role is assigned. A role
can be assigned to any type of cube—regular, virtual, or linked. After a role is
assigned to a cube, some properties of the role can be customized for the cube
without changing the database role.

Mining Models
On the Mining Models tab, you specify the data mining models to which the
role is assigned.

Dimensions
The Dimensions tab allows you to restrict access to dimension members. Only
shared dimensions display on this tab. To restrict access to a private dimension,
you must use the Cube Role Manager dialog box.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


12 Module 15: Implementing Security

Implementing Dimension Security


Topic Objective
To introduce dimension
security.
Lead-in
By using dimension security,
you prevent users from
viewing specified dimension
members and data
associated with those
members.

By using dimension security, you prevent users from viewing specified


Delivery Tip dimension members and data associated with those members. For example, the
Display the Custom
Dimension Security dialog
preceding illustration shows a dimension security rule that limits access to
box as you discuss the user Roberta Damstra employees. Any users connecting to the cube through this
interface elements. role will see data and dimension members for only Roberta Damstra and her
subordinate employees at lower levels in the Employee dimension.
Dimension security is defined by using the Custom Dimension Security dialog
Key Point box, which contains three tabs.
By using dimension security,
you prevent users from
viewing specified dimension Basic Tab
members and data The Basic tab on the Custom Dimension Security dialog box provides the
associated with those
following security properties:
members.
! Select visible levels
This pane allows you to specify the top and bottom visible levels in the
dimension. Use these settings if you want to deny access to entire levels.
! Select members
This pane displays a check box next to each dimension member. Selected
members are visible to users assigned to the role. Deselected members are
not visible to the users.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 15: Implementing Security 13

Advanced Tab
For complex dimension security, the Advanced tab allows you to enter
multidimensional expression (MDX) statements that define the dimension
members viewable by users assigned to the role.
On the Advanced tab:
! Data inputs from the Basic tab are represented as MDX statements. You can
edit the MDX statements directly in the edit boxes, or you can click the
ellipsis buttons (…) to display the MDX Builder dialog box.
! Separate MDX statements define the top viewable level, the bottom
viewable level, the visible members, and the invisible members.

Common Tab
The Common tab lists two important features:
! Visual Totals
When you enabled this property, members that are hidden because of
dimension security are not included in aggregations.
When you do not enable the Visual Totals property, a parent member value
may not equal the value of its visible children. In addition, when visual
totals are disabled, users may be able to deduce the values for hidden
members. When you hide dimension members, you normally enable the
Visual Totals property to prevent these problems from occurring.

Note Visual totals cannot be enabled for a cube containing a measure based
on a distinct count. For more information on distinct count measures, see
Module 6, “Working with Cubes and Measures,” in course 2074A,
Designing and Implementing OLAP Solutions with Microsoft SQL Server
2000.

! Default Member
For users assigned to the role, this property—an MDX statement—specifies
the default member for the defined dimension. The MDX statement can be a
simple member name, or a complex expression that evaluates the member
name dynamically.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


14 Module 15: Implementing Security

Demonstration: Defining a New Database Role


Topic Objective
To demonstrate how to
define a database role.
Lead-in
In this demonstration, you
learn how to add a new role
to the FoodMart 2000
database.

In this demonstration, you learn how to add a new role to the FoodMart 2000
Delivery Tip database.
Encourage students to
follow along with your
demonstration. ! To display the Create a Database Role dialog box
1. In Analysis Manager, right-click the FoodMart 2000 database, and then
click Manage Roles.
2. In the Database Role Manager dialog box, click New.

! To specify basic properties


1. In the Create a Database Role dialog box, type My New Role in the Role
name box.
2. In the Enforce on list, click Server.

! To specify role membership


1. In the Create a Database Role dialog box, click the Membership tab, and
then click Add.
2. In the Add Users and Groups dialog box, click any user group, and then
click Add.
3. Click OK to close the Add Users and Groups dialog box.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 15: Implementing Security 15

! To assign the role to a cube


1. In the Create a Database Role dialog box, click the Cubes tab.
2. Select the HR cube check box.
3. Click OK to close the Create a Database Role dialog box.
4. Click Close to close the Database Role Manager dialog box.
5. In the FoodMart 2000 database, expand the Cubes folder.
6. Click the HR cube, and then click the Meta Data tab.
7. In the Meta Data pane, scroll down to Roles. Verify that role My New
Role is assigned to the cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


16 Module 15: Implementing Security

$ Managing Cube Roles


Topic Objective
To introduce the concept of
managing cube roles.
Lead-in ! The Cube Role Manager
This section explains how to ! Dimension and Cell Security
manage cube roles.
! Advanced Cell Security Permissions
! Administration of Custom Options

This section introduces how to manage cube roles by using the Cube Role
Manager. The section also explains dimension and cell security, advanced cell
security permissions, and the administration of custom options.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 15: Implementing Security 17

The Cube Role Manager


Topic Objective
To introduce cube roles.
Lead-in
A cube role defines access
permissions for cubes,
including virtual cubes and
linked cubes.

A cube role defines access permissions for cubes, including virtual cubes and
Delivery Tips linked cubes. To create and maintain cube roles, use the Cube Role Manager
Display the appropriate dialog box.
interface of the Cube Role
Manager dialog box as you To display the Cube Role Manager dialog box, perform the following steps:
discuss this section and the
following slides pertaining to 1. Expand the database, and then expand the Cubes folder.
cube role management. 2. Right-click the cube, and then click Manage Roles.
As necessary, switch
between the slides and the The Cube Role Manager Dialog Box
Cube Role Manager The Cube Role Manager dialog box is similar to the Database Role Manager
interfaces.
dialog box. However, there are a few differences:
! The leftmost column on the dialog box contains check boxes. Only the
selected roles are assigned to the cube.

Key Point ! The Cube Role Manager allows you to define cell security.
A cube role defines access ! The Cube Role Manager allows you to define drillthrough, cube linking,
permissions for cubes, and SQL query permissions.
including virtual cubes and
linked cubes.
Note For more information about drillthrough, see Module 14, “Using
Actions, Drillthrough, and Writeback,” in course 2074A, Designing and
Implementing OLAP Solutions with Microsoft SQL Server 2000.

! The Cube Role Manager allows you to establish security for both private
and shared dimensions, whereas the Database Role Manager lists only
shared dimensions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


18 Module 15: Implementing Security

Working with the Cube Role Manager


When you create a new role by using the Cube Role Manager, a database role
of the same name is automatically created.
To define a new cube role by using the Cube Role Manager, perform the
following steps:
1. In the Cube Role Manager dialog box, click New.
2. Define the role properties by using the Create a Cube Role dialog box.

To edit a cube role in the Cube Role Manager, perform the following steps:
1. In the Cube Role Manager dialog box, click the appropriate role.
2. Click Edit.
To copy a cube role in the Cube Role Manager, perform the following steps:
1. In the Cube Role Manager dialog box, click the role you want to copy.
2. Click Duplicate.
3. Enter a name for the new role, and then click OK.
To test a cube role the Cube Role Manager, perform the following steps:
1. In the Cube Role Manager dialog box, click the role you want to test.
2. Click Test Role.
The Cube Browser dialog box appears, showing what an assigned user sees
in the cube.
To delete a cube role in the Cube Role Manager, perform the following step:
• In the Cube Role Manager dialog box, deselect the check box of the role.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 15: Implementing Security 19

Dimension and Cell Security


Topic Objective
To explain dimension and ! Dimension Security in Cubes
cell security.
# The cube interface is almost identical to the database
Lead-in interface
You can assign detailed
access to a cube by # You can define dimension security for shared and
applying dimension and cell private dimensions
level security in the Create
a Cube Role dialog box. ! Cell Security
# It is the most detailed level of security
# You first define the cell security policy
•Unrestricted Read
•Unrestricted Read/Write
•Advanced

You assign detailed access to a cube by applying dimension and cell level
security in the Create a Cube Role dialog box. The Create a Cube Role
dialog box is a superset of the Create a Database Role dialog box. Discussed
below are the elements that are unique to cube roles.

Dimension Security in Cubes


As with database roles, cube roles allow you to define dimension security. The
user interface for defining dimension security in a cube is identical to the
interface for defining dimension security in a database, with one key exception:
a cube role allows for dimension security for private dimensions in addition to
shared dimensions.

Cell Security
Cell security is the most detailed level of security—you use cell security to
restrict access to cell values. Define cell level security on the Cells tab in the
Create a Cube Role dialog box.
To define cell security, you must first specify the cell security policy. The cell
security policy designates the overriding policy for the cube and is set to one of
the following three options:
! Unrestricted Read. Users belonging to the role can view all cells. This is the
default policy.
! Unrestricted Read/Write. Users belonging to this role can view and update
all cell values. This option is only available if the cube, or underlying base
cubes for a virtual cube, is write-enabled.
! Advanced. The role can view only those cells specified by the advanced cell
security described in the next section.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


20 Module 15: Implementing Security

Advanced Cell Security Permissions


Topic Objective
To introduce advanced cell
security permissions.
! Read Permission
Lead-in # Determines the cells that users can view
The three types of advanced
permissions are Read ! Read Contingent Permission
Permission, Read
Contingent Permission, and # Determines if cells derived from restricted cells are
Read/Write Permission. viewable by users
•Cells are viewable if derived from viewable cells
•Cells are not viewable if derived from restricted cells
! Read/Write Permission
# Determines the cells that users can update

If you select the Advanced policy for cell security, you can define three types of
permissions for cells, each of which has three types of rules that can be applied.
The three types of advanced permissions are Read Permission, Read Contingent
Permission, and Read/Write Permission.
In each of these permissions, the three types of rules that can be applied are
Unrestricted, Fully Restricted, and Custom.

Read Permission
Read permission determines the cells that are viewable to users of the role. The
cells specified with this permission are viewable regardless of whether they are
derived from other cells that are not viewable. The read permission choices are:
! Unrestricted. Users belonging to the role can view all cells. This is the
default read permission choice.
! Fully Restricted. The users belonging to this role can view only those cells
specified by read contingent or read/write permissions described below.
! Custom. The users belonging to this role can view only those cells specified
by an MDX statement.

Note If the Advanced Cell Security Rule for the Read Contingent or
Read/Write Permission is Unrestricted and you create a Custom Rule for the
Read Permission, the setting for Read Contingent and Read/Write is changed
automatically to Fully Restricted on saving the role.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 15: Implementing Security 21

Read Contingent Permission


Read contingent permission determines whether cells that are derived from
restricted cells are viewable to the user. Cells specified with this permission and
derived from other cells are viewable only if all the source cells are also
viewable.
For example, suppose a cube contains the measures Sales and Cost and the
calculated member Profit, which equals Sales minus Cost. If a custom MDX
expression grants access to all measures except Cost, Cost and Profit would
both be unavailable.
The read contingent permission choices are:
! Unrestricted. Users belonging to the role can view all cells. This is the
default choice.
! Fully Restricted. Users belonging to the role can view only those cells
specified by Read or Read/Write permissions.
! Custom. Viewable cells are specified by an MDX expression. By using the
above example, if Cost were restricted, Profit would also be restricted
because it uses the restricted Cost measure in its calculation.

Read/Write Permission
Read/write permission determines the cells that users can update by using the
writeback capability of Analysis Services. The cube must be write-enabled for
this setting to take effect.
Read/write permission overrides read permission—that is, if a user is granted
read/write permission, that user is able to view the cell even if read permission
is denied.
The read/write permission choices are:
! Unrestricted. Users belonging to the role can update all cells.
! Fully Restricted. Users belonging to the role cannot update any cells but can
read cells as specified by Read or Read Contingent permissions.
! Custom. An MDX expression defines the cells that can be both read and
updated.

Note For more information on writeback, see Module 14, “Using Actions,
Drillthrough, and Writeback,” in course 2074A, Designing and Implementing
OLAP Solutions with Microsoft SQL Server 2000.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


22 Module 15: Implementing Security

Administration of Custom Options


Topic Objective
To introduce the ! Custom Settings Administration
administration of custom
settings and special cube # MDX statements define viewable or restricted cells in
security options.
custom rules
Lead-in # Commonly used security MDX functions include:
The following items concern •CurrentMember
the administration of custom
settings and special cube
•Ancestor
security options. •Name
! Special Cube Security Options
# Allow Drillthrough
# Allow linking to this cube
# Allow sending SQL queries

The following items concern the administration of custom settings and special
cube security options.

Custom Settings Administration


To administer a custom rule for cell security, create an MDX expression to
define the cells that are available for viewing or updating.
MDX functions that you commonly use to define cell security custom rules
include the following:
! CurrentMember—used to specify the currently accessed member.
! Ancestor—used to specify the ancestor of the currently accessed member.
! Name—used to specify the name of a particular member.
The MDX expression returns either a Boolean or a numeric result. If the
expression returns True or a non-zero number, access is granted to that cell. If
the expression returns False or zero, access is denied. Therefore, you specify
either the cells that a user is able to access or the cells a user cannot access.
For example, if you want to grant access to all cells in the USA and no other
geography, you can use the following expression:
Ancestor([Geography].CurrentMember,[Geography].[Country]).Name
= “USA”

Alternatively, you can specify the members that are not available for access.
For example, if you want to grant access to all measures except Unit Sales, you
can use the following expression:
[Measures].CurrentMember.Name <> “Unit Sales”

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 15: Implementing Security 23

Note If a dimension is not included in the MDX expression, it is assumed that


users are granted access to all cells in that dimension.

Special Cube Security Options


The Options tab in the Create a Cube Role dialog box contains three check
boxes for security properties:
! Allow Drillthrough
When selected, users belonging to the role are allowed to perform
drillthrough. Drillthrough must be defined in the cube for this property to
apply to the cube.

Note Linked cubes do not support drillthrough.

! Allow linking to this cube


When selected, users belonging to the role are permitted to link to the cube.
! Allow sending SQL queries
When selected, users belonging to the role are permitted to query the cube
by using SQL.

Note Because Analysis Server is an OLE DB provider, in addition to an


OLE DB for OLAP Provider, it can be queried with SQL.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


24 Module 15: Implementing Security

Demonstration: Building Dimension and Cell Security


Topic Objective
To demonstrate dimension
and cell security.
Lead-in
In this demonstration, you
will learn how to define a
new role for the HR cube in
the FoodMart 2000
database.

In this demonstration, you will learn how to define a new role for the HR cube
Delivery Tip in the FoodMart 2000 database. The members of this role will be denied access
Encourage students to
follow this demonstration on
to:
their own computers. ! The Senior Management member of the Position dimension by using
dimension security.
! The Employee Salary measure for the Middle Management member of
the Position dimension by using cell security.

! To set up and specify a role


1. In Analysis Manager, expand the FoodMart 2000 database, expand the
Cubes folder, right-click the HR cube, and then click Manage Roles.
2. In the Cube Role Manager dialog box, click New.
3. In the Create a Cube Role dialog box, type HR Role in the Role name
box.
4. Verify that Client is selected in the Enforce on list.
5. Click the Membership tab, and then click Add.
6. In the Add Users and Groups dialog box, click any user group, click Add,
and then click OK to close the Add Users and Groups dialog box.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 15: Implementing Security 25

! To define dimension security


1. In the Create a Cube Role dialog box, click the Dimensions tab.
2. Click the Rule column for the Position dimension, and then in the list, click
Custom.
3. In the Custom Settings column, click the ellipsis button (…).
4. In the Custom Dimension Security dialog box, type No Senior
Management in the Description box.
5. In the Members box, click the plus sign (+) next to the All Position
member to expand the outline.
6. Clear the Senior Management member check box.
7. Click the Advanced tab and notice the various MDX statements.
The MDX statements correspond to the inputs on the Basic tab. You can
update the statements manually.
8. Click the Common tab. Notice that the Virtual Totals properties are
disabled.
The HR cube contains a distinct count measure. Visual Totals cannot exist
in cubes containing distinct count measures.
9. Click OK to close the Custom Dimension Security dialog box.

! To define cell security


1. In the Create a Cube Role dialog box, click the Cells tab.
2. In the Cell security policy list, click Advanced.
3. Click the Rule column for Read permission, and then in the list, click
Custom.
4. Click the ellipsis button (…) in the Custom Settings column.
5. Type Hide salary for middle managers in the Description box.
6. In the MDX box, enter the following:
Position.Currentmember.Name <> "Middle Management" OR
(Position.Currentmember.Name = "Middle Management" AND
Measures.Currentmember.Name <> "Employee Salary")

The MDX expression gives users the ability to view all non-Middle
Management Position dimension members for all measures, and the ability
to view Middle Management members for all measures except for
Employee Salary.
7. Click Check to validate the MDX syntax, and then click OK.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


26 Module 15: Implementing Security

! To test the role


1. Click OK to close the Cube Cell Security dialog box.
2. Click OK to close the Create a Cube Role dialog box.
3. In the Cube Role Manager dialog box, click Test Role.
4. In the Cube Browser dialog box, drag the Position dimension to the row
area.
5. Verify that the Senior Management member does not appear in the
Position dimension.
6. Verify that for the Middle Management member, Employee Salary
displays #N/A.
7. Click Close twice.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 15: Implementing Security 27

Lab A: Implementing Cube Security


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will create a
role, implement security,
and test a role.

Explain the lab objectives.


Objectives
After completing this lab, you will be able to:
! Create a cube role.
! Implement dimension security.
! Implement cell security.
! Test a cube role.

Scenario
In exercise 1, you will implement dimension security. The role you define will
prevent users from viewing members of the Promotions dimension, except for
the All Promotions member. The same role will restrict the Store dimension so
that users can view only USA and its descendants. Finally, you will prevent
users from viewing the Store Cost measure.
In exercise 2, you will modify the role you created in exercise 1. Rather than
completely denying users access to Canada and Mexico, you will prevent them
from seeing the Store Cost measure for stores outside USA. You will perform
this by defining cell security for the cube.

Estimated time to complete this lab: 30 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


28 Module 15: Implementing Security

Exercise 1
Building Dimension Security
In this exercise, you will implement dimension security for the FoodMart 2000
Sales cube.

! To define a new role


1. In Analysis Manager, expand the Cubes folder in the FoodMart 2000
database.
2. Right-click the Sales cube, and then click Manage Roles.
3. In the Cube Role Manager dialog box, click New.
4. In the Create a Cube Role dialog box, type USA in the Role name box.
5. In the Enforce on list, click Server.

! To specify associated users


1. Click the Membership tab, and then click Add.
2. In the Add Users and Groups dialog box, click any user group, and then
click Add.
3. Click OK to close the Add Users and Groups dialog box.

! To deny access to the Promotions dimension


1. Click the Dimensions tab.
2. Click the Rule column for the Promotions dimension, and then in the list,
click Fully Restricted.

! To provide access to USA stores only


1. On the Dimensions tab, in the Rule column for the Store dimension, click
Custom.
2. Click the ellipsis button (…) in the Custom Settings column for the Store
dimension.
3. Type USA Only in the Description box.
4. In the Top Level list, click Store Country.
5. Verify that the Select all members option is clicked in the Select members
pane.
6. In the Members pane, Canada, Mexico, and USA are displayed. Deselect
the Canada and Mexico check boxes.
7. Click OK to close Custom Dimension Security dialog box.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 15: Implementing Security 29

! To deny access to the Store Cost measure


1. On the Dimensions tab, click the Rule column for the Measures dimension,
and then in the list, click Custom.
Unlike the other dimensions, Measures has no Fully Restricted option. It is
impossible to fully restrict all cube measures.
2. Click the ellipsis button (…) in the Custom Settings column for the
Measures dimension.
3. Type No Cost in the Description box.
4. Verify that the Select all members option is clicked in the Select members
pane.
5. In the Visible Measures pane, deselect the Store Cost check box.
6. Click OK to close the Custom Dimension Security dialog box.
7. Click OK to close the Create a Cube Role dialog box.

! To test the security settings


1. In the Cube Role Manager dialog box, click Test Role.
The Cube Browser dialog box displays.
2. Verify that for the Promotions dimension, only one member displays—All
Promotions.
3. Verify that for the Store dimension, only USA and USA’s descendants are
displayed.
4. Verify that for the Measures dimension, Store Cost does not display.
5. Close the Cube Browser dialog box, and then close the Cube Role
Manager dialog box.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


30 Module 15: Implementing Security

Exercise 2
Building Cell Security
In the previous exercise, you prevented USA users from seeing Canada and
Mexico data. Suppose, however, that rather than completely denying these
users access to Canada and Mexico, that you simply want to prevent them
from viewing a specific measure, Store Cost, for Canada and Mexico. You
can define cell security rather than dimension security for the Store dimension.

! To remove security from Store and Measures dimensions


1. In Analysis Manager, right-click the FoodMart 2000 Sales cube, and then
click Manage Roles.
2. In the Cube Role Manager dialog box, click the USA role, and then click
Edit.
3. In the Edit a Cube Role dialog box, click the Dimensions tab.
4. Click the Rule column for the Store dimension, and then in the list, click
Unrestricted.
5. Click the Rule column for the Measures dimension, and then in the list,
click Unrestricted.

! To deny read access to Store Cost for Canada and Mexico


1. In the Edit a Cube Role dialog box, click the Cells tab.
2. In the Cell security policy list, click Advanced.
3. An alert appears asking if you want to enforce security on the client. Click
Yes.
Cell security requires enforcement on the client.
4. Click the Rule column for permission Read, and then in the list, click
Custom.
5. Click the ellipsis button (…) in the Custom Settings column.
6. In the Cube Cell Security dialog box, type No Cost Canada Mexico in the
Description box.
7. Enter the following in the MDX box:
Ancestor(Store.Currentmember, [Store Country]).Name = "USA"
OR (Ancestor(Store.Currentmember, [Store Country]).Name <>
"USA" AND Measures.Currentmember.Name <> "Store Cost")

The MDX statement gives users the ability to see USA stores for all
measures, and stores that are not in the USA, but not for the Store Cost
measure.

8. Click Check to validate the MDX syntax, and then click OK.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 15: Implementing Security 31

! To test the role


1. Click OK to close the Cube Cell Security dialog box.
2. Click OK to close the Edit a Cube Role dialog box.
3. In the Cube Role Manager dialog box, click Test Role.
4. In the Cube Browser dialog box, drag the Store dimension to rows.
5. Verify that for the Store Cost measure, USA and its descendants contain
numeric values, and all other members of the Store dimension display
#N/A.
6. Click Close twice.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


32 Module 15: Implementing Security

Review
Topic Objective
To reinforce module
objectives by reviewing key
points. ! Introducing Analysis Services Security
Lead-in ! Understanding Administrator Security
The review questions cover
some of the key concepts ! Securing User Authentication
taught in the module.
! Understanding Database Roles
! Implementing Dimension Security
! Managing Cube Roles

1. How do you grant someone permission to administer an Analysis Services


database?
You must add them to the OLAP Administrators group by using
Windows 2000 or Windows NT 4.0 user administration.

2. When connecting to a cube by using HTTP protocol, how are users


authenticated?
Users are authenticated with Internet Information Services (IIS)
authentication.

3. You create a cube role restricting access to a dimension member. You test
the role by using the Test Role feature, and the role works correctly.
However, when you access the cube from a client application, the restricted
member displays. What is a likely cause?
The user is probably a member of the OLAP Administrators group.
Administrator status overrides security defined by a role.

4. How does a database role differ from a cube role?


A database role cannot define security for private dimensions.
A database role cannot define cell security.
A database role cannot define drillthrough, linking, or SQL security.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 15: Implementing Security 33

5. Can dimension and cell security be applied to virtual cubes? To linked


cubes?
Yes in both cases.

6. When access to a member is denied by using dimension security, is the user


prevented from seeing the member name, or just the data associated with the
member?
The user is unable to see both the member name and the data of the
member.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 16: Deploying
an OLAP Solution

Contents

Overview 1
Introducing DTS 2
Executing and Scheduling Packages 10
The Analysis Services Processing Task 12
Lab A: Creating a Package 16
Copying and Archiving OLAP Databases 19
Review 24
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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 16: Deploying an OLAP Solution iii

Instructor Notes
Presentation: Automating cube processing, copying server objects, and moving databases
45 Minutes from testing to production environments are important steps that come at the
end of an online analytical processing (OLAP) application’s deployment phase.
Lab: In this module, students learn the mechanics and techniques for these essential
15 Minutes processes.
After completing this module, students will be able to:
! Describe the role of Data Transformation Services (DTS).
! Create a DTS package.
! Define an Analysis Services processing task.
! Copy, archive, and restore OLAP databases.

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_16.ppt

Preparation Tasks
To prepare for this module, you should:
! Read all the student materials.
! Read the instructor notes and margin notes.
! Complete all the demonstrations.
! Practice the lecture presentation and demonstration.
! Complete the lab.
! 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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


iv Module 16: Deploying an OLAP Solution

Demonstration: Creating a Package


In this exercise, you will create a new package that processes the HR cube in
Demonstration: the Foodmart 2000 database.
15 Minutes The following demonstration procedures provide information that will not fit in
the margin notes or are not appropriate for student notes.

! To create a DTS package


1. Click Start, point to Programs, point to Microsoft SQL Server, and then
click Enterprise Manager.
2. Expand Microsoft SQL Servers, expand SQL Server Group, expand the
local server, and then expand the Data Transformation Services folder.
3. Right-click Local Packages, and then click New Package.
The DTS Designer appears. This is where you design the tasks you want to
automate.
4. Click the Package menu, and then click Save.
5. Type OLAP Update as the name of the package, and then click OK.

! To create an Analysis Services Processing Task


1. Drag the Analysis Services Processing Task icon from the Task tool
palette onto the DTS Designer workspace.
The Analysis Services Processing Task dialog box appears.
2. In the Description box, type Process HR Cube.
3. Select the Local server checkbox at the bottom of the dialog box.
You can use the OLAP Update package on any Microsoft® SQL Server™
2000 computer, because you are not saving the server name in the package.
Instead, you assign the server as LOCALHOST.
4. In the tree view on the left side of the dialog box, expand LOCALHOST,
expand Foodmart 2000, expand the Cubes folder, and then click the HR
cube.
Notice the processing options available for cubes on the right side of the
dialog box.
5. Click Refresh data, and then click OK.
You created an Analysis Services Processing Task that refreshes the HR
cube in the Foodmart 2000 database.

! To execute the package


1. On the DTS Designer toolbar, click Execute.
2. Click OK, and then click Done after the package finishes processing.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 16: Deploying an OLAP Solution v

! To define a precedence constraint


1. From the DTS Designer Task tool palette, click Execute Process Task.
The Execute Process Task Properties dialog box opens.
2. Type Command Script in the Description box.
3. Click the file C:\Moc\2074A\Labfiles\L16\CMDScript.cmd, click Open,
and then click OK.
4. Click the Process HR Cube task, and press the CTRL key as you click the
Command Script task.

Important The order in which you select the two tasks is critical to setting
up the precedence constraints properly.

5. Click the Workflow menu, and then click Failure.


A red-striped arrow appears showing the relationship between the two tasks.

! To save and schedule a DTS package


1. Close the DTS Package window, and then click Yes when prompted to save
the package.
2. In the Enterprise Manager window, click Local Packages, right-click the
OLAP Update package, and then click Schedule Package.
3. Click OK if Enterprise Manager warns you that the SQL Server Agent is
stopped.
4. In the Edit Recurring Job Schedule dialog box, click the Daily option in
the Occurs group, and click 7:00 PM in the Occurs Once At box.
5. Click OK to schedule the task.
The scheduled task becomes a SQL Server Agent job. To edit or delete the
schedule, you must go into the SQL Server Agent folder.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


vi Module 16: Deploying an OLAP Solution

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. What does the Local server check box in the Analysis Services Processing
Task dialog box do?
If you select the Local server check box in the Analysis Services
Processing Task, the local server name is not attached to the package.
Therefore, you can execute the package on multiple servers without
receiving errors because of incorrect server names.
2. Can you create packages that execute other packages?
Yes.
3. Do you need to install SQL Server 2000 Enterprise Manager to design a
package?
You can start the DTS Designer only from the Enterprise Manager
interface. You can start the DTS Import and DTS Export wizards
externally to Enterprise Manager. You can design packages
programmatically outside the DTS Designer by using Component
Object Model (COM) compliant programming languages.
4. What are potential issues with buying third-party OLE DB providers?
DTS has a series of interfaces that an OLE DB provider must support
in the same order as DTS. Not all OLE DB providers are compliant
with DTS. For example, some OLE DB providers are not thread safe,
but report that they are. You can use an OLE DB provider test kit to
test OLE DB provider compliance.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 16: Deploying an OLAP Solution vii

Module Strategy
Use the following strategy to present this module:
! Introducing DTS
Begin by defining DTS and describing the tasks that it can perform. Define
a package as a collection of tasks—a data connection task, a data
transformation task, assorted processing tasks, and precedence constraint
tasks. Describe each type of task in detail. Introduce the DTS Designer,
explaining how to access it and describing the various areas of the interface.
Explain the steps involved in creating a package—defining a data source,
defining a transformation, and adding DTS tasks.
! Executing and Scheduling Packages
Explain to students that, after creating a package, they then define when and
how often to run the package. Describe the various ways to execute a
package. Finally, describe how to schedule a package, emphasizing that the
SQL Server Agent must be running for a scheduled package to execute.
! The Analysis Services Processing Task
Define the OLAP Processing task and describe when and how to use it. List
the various objects that the OLAP processing task can process.
! Copying and Archiving OLAP Databases
Explain that copying and archiving OLAP objects are two administrative
tasks that can be very useful in the deployment of an OLAP application.
Describe how to perform a copy and paste in SQL Server 2000 Analysis
Services and list some uses of copy and paste. Finally, describe how to
create an archive of a database and how to restore an archived database.
Emphasize that you can only restore and archive databases, not other items
such as cubes or servers.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 16: Deploying an OLAP Solution 1

Overview
Topic Objective
To provide an overview of
the module topics and
objectives. ! Introducing DTS
Lead-in ! Executing and Scheduling Packages
In this module, you will learn
about various OLAP ! The Analysis Services Processing Task
deployment techniques.
! Copying and Archiving OLAP Databases

Automating cube processing, copying server objects, and moving databases


from testing to production environments are important steps that come at the
end of an online analytical processing (OLAP) application’s deployment phase.
In this module, you will learn the mechanics and techniques for all these
essential processes.
After completing this module, you will be able to:
! Describe the role of Data Transformation Services (DTS).
! Create a DTS package.
! Define an Analysis Services processing task.
! Copy, archive, and restore OLAP databases.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


2 Module 16: Deploying an OLAP Solution

# Introducing DTS
Topic Objective
To introduce DTS.
Lead-in
In this section, you will be
! Reviewing DTS
introduced to DTS and its ! Defining DTS
role in data movement and
transformations. ! Working with DTS Packages
! Using the DTS Designer

In the corporate world, you create and store data in many different formats,
platforms, and systems.
Microsoft® SQL Server™ 2000 DTS gives you the ability to move
heterogeneous data sources on a regular basis, performing transformations
along the way.
In this section, you are introduced to DTS and its role in data movement and
transformations.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 16: Deploying an OLAP Solution 3

Reviewing DTS
Topic Objective
To introduce DTS in the
Microsoft data warehousing
suite of products.
Lead-in
DTS is the feature of SQL
Server that moves and OLTP DTS DW DTS Analysis Services Clients
transforms data. Source Storage

! Transforming and Moving Data


! Scheduling DTS Tasks
! Automating OLAP Administrative Tasks

One important goal of corporate information processing is to centralize the data


so that analysts can compare and combine different data elements for analysis
purposes. To do so, companies are moving data into central repositories, data
warehouses, or OLAP databases. This movement of data occurs on a regular
basis. Therefore, it is appropriate to automate the transformation of data in
some way.
DTS is a feature built into SQL Server 2000 that moves and transforms data.
Features of DTS include:
! Transforming and moving data between heterogeneous data sources.
! Scheduling DTS tasks.
! Automating OLAP administrative tasks.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


4 Module 16: Deploying an OLAP Solution

Defining DTS
Topic Objective
To define DTS and describe
its use.
Lead-in ! Automates Processing of OLAP Cubes and Dimensions
DTS is a workflow ! Imports and Exports Data
application that is bundled
into SQL Server 2000. DTS ! Transforms Data
allows you to extract,
transform, and load data to ! Automates Imports, Exports, and Transformations of
and from multiple Databases
heterogeneous data
sources. ! Executes Packages
! Transfers Database Objects

DTS is a workflow application that is bundled into SQL Server 2000. DTS
allows you to extract, transform, and load data to and from multiple
heterogeneous data sources.
By using DTS, you can:
! Automate the processing of OLAP cubes and dimensions.
! Import and export data between multiple data sources.
! Transform data between data sources by using simple copies or customized
transformation scripts.
! Automate the imports, exports, and transformations of databases.
! Define the imports, exports, and data transformations as packages that can
be used repeatedly.
! Transfer database objects, such as views, indexes, and stored procedures,
between SQL Server 2000 databases.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 16: Deploying an OLAP Solution 5

Working with DTS Packages


Topic Objective
To describe the various
types of tasks in DTS
packages. ! Data Connection Task
Lead-in ! Data Transformation Tasks
A package is a collection of
database tasks created in ! Assorted Processing Tasks
DTS and saved for future
use. It is the primary object ! Precedence Constraint Tasks
created and used in DTS.

A package is a collection of database tasks created in DTS and saved for future
use. It is the primary object created and used in DTS. In a package, you define
the following tasks:
! Connections to your data source and data destination.
! Transformations defining data movement and manipulation.
! Assorted processing tasks.
! Task processing precedence constraints.

Data Connection Task


The data source is an OLE DB or open database connectivity (ODBC) database
or file from which you are pulling data. The data destination is the OLE DB or
ODBC database or file to which you are moving data. For databases requiring
passwords and security information, you define the security information here in
the connection.
DTS supports many different OLE DB and ODBC data sources:
! SQL Server 2000
! SQL Server 7.0 and SQL Server 6.5
! Oracle
! Microsoft Access 2000
! Microsoft Excel 2000
! Text files
! dBase, Paradox, and other third-party vendors
Each data source type has a corresponding icon in the DTS Designer. Assigning
a database or file as a data source or destination is as simple as dragging the
appropriate icon from the tool palette in DTS Designer to the workspace.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


6 Module 16: Deploying an OLAP Solution

Data Transformation Tasks


In a transform task, you must define the data source, data destination, and any
transformations or cleansing operations applied to the data.

Tip DTS has Import and Export wizards accessed through the Enterprise
Manager or through an executable file. The wizards take you step by step
through the process of importing and exporting data from data sources to data
destinations. For more information, refer to the DTS online documentation.

DTS contains an extensive library of Component Object Model (COM) objects


that give you the ability to provide custom data transformations. However, if
you require only simple transformations, DTS provides built-in transformation
options that require no code.
The following are the transformation options available to you:
! Source. Defines the table containing the source of the data to be
transformed. You can also define a SQL query whose results are the data
source.
! Destination. Defines the destination table of your data transformation. Here
you can define an existing table in your destination data source or you can
create a new table.
! Transformations. Define which columns from the data source map to the
columns from the data destination. By default, the column mapping copies
the data. However, you can define a Microsoft ActiveX® script or a custom
transformation that contains manipulations more complex than simple
copies.

Note Defining an ActiveX script is simplified by the use of the ActiveX


Script Transformation Properties dialog box. In this dialog box, you
select from either of two scripting languages—Microsoft Visual Basic®
Scripting Edition (VB Script) or Microsoft JScript®.

! Advanced Transformation Settings. Define error-handling options, such as


exception report file location, and establish settings to optimize your data
transformation.

Assorted Processing Tasks


Other processing tasks that you can define include:
! The delivery of e-mail—for example, notifying the database administrator
of a data load problem.
! The execution of SQL statements.
! The processing of an executable or batch script.
! The running of an ActiveX script.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 16: Deploying an OLAP Solution 7

DTS has a variety of built-in tasks that you can create in a package:
! ActiveX Script Task
! Execute Process Task
! Execute SQL Task
! Data Driven Query Task
! Transfer SQL Server Objects
! File Transfer Protocol (FTP) Task
! Execute Package Task
! Send Mail
! Bulk Insert
! Analysis Services Processing Task
! A custom task, created with languages such as Visual Basic or Microsoft
Visual C++®
An icon in the DTS Designer identifies each task. Assign a task by simply
dragging the appropriate icon from the tool palette in the DTS Designer to the
workspace.

Precedence Constraint Tasks


It is not only important to perform a series of tasks, but also to perform the
tasks in an appropriate order. Some tasks are precedence constrained—for
example, if a package must send an e-mail message following a successful data
load, you want to ensure that the e-mail is sent after the successful data load
and not before.
When using DTS packages, you have the ability to create precedence
constraints that define the sequential ordering of tasks. You can configure tasks
to execute following the completion, success, or failure of other tasks. You
create this workflow in the DTS Designer, the graphical interface used for
creating and maintaining packages.
The three types of precedence constraints that you can define are:
! On Completion. The second task waits for the first task to finish before
processing. The second task begins after the first task finishes, regardless of
whether the first task finishes successfully or fails.
! On Success. The second task waits for the first task to finish successfully
before processing. Finishing with success means that no errors occurred
during the processing of a task.
! On Failure. The second task processes only if the first task finishes with
errors.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


8 Module 16: Deploying an OLAP Solution

Using the DTS Designer


Topic Objective
To introduce the DTS
Designer and how it is used
in creating packages. ! Accessing the DTS Designer
Lead-in ! Defining Data Sources
Creating and managing
packages and tasks are ! Defining Transformations
made easy by using the
DTS Designer. ! Adding Tasks

The DTS Designer makes creating and managing packages and tasks easy.
Delivery Tip
Open Enterprise Manager, After you start Enterprise Manager, you access DTS from the tree view
and discuss each of the four immediately below the SQL Server node. From here, you have the ability to
topics as you talk students create and manage DTS tasks.
through the DTS Designer
interface.
Accessing the DTS Designer
To access DTS Designer, create or open a package from Enterprise Manager.
You will see the DTS Designer, which contains the following areas:
! The workspace is the area where connections, tasks, and transformations are
created and defined.
! Tool palettes allow you to easily define data sources and destinations as
well as processing tasks. Simply drag the appropriate icon to the workspace.
! The menu bar includes selections for general package and data
transformation tasks. You can choose to configure the data sources and
tasks of your packages from either the menu bar or the tool palettes.

Defining Data Sources


There are two ways to define the source and destination data sources. Drag the
appropriate icons from the data tool palette to the workspace, or select the
appropriate data source or destination from the Data menu.
After you select the appropriate OLE DB database or file, define the type and
location of the source or destination of the database. Depending on the
database, you update various properties for the data source, such as user name,
password, file name, and so on.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 16: Deploying an OLAP Solution 9

Defining Transformations
To transform data between data sources, click Task, click Transform Data
Task, and then click the data source and the data destination.

Tip Verify that your data sources have been defined and configured before
creating a data transformation.

After you add the transform successfully, an arrow will connect the data sources
and will point in the direction that data is moving. You can right-click the
transform arrow to define the data transformation properties.

Adding Tasks
There are two ways to define tasks in a DTS package—drag the appropriate
icons from the task tool palette to the workspace, or click the appropriate task
from the Task menu.
Depending on the task added to the workspace, you configure the task
immediately after adding it to the package. After you originally define a task,
you modify its configuration by right-clicking the task and clicking Properties.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


10 Module 16: Deploying an OLAP Solution

Executing and Scheduling Packages


Topic Objective
To explain how to execute
and schedule packages.
Lead-in ! Executing a Package
After you create and save a ! Scheduling a Package
package, you define when
and how often to run the
package.

After you create and save a package, you then define when and how often to
Delivery Tip run the package. Right-click the package from Enterprise Manager to either
Open Enterprise Manager
and discuss executing and
execute the package immediately or schedule the package to execute at a future
scheduling packages as you or regularly scheduled time.
talk students through the
interface. Executing a Package
When you execute a package, you perform all transformations and tasks defined
in the package, connecting to the configured data sources, and ordering the
Key Point tasks based upon any defined precedence constraints.
A scheduled DTS package
is executed by the SQL You execute a package in the DTS Designer by either clicking the Execute
Server Agent service as a button on the toolbar or by clicking the Package menu and clicking Execute.
job. The SQL Server Agent
must therefore be running You execute a package in Enterprise Manager by right-clicking the package and
for the scheduled packages then clicking Execute Package. The package processes at that moment and a
to execute. dialog appears giving you the status of the package after processing completes.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 16: Deploying an OLAP Solution 11

Scheduling a Package
In a production environment, it is common for loading and transformation tasks
to be performed the same way each time they are executed. It is often important
to automate these regular tasks on an ongoing basis.

Note The SQL Server Agent service executes a scheduled DTS package as a
job. The SQL Server Agent must be running for the scheduled packages to
execute.

You automate a package in DTS by right-clicking the package and clicking


Schedule Package. You see the Edit Recurring Job Schedule interface. You
define the scheduling of the package in this dialog.
Notice that you can define the job on a daily, weekly, or monthly basis. In
addition, on the days the job is scheduled to run, you can define the frequency
of the job. Finally, you can define the start and end dates of the job’s
scheduling.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


12 Module 16: Deploying an OLAP Solution

# The Analysis Services Processing Task


Topic Objective
To introduce the Analysis
Services Processing Task.
Lead-in ! Defining the Analysis Services Task
The Analysis Services ! Selecting an Object to Process
Processing task gives you
the ability to create and
execute DTS packages that
process your OLAP
databases, cubes, and
dimensions.

The Analysis Services Processing Task—referred to as the Analysis Services


task for the rest of the module—gives you the ability to create and execute DTS
packages that process your OLAP databases, cubes, and dimensions.
You access the Analysis Services Processing Task in the DTS Designer. To use
the Analysis Services Processing task, you must install SQL Server 7.0 or SQL
Server 2000, including SQL Server Enterprise Manager, as well as Analysis
Manager on the server computer on which you want to execute the package
containing the task.
The Analysis Services Processing Task enables you to take advantage of all the
DTS functionality while integrating your OLAP databases into a production
environment.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 16: Deploying an OLAP Solution 13

Defining the Analysis Services Task


Topic Objective
To explain how to use the
Analysis Services task.
Lead-in
To create an Analysis
Services task, simply drag
the cube icon to the
workspace in DTS Designer.

To create an Analysis Services task, simply drag the cube icon to the workspace
in DTS Designer.
After dragging the Analysis Services Processing task icon to the DTS Designer
workspace, you see the dialog in the preceding illustration. Select the object
that you want to process, and the type of processing that you want applied to the
selected Analysis Services object.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


14 Module 16: Deploying an OLAP Solution

Selecting an Object to Process


Topic Objective
To show the wide range of
objects that can be
processed by an Analysis ! Database ! Virtual Dimension
Services task.
! Cube ! Mining Model
Lead-in
The Analysis Services task ! Partition ! Server Object Folders
can process many different
objects or folders. ! Virtual Cube $ Cubes Folder
$ Dimensions Folder
! Shared Dimension
$ Mining Models Folder

The Analysis Services Processing task can process any of the following objects
or folders:
! A database, including all cubes, partitions, virtual cubes, dimensions, and
mining models in the database.
! A cube.
! A partition.
! A virtual cube.
! A shared dimension.
! A virtual dimension.
! A mining model.
! Server object folders:
• The Cubes folder that includes all cubes and virtual cubes.
• The Dimensions folder that includes all shared and virtual dimensions.
• The Mining Models folder that includes all data mining models.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 16: Deploying an OLAP Solution 15

Demonstration: Creating a Package


Topic Objective
To demonstrate how to
create a DTS package.
Lead-in
In this demonstration, you
will learn how to create a
DTS package.

In this demonstration, you will learn how to create a new package that
Delivery Tips processes the HR cube in the Foodmart 2000 database.
The steps for this
demonstration are included
in the Instructor Notes.

Tell students that they will


be performing the same
exercise themselves in the
next lab. If students follow
along with your
demonstration, tell them to
skip the identical procedures
in the lab.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


16 Module 16: Deploying an OLAP Solution

Lab A: Creating a Package


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will create a
DTS package that
processes the HR cube in
the Foodmart 2000
database.

Explain the lab objectives. Objectives


After completing this lab, you will be able to:
! Create a package.
! Define an Analysis Services Processing Task.
! Save a package.
! Execute a package.
! Schedule a package.

Estimated time to complete this lab: 15 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 16: Deploying an OLAP Solution 17

Exercise 1
Creating a New Package
In this exercise, you will create a new package that processes the HR cube in
the Foodmart 2000 database.

! To create a DTS package


1. Click Start, point to Programs, point to Microsoft SQL Server, and then
click Enterprise Manager.
2. Expand Microsoft SQL Servers, expand SQL Server Group, expand the
local server, and then expand the Data Transformation Services folder.
3. Right-click Local Packages, and then click New Package.
The DTS Designer appears. This is where you design the tasks that you
want to automate.
4. Click the Package menu, and then click Save.
5. Type OLAP Update as the name of the package, and then click OK.

! To create an Analysis Services Processing Task


1. Drag the Analysis Services Processing Task icon from the Task tool
palette onto the DTS Designer workspace.
The Analysis Services Processing Task dialog box appears.
2. In the Description box, type Process HR Cube.
3. Select the Local server checkbox at the bottom of the dialog box.
You can use the OLAP Update package on any SQL Server 2000
computer, because you are not saving the server name in the package.
Instead, you assign the server as LOCALHOST.
4. In the tree view on the left side of the dialog box, expand LOCALHOST,
expand Foodmart 2000, expand the Cubes folder, and then click the HR
cube.
Notice the processing options available for cubes on the right side of the
dialog box.
5. Click Refresh data, and then click OK.
You created an Analysis Services Processing Task that refreshes the HR
cube in the Foodmart 2000 database.

! To execute the package


1. On the DTS Designer toolbar, click Execute.
2. Click OK, and then click Done after the package finishes processing.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


18 Module 16: Deploying an OLAP Solution

! To define a precedence constraint


1. From the DTS Designer Task tool palette, click Execute Process Task.
The Execute Process Task Properties dialog box opens.
2. Type Command Script in the Description box.
3. Click the file C:\Moc\2074A\Labfiles\L16\CMDScript.cmd, click Open,
and then click OK.
4. Click the Process HR Cube task, and press the CTRL key as you click the
Command Script task.

Important The order in which you select the two tasks is critical to setting
up the precedence constraints properly.

5. Click the Workflow menu, and then click Failure.


A red-striped arrow appears showing the relationship between the two tasks.

! To save and schedule a DTS package


1. Close the DTS Package window, and then click Yes when prompted to save
the package.
2. In the Enterprise Manager window, click Local Packages, right-click the
OLAP Update package, and then click Schedule Package.
3. Click OK if Enterprise Manager warns you that the SQL Server Agent is
stopped.
4. In the Edit Recurring Job Schedule dialog box, click the Daily option in
the Occurs group, and click 7:00 PM in the Occurs Once At box.
5. Click OK to schedule the task.
The scheduled task becomes a SQL Server Agent job. To edit or delete the
schedule, you must go into the SQL Server Agent folder.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 16: Deploying an OLAP Solution 19

# Copying and Archiving OLAP Databases


Topic Objective
To introduce the concepts of
copying and archiving OLAP
databases. ! Copying and Pasting Objects
Lead-in ! Archiving and Restoring Databases
Some commonly used
administrative functions are
copying and pasting objects,
and archiving and restoring
databases.

In Analysis Manager, you can perform basic administrative functions used in


the deployment of an OLAP application. Some commonly used functions are
copying and pasting objects, and archiving and restoring databases.
In this section, you will learn about these two administrative functions and the
role they play in OLAP application deployment.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


20 Module 16: Deploying an OLAP Solution

Copying and Pasting Objects


Topic Objective
To describe how to copy
! Performing a Copy and Paste
and paste OLAP objects in $ Right-click the object
Analysis Manager.
Lead-in
$ Paste the object to the correct folder
You move various Analysis ! Exposing Copy and Paste
Server objects from one
location to another by using $ Can copy metadata, but not data
the copy and paste
commands in Analysis $ Can copy dependent objects, such as data sources
Services.
! Using Copy and Paste
$ Rename an object
$ Create database snapshots
$ Move objects to different servers

You move various Analysis Server objects from one location to another by
using the copy and paste commands in Analysis Services. You can move
objects in databases, between databases, and even between servers.

Performing a Copy and Paste


You move an object in Analysis Manager by performing the following steps:
1. Right-click the object and click Copy.
2. Right-click the target location and click Paste.
The target location must be of the same type as the object you are pasting. For
example, you cannot successfully copy and paste a cube to a dimension folder.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 16: Deploying an OLAP Solution 21

Exposing Copy and Paste


When you perform a copy and paste of an object in Analysis Manager, you
need to understand what is happening on the Analysis Server:
! The Analysis Server copies the metadata of the object between the source
and target locations.
! The Analysis Server does not copy cube data or dimension data. Therefore,
you must always process dimensions and cubes after you copy them
between locations.
! Some objects that you copy and paste require other objects to be copied
along with them. For example, if you copy a cube to a database, all shared
dimensions, data sources, and other cube objects are copied with the cube if
they do not already exist in the target database.
! The copied objects need to access the same data source before you can
process them in the new location. Therefore, verify that the new location
can access the data source.
! You can only copy objects in a single instance of an Analysis Manager
session—you cannot copy an object in Analysis Manager, close Analysis
Manager, reopen it, and paste the object back into Analysis Manager.

Using Copy and Paste


The following are some uses of copy and paste that may not be immediately
obvious:
! Rename an object. You cannot explicitly rename cubes, dimensions, or most
other OLAP objects. However, you can perform a rename by using copy
and paste:
a. Copy the object.
b. Paste the object, giving it a new name. You can copy an object, such as a
cube, to the same folder or database, assuming that you give the object a
different name.
c. Delete the original object.
! Create database snapshots. You can copy cubes and dimensions to other
locations to preserve the state of the objects at a particular point in time.
For example, you may want to save historical dimension data, but only for
emergency purposes. You can save a copy of the cube or database in the
state you want to preserve, without disturbing the original cube.
! Move objects to different servers. You can copy and paste objects across
servers. You simply need to have the appropriate servers open in Analysis
Manager in the Analysis Servers folder below the console root.
This is a very common scenario when moving an OLAP application from a
development server to a testing server or to a production server.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


22 Module 16: Deploying an OLAP Solution

Archiving and Restoring Databases


Topic Objective
To explain how to archive
and restore databases in ! You Archive and Restore Databases By Using Either of
Analysis Manager. Two Methods:
Lead-in $ Analysis Manager
To back up OLAP
databases on your Analysis $ Msmdarch command
Server, you can create
archives by using the ! Archives and Restores Are Performed on Databases
Archive command in
Analysis Manager.
$ Not cubes or servers
! Archives Create *.cab Files
! Restores Reference *.cab Files
! Data Source Backups Must Be Performed Separately

To back up OLAP databases on your Analysis Server, you can create archives
Delivery Tip by using the Archive Database command in Analysis Manager. You can also
Point out to students that
they have been working with
use the msmdarch command from a command prompt or a batch script.
archived databases in many Archive a database in Analysis Manager by right-clicking the database, clicking
modules in course 2074A,
Archive Database, and selecting the location where you want the archive
Designing and Implementing
OLAP Solutions with
saved. You must also name the archive files created. Each database archive is
Microsoft SQL Server 2000. made up of one or more *.cab files.
You can also archive a database by using the msmdarch command included in
the Analysis Services installation. By default, the msmdarch.exe command file
exists in the C:\Program Files\Analysis Services\Bin directory. You can either
type msmdarch with appropriate switches at the command prompt, or you can
include the appropriate syntax in a batch script. If you include the command in
a batch script, you can then execute the script by using DTS to automate the
archiving of your OLAP databases.

Tip To open the MSMD Archive Shell dialog box that contains proper
msmdarch command usage and syntax, type the following syntax at a command
prompt at the C:\Program Files\Analysis Services\Bin directory:
msmdarch /?

You can only archive database objects. You do not have the ability to archive
lower or higher level objects, such as cubes or servers.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 16: Deploying an OLAP Solution 23

To restore a database from an archive, simply right-click the server to which


you want to restore the database, and click Restore Database. You then must
point to the archive *.cab that contains the archived database.

Caution When you archive an OLAP database, you are archiving only the
OLAP database definitions and metadata, along with the cube data at that point
in time. You are not archiving the source data that builds the cube and the
dimensions in the cube. To archive the source data, refer to your relational
database management system (RDBMS) documentation.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


24 Module 16: Deploying an OLAP Solution

Review
Topic Objective
To reinforce module
objectives by reviewing key
points. ! Introducing DTS
Lead-in ! Executing and Scheduling Packages
The review questions cover
some of the key concepts ! The Analysis Services Processing Task
taught in the module.
! Copying and Archiving OLAP Databases

1. What are some data sources supported by DTS?


Any OLE DB/ODBC data source, such as Access, Excel, Microsoft
FoxPro®, SQL Server, Dbase, Paradox, DB2, AS/400, and text files.

2. How do you assign a database or file as a data source or a data destination in


a DTS package?
In the DTS Designer, click Task, and then click Transform Data Task.
You are then prompted to select the source and the destination data
sources.

3. What must be running in order for scheduled DTS tasks to execute?


SQL Server Agent.

4. Name two ways of moving an OLAP database from a development server to


a production server.
Perform a copy and paste of the OLAP database.
Archive the OLAP database on the development server, and then
restore the *.cab file on the production server.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 17: Introduction
to Data Mining

Contents

Overview 1
Introducing Data Mining 2
Training a Data Mining Model 12
Building a Data Mining Model with
OLAP Data 13
Browsing the Dependency Network 23
Lab A: Creating a Decision Tree with
Relational Data 27
Review 32
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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 17: Introduction to Data Mining iii

Instructor Notes
Presentation: This module introduces students to data mining and explains how to build and
40 Minutes browse data mining models by using Microsoft® SQL Server™ 2000 Analysis
Services. Students will learn fundamental data mining terminology, concepts,
Lab: techniques, and algorithms.
20 Minutes
This is an overview module that focuses on the use of built-in Analysis
Manager wizards. It is not intended to provide in-depth knowledge of data
mining.
After completing this module, students will be able to:
! Describe data mining characteristics, applications, and modeling techniques.
! Describe the process of training a model.
! Use the online analytical processing (OLAP) Mining Model Wizard to edit,
process, and explore the decision trees.
! Analyze relational data relationships in the dependency network browser.
! Describe the steps required to build a clustering model by using OLAP data.

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 Microsoft PowerPoint® file 2074A_17.ppt.

Preparation Tasks
To prepare for this module, you should:
! Read all the materials for this module.
! Read the instructor notes and margin notes.
! Practice combining the lecture with the demonstrations.
! Complete the lab.
! 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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


iv Module 17: Introduction to Data Mining

Demonstration: Determining Why Students Attend College


The following demonstration procedures provide information that will not fit
Demonstration: in the margin notes or is not appropriate for student notes.
10 Minutes
In this demonstration, you will create a data mining model by using a decision
tree with relational data. Specifically, you will create a decision tree that
determines why students attend college.
You will create a new OLAP database with a data source connecting to the
Module 17 relational database.

! To create an OLAP database


1. In Analysis Manager, expand the Analysis Servers folder, right-click your
local server, and then click New Database.
2. Enter Module 17 as the database name, and then click OK.
3. Expand the Module 17 database, right-click the Data Sources folder, and
then click New Data Source.
4. On the Provider tab of the Data Link Properties dialog box, click
Microsoft OLE DB Provider for SQL Server. Click Next.
5. Type localhost in Step 1.
6. In Step 2, click Use Windows NT Integrated security.
7. In Step 3, click Module 17 from the list of databases. Click OK.

! To create the data mining model


In this procedure, you will create the data mining model by selecting source,
case table, data mining technique, and key column.
1. In the Module 17 database, right-click the Mining Models folder, and then
click New Mining Model.
2. At the welcome page, click Next.
3. From the Select source type step of the Mining Model Wizard, click
Relational data, and then click Next.
Point out that either relational tables or OLAP cubes can be used as source
data. For this model, you are accessing relational data.
4. From the Select case tables step, in the Available tables list, click College
Plans, and then click Next.
5. From the Select data mining technique step, in the Technique list, click
Microsoft Decision Trees, and then click Next.
Two algorithms ship with Analysis Services: Microsoft Decision Trees and
Microsoft Clustering. Use the Decision Trees algorithm for this
demonstration.
6. From the Select the key column step, in the Case key column list, click
StudentID, and then click Next.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 17: Introduction to Data Mining v

! To select input and predictable columns for the mining model


1. From the Select input and predictable columns step of the Mining Model
Wizard, in the Available columns list, click CollegePlans at the bottom of
the column list.
2. Click the top arrow (>) to choose CollegePlans as a predictable column.
3. In the Available columns list, click Gender, and then click the bottom
arrow (>) to choose that column as an input column.
4. In the Available columns list, click ParentIncome, and then click the
bottom arrow (>) to choose that column as an input column.
5. In the Available columns list, click IQ, and then click the bottom arrow (>)
to select that column as an input column.
6. In the Available columns list, click ParentEncouragement, and then click
the bottom arrow (>) to select that column as an input column. Click Next.

! To finish the Mining Model Wizard


In this procedure, you name the model, initiate processing and then close the
wizard.
1. From the Finish the mining model wizard step, in the Model name box,
type CollegePlans.
2. Click Finish to create and process the model.
3. When the model has completed processing, click Close to close the Process
dialog box.

! To explore data in the decision tree


1. In the Relational Mining Model Editor, click the Content tab.
2. In the Content Detail pane, click the All node.
View the Totals tab of the Attributes pane, and point out that more than 67
percent of the students interviewed do not plan to attend college.
3. Click the Parent Encouragement = Encouraged node.
Point out to the students that parental encouragement is the most dominant
attribute in this model. More than 57 percent of students that are encouraged
by their parents plan to attend college.
4. Click Parent Encouragement = Not Encouraged.
Fewer than 7 percent of students who are not encouraged by their parents
plan to attend college.
5. Close the Relational Mining Model Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


vi Module 17: Introduction to Data Mining

Module Strategy
Use the following strategy to present this module:
The structure of this module is multiple demonstrations showing students how
to build and browse various types of data mining models. Except for the first
example about students attending college, the demonstrations are documented
directly in the student manual. Integrate your lecture with live demonstration
following the procedures included in the student notes. Encourage students to
follow along with your demonstrations on their computers. Some students may
choose to watch your demonstrations only, which is also acceptable.
! Introducing Data Mining
The case study introduces students to data mining. Data mining may be new
to many students and should be described in very simple terms highlighting
the business application and uses. Emphasize to students why this
technology is useful and complementary to the other forms of analysis they
have been exposed to. Then describe the various data mining techniques that
are available.
! Training a Data Mining Model
Describe the process required to create a data mining model. Define training
data and cases.
! Building a Data Mining Model with OLAP Data
Introduce students to the membership card scenario. Use the membership
card scenario to step students through the process of building a data mining
model with OLAP data by using the Mining Model Wizard. Describe each
step in the process—selecting the data mining technique, selecting the case,
selecting the training data, creating a dimension and virtual cube, and
browsing the data mining model.
! Browsing the Dependency Network
Demonstrate how to browse the dependency network. Explain that the
Dependency Network Browser can be used to view all the relationships in
your model.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 17: Introduction to Data Mining 1

Overview
Topic Objective
To provide an overview of
the module topics and
objectives. ! Introducing Data Mining
Lead-in ! Training a Data Mining Model
In this module, you will learn
about data mining, how data ! Building a Data Mining Model with OLAP Data
mining can be used to
address business ! Browsing the Dependency Network
application requirements,
and how to create data
mining models by using the
Analysis Manager.

This module provides you with an introduction to Microsoft® SQL Server™


2000 Analysis Services Data Mining.
The objective of the module is to introduce you to both data mining principles
and applications while exploring the Analysis Services wizard-driven interface
for creating data mining models.
After completing this module, you will be able to:
! Describe data mining characteristics, applications, and modeling techniques.
! Describe the process of training a model.
! Use the online analytical processing (OLAP) Mining Model Wizard to edit,
process, and explore the decision trees.
! Analyze relational data relationships in the dependency network browser.
! Describe the steps required to build a clustering model by using OLAP data.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


2 Module 17: Introduction to Data Mining

# Introducing Data Mining


Topic Objective
To introduce the concept of
data mining.
Lead-in ! Defining Data Mining
In this section, you will be ! Data Mining Applications
introduced to a simple case
study example. In that ! Data Mining Models
example, data mining will be
defined, common ! Introductory Example
applications and techniques
discussed, and its role in the ! Exploring the Decision Tree
data warehouse explored.

This section introduces data mining concepts, including:


! Defining data mining.
! Discussing how data mining can be applied to solve common business
applications.
! Describing what data mining models are available.
! Presenting a simple example of how data mining can be used.
! Exploring the decision tree.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 17: Introduction to Data Mining 3

Defining Data Mining


Topic Objective
To provide a definition of
data mining.
Lead-in ! Is The Process of Deducing Meaningful Patterns and
Data mining provides a Rules from Large Quantities of Data
means by which the system
deduces knowledge from
! Searches for Patterns in Data Rather than Answering
the data by identifying Predefined Questions
correlations and other
patterns in the data.
! Is Used To:
$ Provide historical insights
$ Predict future values or outcomes
$ Close the loop for analysis

In many organizations, data volumes are so large that it is difficult, even for the
most seasoned analyst, to identify the key information most relevant to
managing the business.
Data mining is the automatic or semi-automatic process of deducing meaningful
patterns and rules from large quantities of data. These patterns provide valuable
insights to business managers and offer information that may be overlooked by
more traditional manual methods of analysis.
Data mining programs search for patterns in data rather than answer predefined
questions. Because of this, they can be used for knowledge discovery in
addition to hypothesis testing.
Data mining is used to:
! Provide insight into historical data.
! Predict future values or outcomes based on historical patterns.
! Close the analysis loop by taking action based on the information derived
from the analysis.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


4 Module 17: Introduction to Data Mining

Data Mining Applications


Topic Objective ! Advertising on the Internet
To identify different
applications for data mining. $ “What banner will I display to this visitor?”
Lead-in
Data mining is used for a $ “What other products is this customer likely to buy?
variety of different
! Detecting Fraud
applications. We are now
going to talk about some $ “Is this insurance claim a fraud?”
common uses.
! Pricing Insurance
$ “How much of a discount will I offer to this customer?”
! Managing Credit Risk
$ “Will I approve the loan for this customer?”

Data mining techniques are used in a variety of applications. This section


Delivery Tips provides some interesting examples.
Incorporate your own
examples of how data
mining is used to solve Advertising on the Internet
business problems. Ask You can use data mining to classify groups of customers with similar
students for examples from
information into segments for targeting advertising or special offers.
their businesses.
Following are two Internet customer examples:
Point out that data mining is
no longer an art used by just ! An e-commerce Web site sells sporting equipment. When a customer
PhDs. This technology is registers, a database management system collects information about the
available and useful to a customer, such as gender, marital status, favorite sport, and age.
variety of businesses.
By using data mining techniques, the Web site displays a masculine banner
ad with a golfing motif for the male, golf-loving, 40-year-old who returns to
the Web site after registering.
! When you purchase merchandise on the Internet, you are sometimes offered
additional merchandise that the Web site predicts you might be interested
in—for example, a book similar to the one you are currently purchasing.
Such recommendations are based on data mining techniques that search out
purchase patterns of customers who purchased the same book you are now
buying. The system recommends: “If you like xyz books, check out the
additional books below.”

Detecting Fraud
You can use a data mining system to identify characteristics of suspicious
insurance claims by analyzing characteristics of legitimate and fraudulent
claims. For example, specific types of injuries that are difficult to diagnose,
such as neck and back injuries, may be more likely candidates for a fraudulent
claim.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 17: Introduction to Data Mining 5

Pricing Insurance
In the insurance industry, you use data mining techniques to analyze historical
data such as age, marital status, gender, and driving history. All these factors
play a role in predicting the likelihood of a specific driver for getting into an
automobile accident. Data mining techniques help you to weigh and factor these
data points into pricing for an individual insurance policy.

Managing Credit Risk


When you apply for a loan, the bank collects a broad range of information about
you—for example, income, years of employment at a current job, marital status,
and credit standing.
By using data mining techniques applied to historical loan application
information, the bank can predict whether you are a good or bad credit risk and
can use this information when deciding on loan approval.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


6 Module 17: Introduction to Data Mining

Data Mining Models


Topic Objective
To describe different data
mining models and how they
apply to data analysis. ! Analysis Services Models
Lead-in $ Microsoft Clustering
A variety of data mining
models are available. These $ Microsoft Decision trees
techniques represent
different approaches to ! Other Models
classification and prediction.
$ Market basket analysis (affinity grouping)
$ Memory-based reasoning
$ Neural networks

Several data mining techniques are available that you can use to identify the
Delivery Tip patterns in large volumes of data. You use different data mining techniques for
Do not spend much time
describing the different
different types of applications. In this section, you will learn the most common
models. Simply discuss that data mining techniques and when to apply them.
various models are available
for analysis and that Analysis Services Models
Microsoft provides two of
the models in Analysis
Analysis Services includes two data mining techniques—Microsoft Clustering
Services. and Microsoft Decision Trees.

Clustering
You use the clustering technique, sometimes called K-nearest neighbor, to
group data records that are similar to each other. You often use this common
technique as the starting point for market or customer analysis.
For example, you may want to segment your market so that you can offer
customized programs and pricing to specific customer groups. With clustering,
you can segment your customers into groups with similar characteristics.

Decision Trees
Decision trees are a popular method for both classifying and predicting. By
using a series of questions and rules to categorize data cases, you can predict
the likelihood of certain types of cases having a specific outcome.
For example, insurance companies use a decision tree to predict the likelihood
of high claims by analyzing statistical data organized by a set of rules that help
predict the likelihood of high claims.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 17: Introduction to Data Mining 7

Other Models
Analysis Services provides two types of data mining models—clustering and
decision trees. However, users may define their own models or use other
proprietary data mining algorithms. Common data mining models include
market basket analysis, memory-based reasoning, and neural networks.

Market Basket Analysis (Affinity Grouping)


Market basket analysis, sometimes called affinity grouping, is used for finding
groups of items that occur frequently together in a single transaction.
For example, customers who buy gin may also purchase tonic water, which is a
frequent accompaniment. Customers who buy potato chips frequently buy
potato chip dips on the same shopping trip. Understanding when products sell
together helps a retail store manage placement of items on shelves to maximize
affinity group purchases.

Memory-Based Reasoning
Memory-based reasoning (MBR) is a directed data mining technique that is
used for prediction and classification. MBR analyzes a collection of the known
instances of the nearest neighbor and from that information makes predictions
about unknown instances.
For example, if a patient exhibits a series of symptoms, doctors apply their
experience with similar patients to diagnose the current case. The doctors
perform their diagnoses by using a form of MBR.

Neural Networks
Just as a human can learn from experience, so can computers. Neural networks
model the neural connections in a human brain and thereby simulate learning.
If you assemble data where the input and output factors are both known, the
computer can “learn” from those patterns and set up rules and mathematical
factors to help calculate or predict the output value.
Suppose you want to sell your car. Several factors affect the sales price, such as
the age of the car, its condition, its manufacturer and model, and so forth.
Analyzing historical car prices, the neural network can create a series of input
and output factors to predict the sales price.

Summary of Models
The following table defines commonly used data mining models and their
typical usages.
Technique Typical usage
Clustering (K-nearest neighbor) Classification
Decision trees Classification and prediction
Market basket analysis (affinity Clustering or affinity grouping
grouping)
Memory-based reasoning Classification and prediction
Neural networks Classification, prediction, and clustering

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


8 Module 17: Introduction to Data Mining

Introductory Example
Topic Objective
To introduce an example of Why Do High School Students Attend College?
how data mining can be
used for prediction.
Lead-in
What do you think is the
principal attribute for
predicting whether students
attend college? What, if
anything, can you conclude
from the information in the
table?

A survey was conducted recently in the United States asking high-school


Delivery Tips seniors to answer the following five questions:
Browse the actual relational
table data when discussing 1. What is your gender?
the case study. You can find
the CollegePlans table in 2. What is your parents' income?
the Module 17 SQL Server 3. What is your IQ?
2000 database.
4. Do your parents encourage or not encourage you to go to college?
Ask students what they think
5. Do you plan to attend college?
are the most dominant
attributes that will predict Data from the survey was compiled into a table shown in the preceding
whether a student plans to
illustration.
attend college.
Glancing at the table, you cannot easily determine how many students plan to
attend college and how many do not. You can see that roughly 50 percent will
attend based on the first 22 records of this file. This result may or may not be
representative of the whole set of 9,000 cases.
To determine how many students plan to attend college, you can execute a
query that counts students grouped by those planning on attending and those not
planning on attending.
Suppose you are interested in determining the attribute or combination of
attributes that have the highest potential of predicting the likelihood of a student
for attending college. This is a more complex question and involves segmenting
the data based on various attributes you collect.
To answer the question, you can spend several hours exploring the data
manually, or you can use data mining to explore the data automatically.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 17: Introduction to Data Mining 9

Demonstration: Determining Why Students Attend College


Topic Objective
To demonstrate how to
create a data mining model
by using a decision tree with
relational data.
Lead-in
In this demonstration, you
will learn how to create a
decision tree that
determines what causes
students to attend college.

In this demonstration, you will create a data mining model by using a decision
Delivery Tips tree with relational data. Specifically, you will create a decision tree that
The steps for this
demonstration are included
determines what causes students to attend college.
in the Instructor Notes.

Encourage students to
follow your demonstration
on their computers.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


10 Module 17: Introduction to Data Mining

Exploring the Decision Tree


Topic Objective All Students
To demonstrate how data
Attend College:
mining is applied by using a 33% Yes
decision tree. 67% No
Lead-in Parental
Looking at all the students Parents Encourage = Yes Parents Encourage = No
Encouragement ?
interviewed, roughly 33
Attend College: Attend College:
percent plan to attend and 57% Yes 6% Yes
the remaining do not plan to 43% No 94% No
attend. High IQ
IQ IQ
Attend College:
18% Yes Low IQ
82% No
Attend College:
High IQ Low IQ Medium IQ 4% Yes
Attend College: Attend College: Attend College: 96% No
74% Yes 29% Yes 9% Yes
26% No 71% No 91% No

Applying a decision tree algorithm to the survey data, the following


Delivery Tips relationships are discovered:
After switching to the slide,
ask students the following ! Of students surveyed, 32.68 percent plan to attend college. The remaining
question: Of the collected students do not plan to attend.
attributes, which do you
think is most likely to have ! The most dominant attribute in predicting whether a student is likely to
an impact on a student’s attend college is whether their parents encourage them to attend.
decision to attend college?
Tip The most dominant attribute is always the first rule in the decision tree.
Then use the build slide to
step through the results.
! Students who received encouragement from their parents had a 57.27
Switch to Analysis Manager percent probability of planning to attend. This is much higher than the
to show the same results in general population. Of the students who were encouraged by their parents:
the Relational Mining Model
Editor. • Those with an IQ higher than 110.25 had more than a 74 percent
probability of attending college.
• Those who also had parents with a high income were even more likely to
attend college—77 percent.
! Students who did not receive encouragement had a very low probability,
6.22 percent, of planning to attend. Of the students who were not
encouraged by their parents:
• Those students with a very high IQ had a higher probability than those
with a lower IQ. Of students with an IQ higher than 118.25, 17.96
percent plan to attend versus 3.52 percent of students with an IQ lower
than 99.25.
• Parental income had no impact on the likelihood of planning to attend
college if the student were exceptionally smart with an IQ higher than
118.25.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 17: Introduction to Data Mining 11

This example demonstrates that data mining allows you to validate or discredit
specific hypothesis. Data mining also helps you identify patterns that you may
not expect or notice by analyzing the data manually.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


12 Module 17: Introduction to Data Mining

Training a Data Mining Model


Topic Objective
To explain the methodology
Data
for creating a mining model Training Data Mining Model To Predict
and to define terminology.
Lead-in
When creating a data
mining model, you need a
training data set. This is
typically historical data DM DM
where the attributes to be Engine Engine
predicted are known.

Mining Model Predicted Data

To create a model, you must assemble a set of data where the attributes to be
Delivery Tip predicted are known. Such a data set is called the training data. During the
Use the build slide to
explain how Analysis Server
training process, data is inserted into the data mining model. The data mining
evaluates training data to model analyzes the training data and looks for rules and patterns that can be
build a data mining model, used later to determine the predictive columns.
and then uses the model to
predict future outcomes
You perform training by processing the data mining model in Analysis
based on new data sets. Manager.
The training data has two characteristics:
! It is typically historical data.
! It is statistically representative of the cases for which you are building a
predictive model.
The case is the basic unit for analysis in the mining model. The case is the
element that is used for classifying and grouping the data.
As depicted in the preceding illustration, the data mining engine evaluates the
cases identified in the training data and creates the model based on the
algorithm selected. When the model is built, it can be applied to future data to
predict outcomes or classify data.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 17: Introduction to Data Mining 13

# Building a Data Mining Model with OLAP Data


Topic Objective
To describe the steps used
to build a data mining model ! Introducing the Membership Card Scenario
with OLAP data.
! Selecting the Data Mining Technique
Lead-in
These are a variety of steps ! Selecting the Case
involved in building a data
mining model with OLAP ! Selecting Predicted Entity
data.
! Selecting Training Data
! Creating a Dimension and Virtual Cube
! Browsing the Data Mining Model

You can use the Mining Model Wizard in Analysis Manager to create a data
mining model. This section uses the Membership Card scenario to demonstrate
the creation of a data mining model.
Building and reviewing a data mining model entails several steps:
1. Selecting the data mining technique.
2. Identifying the case.
3. Selecting the entity to be predicted.
4. Identifying the training data.
5. Optionally creating a dimension and virtual cube from the resulting model.
6. Processing the model and browsing the results.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


14 Module 17: Introduction to Data Mining

Introducing the Membership Card Scenario


Topic Objective
To introduce a business ! The VP of Marketing Wants to Evaluate Member Card Programs
scenario for creating a
model.
$ Identify opportunities for enhancing services at each current
card level
Lead-in
The Vice President of $ Market programs based on customer demographics
Marketing of Foodmart
! We Will Predict Card Selection Patterns By Using Data Mining
wants to evaluate the
current member card $ Find membership card selection patterns
programs.
$ Select Customer as the mined dimension
$ Select the Member Card property as the pattern identifier
$ Use Customer demographics to train the model
$ Browse the decision tree

The Vice President of Marketing of Foodmart wants to evaluate current


Delivery Tip member card programs. To improve customer retention and satisfaction, she
Use this example to
describe each of the
specifically wants to identify opportunities for enhancing services provided at
following pages in this each card level:
section.
! Golden
! Silver
! Bronze
! Normal
Demographic information about customers is available. The information
includes:
! Gender
! Marital status
! Yearly income
! Education level
In this card membership scenario, you will learn how historical data in the
Foodmart 2000 Sales cube predicts the likelihood of customers applying for
different levels of membership cards based on a variety of attributes.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 17: Introduction to Data Mining 15

Following is the systematic process for predicting the card selection patterns:
1. Use the Microsoft Decision Tree model to find card selection patterns in the
customer base.
2. Select the Customer as the dimension being mined—the case dimension.
3. Select the Member Card member property as the information used by the
data mining algorithm to identify the patterns.
4. Use the Customer demographic information available to train the model.
5. Browse the decision tree that is created by using the data mining algorithm.

Based on the patterns discovered, the marketing department can enhance the
services available at each card level to ensure that the specific card programs
are suited to customers who apply for each type of card.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


16 Module 17: Introduction to Data Mining

Selecting the Data Mining Technique


Topic Objective
To demonstrate how to
select the data mining
technique by using the
Wizard.
Lead-in
Microsoft offers two data
mining techniques: Microsoft
Decision Trees and
Microsoft Clustering. You
select decision trees in this
case because it is a good
technique for prediction.

There are varieties of data mining techniques used to build a data mining
model. Microsoft currently offers two data mining techniques:
! Microsoft Decision Trees
! Microsoft Clustering
The Microsoft Decision Trees technique is used for classification and
prediction. You can use the decision tree technique for the membership card
scenario because it predicts and assigns probabilities of outcomes based on a
variety of attributes. The objective of the scenario is to predict card levels based
on demographic characteristics of customers.
The Microsoft Clustering technique is used for classification. It is a method that
uses various techniques to group records into groups or clusters that exhibit
similar, predictable characteristics.
The Mining Model Wizard prompts you to select the technique for creating the
model.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 17: Introduction to Data Mining 17

Selecting the Case


Topic Objective
To demonstrate how to
select the case for an OLAP
mining model.
Lead-in
The case is the basic unit
for analysis in the mining
model—the base element
for classifying and grouping
data.

The case is the basic unit for analysis in the mining model. It is the base
Delivery Tip element for classifying and grouping data.
Ask students what the case
dimension and level are for In the first data mining example presented in this module—whether a student
the membership card will attend college or not—the case is each student. In this membership card
scenario. example, the case is each customer in the Foodmart database.
In an OLAP cube, the case is a level—typically the leaf level—of a dimension.
The Mining Model Wizard prompts you to select the case that you want use to
create the model.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


18 Module 17: Introduction to Data Mining

Selecting the Predicted Entity


Topic Objective
To define the predicted
entity and demonstrate how
to select the predicted entity
in the wizard.
Lead-in
The predicted entity is the
element you want the model
to predict. The predicted
entity can be a measure, a
member property of the
case level, or a member of
another dimension.

The predicted entity is the element you want the model to predict.
Delivery Tip
Ask students what the In the students attending college example, “planning to attend college or not” is
predicted entity is in the the predicted entity. In the membership card scenario, you want to predict what
membership card scenario. membership card a person is likely to apply for based on that person’s
demographic attributes. Therefore, the predicted entity is membership card.
In an OLAP cube, a predicted element can be:
! A measure
! A member property of the case level
! Members of another dimension
Although only one entity can be see from the wizard, additional entities can be predicted in one model using the editor.

Note Although only one predicted entity can be selected by using the wizard,
additional entities may be added by using the Data Mining Editor.

The Mining Model Wizard prompts you to select the predicted entity for this
model.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 17: Introduction to Data Mining 19

Selecting Training Data


Topic Objective
To review the meaning of
training data and
demonstrate how to select
training data.
Lead-in
What is training data? What
training data would you like
to use in this model?

To build the model, the model must “learn” from the training data.
The training data is a statistically representative subset of historical data where
the attributes to be predicted are known. The training data must contain the case
data element, the predicted entity, and at least one other attribute that can be
used for predicting that entity.
The Mining Model Wizard prompts you to select the training data to be used in
building the model.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


20 Module 17: Introduction to Data Mining

Creating a Dimension and Virtual Cube


Topic Objective
To demonstrate how to
create a dimension and
virtual cube by using the
mining model decision tree.
Lead-in
You can choose to create a
dimension out of the
decision tree and build a
virtual cube including that
dimension and the original
Sales cube. What are some
of the benefits of doing this?

You can choose to create a dimension from the decision tree. You can then
choose to create a virtual cube that includes the virtual dimension and the
original base cube from which the model was created. This technique allows
users to explore the decision tree in an interactive ad-hoc manner.
The Mining Model Wizard gives you the option to create a new dimension
based on the decision tree and then optionally include that dimension in a
virtual cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 17: Introduction to Data Mining 21

Browsing the Data Mining Model


Topic Objective Content Navigator
To demonstrate how to
browse the results in a
mining model.
Content Detail
Lead-in
The OLAP Mining Model
Editor can be used to edit
properties in your model or Attributes
browse the results.

Node Path

To finish creating the model, you must name, save, and process the model. The
final step of the wizard allows you to do this.
When you complete a model by using the Mining Model Wizard, you exit from
the wizard to the OLAP Mining Model Editor. You can use the editor to browse
the results of your model or edit properties of the model.

The OLAP Mining Model Editor


The OLAP Mining Model Editor contains two general workspaces:
! The left side contains a tree view and a Properties pane, which are used for
editing the model.
! The right side contains a browser, which includes four panes that are used
for reviewing model data.
The purposes of the four browser panes are defined in the table below.
Pane Purpose

Content Detail Represents the portion of the mining model on which the focus
is set.
Content Navigator Represents the complete view of the mining model and can be
used for navigating the decision tree and changing the context
in the Content Detail pane.
Attributes Displays the numeric (Totals) or graphical (Histogram)
representation of the predicted entity for the currently selected
node.
Node Path The pane that contains the full context information for the node
currently in focus.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


22 Module 17: Introduction to Data Mining

Browsing the Decision Tree


Once the decision tree is created and processed, you can examine the results by
using the browser. Returning to the membership card example, the task now is
to analyze which customers are likely to purchase Golden cards.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 17: Introduction to Data Mining 23

Browsing the Dependency Network


Topic Objective
To demonstrate how to
browse the dependency
network.
Lead-in
The Dependency Network
Browser can be used to
view all the relationships in
your model.

In the data mining model browser, you can view the attributes and their
relationship to the entity you are trying to predict. The Dependency Network
Browser gives you the ability to view all the attributes in the model and how
they relate to one another.
As shown in the above slide, each attribute is a node with arrows indicating the
prediction links between the nodes.
After you create and process the mining model, you can explore the dependency
network.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


24 Module 17: Introduction to Data Mining

Demonstration: Building a Decision Tree Using OLAP Data


Topic Objective
To demonstrate how to
create a data mining model
by using a decision tree with
OLAP data.
Lead-in
In this demonstration, you
will learn how to create a
data mining model by using
a decision tree with OLAP
data.

In this demonstration, you will create a data mining model by using a decision
tree with OLAP data.

! To start the Mining Model Wizard


1. From Analysis Manager, expand the local server, expand the Foodmart
2000 database, and then expand the Cubes folder.
2. Right-click the Sales cube, and then click New Mining Model.

! To choose the data mining technique


1. From the Select data mining technique step in the wizard, click Microsoft
Decision Trees in the list of techniques.
2. Click Next to move to the next step in the wizard.

! To select the case


1. From the Select case step in the Mining Model Wizard, click Customers
for the Dimension, and then click Name for the level.
2. Click Next to move to the next step in the wizard.

! To select the predicted entity


1. From the Select predicted entity step in the Mining Model Wizard, click A
member property of the case level and then in the Member Properties
list, click Member Card.
2. Click Next to move to the next step in the wizard.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 17: Introduction to Data Mining 25

! To select the training data


1. From the Select training data step in the Mining Model Wizard, scroll to
the Customers dimension and deselect the Country, State Province, and
City check boxes.
The customer dimension is selected by default because it is the case
dimension. You do not need the summary information for the model. For
this reason, you can clear the country, state, and city information.
2. Click Next to move to the next step in the wizard.

! To create a dimension and virtual cube


1. From the Create a dimension and virtual cube step in the Mining Model
Wizard, in the Dimension name box, type Customer Decision Tree.
2. In the Virtual cube name box, type Membership Card Selection.
3. Click Next to move to the next step in the wizard.

! To finish the mining model wizard


1. From the Finish the Mining Model Wizard step, in the Model name box,
type MemberCardOLAP, and then click Save and process now.
2. Click Finish to create and process the model.
3. When the processing completes successfully, click Close.

! To explore data in the decision tree and isolate Golden card customers
1. In the Content Detail pane, click the All node.
Notice that the All node is black. The color represents the density of cases in
that node. Because the All node contains all the 5,581 cases, it is colored
black to represent high density.
2. Click the Totals tab of the Attributes pane.
The Tree Total row shows 5,581 total cases. Because OLAP data is used,
the number of total cases represents the customers having activity in the
Sales cube compared to the entire population of customers in the database.
In other words, 5,581 customers are active in the Sales cube.
3. Click the Histogram tab of the Attributes pane.
This shows a graphical representation of the cases by different member card
types.

Tip The Attributes pane can be sorted by any of the three columns—Value,
Cases, or Probability by clicking the column headings. The cursor arrows
indicate ascending or descending sort order.

4. In the lower right corner of the OLAP Mining Model Editor, click Golden
in the Tree color based on list.
This action re-colors the decision tree based on the density of Golden cases.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


26 Module 17: Introduction to Data Mining

5. In the Content Detail pane, click the Customers.Name.Yearly Income =


$150K + node.
Based on the shading, notice that this category has a higher density of
Golden cases than any other node. Notice also that the Node Path pane now
displays Customers.Name.Yearly Income = $150K +.
You can also see that more than 48 percent of customers with incomes
greater than $150K have Golden cards, a much higher probability than the
general population.

Important The first branch in the decision tree represents the most
dominant attribute for predicting the predicted entity. In this example, the
attribute that has the greatest impact on predicting the membership card is
the customer’s salary.

6. In the Content Detail pane, double-click the Customers.Name.Yearly


Income = $150K+ node.
7. Click the Customer.Name.Marital Status = M node.
Notice that the Node Path is Customers.Name.Marital Status = M and
Customers.Name.Yearly Income = $150K +. This represents the full path
of attributes that apply to this node. Notice also that this node is shaded
black, representing a high density of Golden cases.
Also note that there is an 83.33 percent probability that the customer will
have a Golden card if income is over $150K and if the customer is married.
Note that Marital Status is the second most dominant attribute for predicting
a customer’s membership card.
Gender and Education, the other two attributes included when training the
model, are not part of the decision tree. The algorithm did not detect any
additional predictive benefits by including these attributes in the tree.
8. In the Content Navigator pane, click the leftmost point of the pane to return
to the first node in the decision tree.
9. On the File menu, click Exit to close the OLAP Mining Model Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 17: Introduction to Data Mining 27

Lab A: Creating a Decision Tree with Relational Data


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will build a
data mining model by using
a decision tree with
relational data.

Objectives
Explain the lab objectives. After completing this lab, you will be able to:
! Create a decision tree with relational data.
! Browse the decision tree results.

Estimated time to complete this lab: 20 minutes.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


28 Module 17: Introduction to Data Mining

Exercise 1
Creating a Decision Tree with Relational Data
In this exercise, you will create a data mining model by using a decision tree
with relational data. You will create the model from the Mining Model Wizard
in Analysis Manager.

! To create the baseline data mining model


In this procedure, you will create the baseline data mining model by selecting
source type, case table, data mining technique, and key column.
1. From Analysis Manager, expand the Foodmart 2000 database, right-click
the Mining Models folder, and then click New Mining Model. At the
welcome page, click Next.
2. From the Select source type page of the Mining Model Wizard, click
Relational Data, and then click Next.
Either relational tables or OLAP cubes can be used as source data. For this
model, you are accessing relational data.
3. From the Select case tables page, in the Available tables list, expand
Foodmart, expand Default Schema, click customer and then click Next.
The case table is the table that contains the case information you want to
analyze. The case key and the related attributes may reside in one or many
tables. You want to analyze the customer information that resides in the
single customer table.
4. From the Select data mining technique page, click Microsoft Decision
Trees as the Technique, and then click Next.
5. From the Select the key column page, in the Case key column list, click
customer_id, and then click Next.
The case key is the column in your table that uniquely identifies the case
you want to analyze. Because you want to analyze customer behavior, the
case key column is customer_id.

! To select input and predictable columns for the mining model


In this procedure, you will select input and predictable columns to define your
mining model.
1. From the Select input and predictable columns page of the Mining Model
Wizard, in the Available columns list, click member_card.
2. Click the top arrow (>) to choose the member card as a predictable column.
3. In the Available columns list, click education, and then click the top arrow
(>) to choose that column as a predictable column.
4. In the Available columns list, click yearly_income, and then click the top
arrow (>) to choose that column as a predictable column.
5. In the Available columns list, click marital_status, and then click the
bottom arrow (>) to choose that column as an input column.
6. In the Available columns list, click gender, and then click the bottom
arrow (>) to select that column as an input column. Click Next.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 17: Introduction to Data Mining 29

! To finish the Mining Model Wizard


1. From the Finish the Mining Model Wizard page, in the Model name box,
type RelationalDecisionTree.
2. Click Finish to create and process the model.
3. When the model has completed processing, click Close to close the Process
dialog box.
The Relational Mining Model Editor opens.
4. Leave the Relational Mining Model Editor open for the next exercise.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


30 Module 17: Introduction to Data Mining

Exercise 2
Browsing the Relational Decision Tree Results
In this exercise, you will browse the decision tree results from the data mining
model created in Exercise 1. Because you selected three predictable columns in
that exercise, you will have three decision trees to review.
The items that are not being predicted but were selected as predictable columns
are inputs into the decision tree.

! To explore data in the Member Card decision tree


1. In the Relational Mining Model Editor, click the Content tab to display the
decision tree results.
2. In the Prediction Tree list, click Member Card.
From this list, you chose the Decision Tree that was created to predict the
customers’ likelihood of receiving each category of member card.
Note that two other prediction trees are available for browsing—Education
and Yearly Income. These trees were created because you instructed the
wizard in Exercise 1 to predict from these attributes also.
3. Click the All node.
Notice in the Attributes pane that there are 10,281 total cases in the decision
tree. This decision tree includes more customers than the one created by
using OLAP data because it used all the customer_ids in the customer table
and not only the active customers in the Sales cube.
The OLAP decision tree included only customers at the Customer Name
level of the Customer dimension for which there had been activity.
Therefore, if a Foodmart customer did not have any sales activity in 1997,
the customer would not be included in the cases.
Observe that 5,703 cases, more than 55 percent of the total population, are
likely to select a Bronze card.
4. Click the Yearly Income = $30K - $50K node.
Of these customers, 72.27 percent are likely to select a Bronze card.
5. From the Content Navigator pane, click the dark blue section at the top
rightmost section of the pane.
This action allows you to navigate the nodes that follow the Yearly Income
= $30 - $50K.
6. Click Marital Status = S.
Note the 81.58 percent probability that single customers will have a Bronze
card.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 17: Introduction to Data Mining 31

! To explore data in the Yearly Income decision tree


1. In the Relational Mining Model Editor, in the Prediction Tree list, click
Yearly Income.

Tip If you cannot see the results in the Attribute pane, you can resize each
column or the Content Detail pane space.

2. In the Tree color based on list, click $130 - $150K.


3. Click the Education = Graduate Degree node.
If you compare graduate degreed customers to all customers, you notice that
graduate degreed customers have a much higher probability of earning a
high income.
4. On the File menu, click Exit to close the Relational Mining Model Editor.

! To explore the model in the Dependency Network Browser


1. In Analysis Manager, right-click the RelationalDecisionTree mining
model, and then click Browse Dependency Network.
The Dependency Network Browser opens.
2. Click Marital Status.
Notice that the nodes are now color-coded. The color code key is located at
the bottom of the browser.
Marital Status is green representing the selected node. Member Card is
pink representing the node it predicts. The one-way arrow denotes that
Marital Status can predict a Member Card, but Member Card has no
predictive value for determining Marital Status.
3. Click Yearly Income.
Yearly Income is green, representing the selected node. Member Card and
Education are purple, indicating prediction both ways. The double arrow
also depicts this dual relationship.
Just as yearly income can predict a customer’s Member Card, the Member
Card can predict a customer’s income. Note that there is no connection
between Yearly Income and Marital Status.
4. Drag the links control lever from All links down toward Strongest links.
This lever is used to graphically display the relative strength of a link.
Notice as you slowly lower the level, the marital status link is eliminated.
This shows that marital status has the least predictive power in the model.
Continue dragging the lever, and you can see that the Yearly Income has a
stronger ability to predict the Member Card than vice versa.
5. Drag the Links Control to the bottom—displaying only the strongest links.
Note that the most dominant predictive attribute in the model is that
Education predicts Yearly Income.

Note The membership card example is very simple. Often there are
hundreds of elements to be analyzed. The arrows, along with the color-
coding and the link strength, offer an easy-to-use graphical interface to help
you understand the relationships.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


32 Module 17: Introduction to Data Mining

Review
Topic Objective
To reinforce module
objectives by reviewing key
points. ! Introducing Data Mining
Lead-in ! Training a Data Mining Model
The review questions cover
some of the key concepts ! Building a Data Mining Model with OLAP Data
taught in the module.
! Browsing the Dependency Network

1. What is the definition of data mining and why is it useful?


Data mining is the automatic or semi-automatic process of deducing
meaningful patterns and rules from large quantities of data. It is useful
because it often uncovers patterns that are not discovered by manual
methods of analysis.

2. What are the two data mining algorithms available with Analysis Services
2000, and when does it make sense to use each algorithm?
Microsoft Decision Trees—useful for classification and prediction
Microsoft Clustering—useful for classification

3. What is training data and how is it used in data mining?


Training data is typically historical data for which the attributes to be
predicted are known. You use training data to teach the mining model
the anticipated probabilities to expect.

4. What is the definition of a case in a mining model? How is the case


represented in an OLAP model and in a relational model?
The case is the basic unit for analysis in the mining model. It is the base
element used for classifying and grouping the data. The case is typically
the lowest level of a dimension in an OLAP model, and is a column in
the case table in a relational model.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 17: Introduction to Data Mining 33

5. What is the difference between an input and a predicted entity?


The predicted entity is the element that the model will predict. An input
is an element on which you want to base your analysis.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 18: Case
Study—Working with
the Foodmart Database
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
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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 18: Case Study—Working with the Foodmart Database iii

Instructor Notes
Presentation: In this module, students apply concepts they have learned in modules 1 through
60 Minutes 17 in the course 2074A, Designing and Implementing OLAP Solutions Using
Microsoft® SQL Server™ 2000. Students will use various cube and dimension
Labs: techniques to build cubes from the Foodmart 2000 database by using
120 Minutes 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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


iv Module 18: Case Study—Working with the Foodmart Database

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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 18: Case Study—Working with the Foodmart Database v

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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


vi Module 18: Case Study—Working with the Foodmart Database

Demonstration: Reviewing Lab B


In this demonstration, you will view and discuss the solutions of lab B.

Demonstration: The following demonstration procedures provide information that will not fit in
the margin notes or is not appropriate for student notes.
10 Minutes
! 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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 18: Case Study—Working with the Foodmart Database vii

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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


viii Module 18: Case Study—Working with the Foodmart Database

Demonstration: Reviewing Lab C


In this demonstration, you will view and discuss the solutions of lab C.

Demonstration: The following demonstration procedures provide information that will not fit in
the margin notes or is not appropriate for student notes.
10 Minutes
! 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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 18: Case Study—Working with the Foodmart Database ix

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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


x Module 18: Case Study—Working with the Foodmart Database

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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 18: Case Study—Working with the Foodmart Database 1

Overview
Topic Objective
To provide an overview of
the module topics and
objectives. ! Building the Warehouse Cube
Lead-in ! Building the Sales Cube
In this module, you will
apply the concepts learned ! Building the Warehouse and Sales Virtual Cube
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.

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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


2 Module 18: Case Study—Working with the Foodmart Database

# Building the Warehouse Cube


Topic Objective
To introduce the database,
dimensions, and levels in
the Warehouse cube. ! Defining the Warehouse Schema
Lead-in ! Introducing the Dimensions and Levels
In this section, you will learn
about the database that you ! Analyzing the Measures
use to build the Warehouse
cube. In addition, you will ! Defining the Calculated Members
learn about the dimensions
and measures of the cube.

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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 18: Case Study—Working with the Foodmart Database 3

Defining the Warehouse Schema


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.

The Foodmart 2000 database contains tables that you will use to create the
Delivery Tips Warehouse cube.
Let students know that they
can turn back to this page You will create a cube that tracks Units Ordered, Units Shipped, Warehouse
during the lab to identify Sales, Warehouse Cost, Maximum Supply Time, and Margin. Users need to
levels and tables used to
see these numeric values by Warehouse, by Store, by Time period, and by
build dimensions.
Product. You will need to include two years worth of data, as well as the
Students can also open the variance of the two years—1997 and 1998. In addition, users want to evaluate
database themselves in the all the values based on the year in which the stores opened.
Access by navigating to
\Program Files\Analysis
The tables that you will use to build the cube are the following:
Services\Samples on their ! Inventory fact tables—for 1997 and 1998 data
computers and opening
Foodmart 2000.mdb. ! time_by_day
! product
! product_class
! store
! warehouse
! warehouse_class

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


4 Module 18: Case Study—Working with the Foodmart Database

Introducing the Dimensions and Levels


Topic Objective
To introduce the dimensions
and levels created in the
Warehouse cube. ! Product
Lead-in ! Time
You will create five
dimensions in the ! Warehouse
Warehouse cube.
! Store
! First Opened Year

You will create five dimensions in the Warehouse cube. Before creating each
Delivery Tips dimension, you will determine the source table and the levels that are required
For classes with more
experienced students,
to build the dimension.
briefly highlight the fact that
they will be creating several Product
dimensions in lab A. Do not
Define the shared Product dimension by using the tables product and
cover the dimension
structures in detail.
product_class. The Product dimension contains six levels:
! Product Family
For less advanced classes,
use this page as an ! Product Department
opportunity to prepare
! Product Category
students for the lab by
discussing each of the ! Product Subcategory
dimensions in detail.
! 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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 18: Case Study—Working with the Foodmart Database 5

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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


6 Module 18: Case Study—Working with the Foodmart Database

Analyzing the Measures


Topic Objective
To describe the use of
measures in the
Warehouse cube. ! Units Ordered
Lead-in ! Units Shipped
You will create five
measures in the ! Warehouse Sales
Warehouse cube.
! 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

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 18: Case Study—Working with the Foodmart Database 7

Defining the Calculated Members


Topic Objective
To describe the use of
calculated members in the
Warehouse cube. ! Margin
Lead-in $ Warehouse Sales minus Warehouse Cost
You will create three
calculated members in the ! 1998 versus 1997 Variance
Warehouse cube.
$ 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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


8 Module 18: Case Study—Working with the Foodmart Database

Lab A: Building the Warehouse Cube


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.


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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 18: Case Study—Working with the Foodmart Database 9

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

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


10 Module 18: Case Study—Working with the Foodmart Database

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

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 18: Case Study—Working with the Foodmart Database 11

Tip 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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


12 Module 18: Case Study—Working with the Foodmart Database

! 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.
____________________________________________________________

____________________________________________________________

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 18: Case Study—Working with the Foodmart Database 13

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

Tip 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

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


14 Module 18: Case Study—Working with the Foodmart Database

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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 18: Case Study—Working with the Foodmart Database 15

Demonstration: Reviewing 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.

In this demonstration, you will view and discuss the solutions of 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.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


16 Module 18: Case Study—Working with the Foodmart Database

# Building the Sales Cube


Topic Objective
To introduce the database,
dimensions, and levels in
the Sales cube. ! Defining the Sales Schema
Lead-in ! Introducing the Dimensions and Levels
In this section, you will learn
about the database that you ! Analyzing the Measures
use to build the Sales cube.
In addition, you will learn ! Defining the Calculated Members
about the dimensions and
measures of the cube.

In this section, you will learn about the schema of the database used to create
the Sales cube by using Analysis Services. In addition, you will learn about the
dimensions, measures, and calculated members that you will create in the Sales
cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 18: Case Study—Working with the Foodmart Database 17

Defining the Sales Schema


Topic Objective
To introduce the Sales
schema that students use to
build the Sales cube.
Lead-in
You will be creating the
Sales cube by using the
tables in the Foodmart
2000 Access 2000
database.

The Foodmart 2000 database contains tables that you will use to create the
Delivery Tips Sales cube.
Let students know that they
can turn back to this page The Sales cube contains information that pertains to the Foodmart stores and
during the lab to identify customers. Users will need to analyze the numeric values of Store Sales, Store
levels and tables used to
Cost, Unit Sales, Gross Margin, and Average Selling Price. Because of the
build dimensions.
analytical and strategic role of most Sales cube users, you will need to create
Students can also open the many dimensions in the cube. Users must see data by Product, by Time, by
database themselves in Store, by Customer, by Gender of customer, by Education of customer, and
Access by navigating to by Yearly Income of customer. The cube must store data for 1997 and 1998
\Program Files\Analysis years.
Services\Samples on their
computers and opening You will use the following tables to build the Sales cube:
Foodmart 2000.mdb.
! Sales fact tables—for all the 1997 and 1998 data
! time_by_day
! product
! product_class
! store
! customer

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


18 Module 18: Case Study—Working with the Foodmart Database

Introducing the Dimensions and Levels


Topic Objective
To introduce the dimensions
and levels created in the ! Store
Sales cube.
! Product
Lead-in
You will define eight ! Time
dimensions in the Sales
cube. ! Quarter
! Customer
! Gender
! Education
! Yearly Income

You will define eight dimensions in the Sales cube. Before creating each
Delivery Tips dimension, you will determine the source table and the levels that are required
For classes with more
experienced students,
to build the dimension.
briefly highlight the fact that
they will be creating several Store
dimensions in lab B. Do not
Define the shared Store dimension by using the store table. The Store
cover the dimension
structures in detail.
dimension contains four levels:
! Store Country
For less advanced classes,
use this page as an ! Store State
opportunity to prepare
! Store City
students for the lab by
discussing each of the ! Store Name
dimensions in detail.
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

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 18: Case Study—Working with the Foodmart Database 19

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.

Quarter
Define the virtual Quarter dimension by using the Quarter level from the
Time dimension. The Quarter dimension contains one level—Quarter.

Customer
Define the shared Customer dimension by using the customer table. The
Customer dimension contains four levels:
! Country
! State
! City
! Name

Gender
Define the private Gender dimension by using the customer table. This defines
the gender of each customer. The Gender dimension contains one level—
Gender.

Education
Define the virtual Education dimension by using the customer table. The
Education dimension contains one level— Education.

Yearly Income
Define the virtual Yearly Income dimension by using the customer table. The
Yearly Income dimension contains one level— Yearly Income.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


20 Module 18: Case Study—Working with the Foodmart Database

Analyzing the Measures


Topic Objective
To describe the use of
measures in the Sales
cube. ! Store Sales
Lead-in ! Store Cost
You will create three
measures in the Sales ! Unit Sales
cube.

You will create three measures in the Sales cube. All measures come from the
sales fact tables. The measures to include in the cube are:
! Store Sales
! Store Cost
! Unit Sales

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 18: Case Study—Working with the Foodmart Database 21

Defining the Calculated Members


Topic Objective
To describe the use of
calculated members in the
Sales cube. ! Margin
Lead-in ! Average Selling Price
You will create three
calculated members in the ! Average Customer Value
Sales cube.

You will create three calculated members in the Sales cube. The calculated
members to include in the cube are:
! Margin—Store Sales – Store Cost.
! Average Selling Price—Store Sales / Unit Sales.
! Average Customer Value—the average customer value, defined across all
measures and all dimensions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


22 Module 18: Case Study—Working with the Foodmart Database

Lab B: Building the Sales Cube


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will create a
new cube, Sales, from start
to finish.

Explain the lab objectives.


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.

Lab Setup
To complete this lab, you must first complete:
! Lab A, Building the Warehouse Cube, found earlier in this module.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 18: Case Study—Working with the Foodmart Database 23

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.

The Cube Editor


For more information on using the Cube Editor interface, 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: 40 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


24 Module 18: Case Study—Working with the Foodmart Database

Exercise 1
Creating the Sales Cube
In this exercise, you will create a new cube, Sales, which contains eight
dimensions with varying specifications, levels, and structures. In addition, the
cube contains three measures and three calculated members. You will process
the cube and 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, refer to the
corresponding answer files, which are located in:
C:\Moc\2074A\Labfiles\L18\Answers

! To create a new cube


1. In the Module 18 OLAP database, create a new cube containing the
following three measures defining 1997 and 1998 sales data:
• Store Sales
• Store Cost
• Unit Sales
2. Add the following existing dimensions to the Sales cube:
• Store
• Product
• Time
3. Create and add the following dimensions to the Sales cube:
• Quarter
• Customer
• Gender
• Education
• Yearly Income

Tip 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 section.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 18: Case Study—Working with the Foodmart Database 25

Use the following table to create the dimensions with various dimension
specifications.
Dimension Name Dimension Type Levels/Members

Quarter Virtual One level—Quarter—


based off the Quarter
level in the Time
dimension.
Customer Shared Four levels: Country,
State, City, and
Customer. For the
Customer level, define the
Member Key Column as
Customer_ID, and the
Member Name Column
with the format last name,
first name.
Gender Private One level: Gender
Education Virtual One level: Education
Yearly Income Virtual One level: Yearly Income

4. In the Sales cube, only include the top five levels of the Product dimension.
Do not include the Product Name level.
5. Name the cube Sales.
6. Process the cube, without defining aggregations or storage mode.
7. Be certain that you include all sales data for 1997 and 1998.

Tip Three tables contain 1997 and 1998 data in the Foodmart 2000
database.

! To create calculated members


• In the Sales cube, create the following three calculated members:
• Gross Margin
• Average Selling Price
• Average Customer Value—an average of all measure values for
members of the Customer level, created by using the Avg and
Members functions.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


26 Module 18: Case Study—Working with the Foodmart Database

! To verify cube results


1. In the cube browser, verify that you retrieve $706,294.73 for the following
member combination:
• All Time
• All Store
• All Product
• All Customer
• All Education
• All Gender
• All Yearly Income
• Store Cost
2. Verify that you retrieve $525.04 for the following member combination:
• 1997
• All Store
• Drink products
• USA Customers
• Graduate degree education
• M Gender
• $70K-$90K yearly income
• Store Sales
3. Verify that you retrieve $2.12 for the following member combination:
• 1998
• All Store
• All Product
• All Customer
• All Education
• F Gender
• All Yearly Income
• Average Selling Price

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 18: Case Study—Working with the Foodmart Database 27

4. Verify that you retrieve $46,169.83 for the following member combination:
• All Time
• Canada stores
• Food products
• All Customer
• All Education
• All Gender
• Gross Margin
5. Save the Sales cube, and then close the Cube Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


28 Module 18: Case Study—Working with the Foodmart Database

Demonstration: Reviewing Lab B


Topic Objective
To demonstrate solutions to
lab B.
Lead-in
In this demonstration, you
will view and discuss the
solutions to lab B.

In this demonstration, you will view and discuss the solutions of lab B.
Delivery Tips
The steps for this
demonstration are included
in the Instructor Notes.

Encourage students to
follow along with the
demonstration by comparing
their Sales cubes to the
archived version that you
demonstrate.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 18: Case Study—Working with the Foodmart Database 29

# Building the Warehouse and Sales Virtual Cube


Topic Objective
To introduce the cubes,
dimensions, and levels in
the Warehouse and Sales ! Introducing the Dimensions and Levels
virtual cube.
! Analyzing the Measures
Lead-in ! Defining the Calculated Members
You will now create a virtual
cube, Warehouse and
Sales, which will combine
the previously created
Warehouse and Sales
cubes.

You will now create a virtual cube, Warehouse and Sales, which will combine
the previously created Warehouse and Sales cubes.
The Warehouse and Sales virtual cube will give users the ability to see
Product and Time members across measures from both the Warehouse and
the Sales cubes. In addition, the Customer and Store dimensions are added,
but without some of the more sensitive dimensions, such as Yearly Income and
Education.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


30 Module 18: Case Study—Working with the Foodmart Database

Introducing the Dimensions and Levels


Topic Objective
To introduce the dimensions
and levels created in the ! Time
Warehouse and Sales
virtual cube. ! Product
Lead-in ! Store
You will define four
dimensions in the ! Customer
Warehouse and Sales
virtual cube.

You will define four dimensions in the Warehouse and Sales virtual cube.
Delivery Tip
Briefly mention the fact that
the virtual cube contains Time
four dimensions, and move Define the shared Time dimension by using the time_by_day table. The Time
on. dimension contains three levels:
! Year
! Quarter
! Month

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

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 18: Case Study—Working with the Foodmart Database 31

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

Customer
Define the shared Customer dimension by using the customer table. The
Customer dimension contains four levels:
! Country
! State
! City
! Name

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


32 Module 18: Case Study—Working with the Foodmart Database

Analyzing the Measures


Topic Objective
To describe the use of
measures in the
Warehouse and Sales ! Units Shipped
virtual cube.
! Store Cost
Lead-in
You will define five ! Store Sales
measures in the
Warehouse and Sales ! Warehouse Sales
virtual cube.
! Warehouse Cost

You will create five measures in the Warehouse and Sales virtual cube:
! Unit Shipped
! Store Cost
! Store Sales
! Warehouse Sales
! Warehouse Cost

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 18: Case Study—Working with the Foodmart Database 33

Defining the Calculated Members


Topic Objective
To describe the use of
calculated members in the
Warehouse and Sales ! Average Shipped Cost
virtual cube.
! Imported Calculated Members
Lead-in
You will create three
calculated members in the
Warehouse and Sales
virtual cube.

You will create calculated members in the Warehouse and Sales virtual cube
by using two methods:
! Creating one new calculated member—Average Shipped Cost
(Warehouse Cost / Units Shipped).
! Importing all calculated members from the two source cubes—Warehouse
and Sales. You will keep only those calculations that work properly.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


34 Module 18: Case Study—Working with the Foodmart Database

Lab C: Building the Warehouse and Sales Cube


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will create a
new virtual cube,
Warehouse and Sales,
from start to finish.

Explain the lab objectives.


Objectives
After completing this lab, you will be able to:
! Create a new virtual cube.
! Create a calculated member.
! Import calculated members.

Prerequisites
Before working on this lab, you must have:
! Experience working with dimensions.
! An understanding of dimensions, cubes, and measures.
! Experience working with virtual cubes.
! Experience working with the Virtual Cube Editor.
! Experience working with the Calculated Member Builder.

Lab Setup
To complete this lab, you must first complete:
! Lab A, Building the Warehouse Cube, found earlier in this module.
! Lab B, Building the Sales Cube, found earlier in this module.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 18: Case Study—Working with the Foodmart Database 35

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.

The Cube Editor


For more information on using the Cube Editor interface, 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.

Virtual Cubes
For more information on creating virtual cubes, see module 12, "Working with
Virtual Cubes," in course 2074A, Designing and Implementing OLAP Solutions
Using Microsoft SQL Server 2000.

Estimated time to complete this lab: 20 minutes

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


36 Module 18: Case Study—Working with the Foodmart Database

Exercise 1
Creating the Warehouse and Sale Virtual Cube
In this exercise, you will create a new virtual cube, Warehouse and Sales,
which combines the data from two existing cubes—Warehouse and Sales. In
addition, you will create a new calculated member and will import calculated
members previously defined in the Warehouse and Sales source cubes.
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, refer to the
corresponding answer files, which are located in:
C:\Moc\2074A\Labfiles\L18\Answers

! To create a new virtual cube


1. In the Module 18 OLAP database, create a new virtual cube combining data
from the following cubes:
• Warehouse
• Sales
2. Add the following measures to the virtual cube:
• Units Shipped
• Store Cost
• Store Sales
• Warehouse Sales
• Warehouse Cost
3. Add the following dimensions to the virtual cube:
• Time
• Product
• Store
• Customer
4. Name the cube Warehouse and Sales.

! To add calculations to Warehouse and Sales


1. In the Warehouse and Sales Virtual Cube Editor, create the following
calculated member, based on the calculation logic defined earlier in this
section:
• Average Shipped Cost
2. Import all calculated members from the Warehouse cube and the Sales
cube into the Warehouse and Sales virtual cube.
3. Delete those calculated members that do not work in the virtual cube due to
unavailable measures and members.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 18: Case Study—Working with the Foodmart Database 37

! To verify cube results


1. In the cube browser, verify that you retrieve $545,255.61 for the following
member combination:
• All Time
• All Store
• All Product
• All Customer
• Warehouse Sales
2. Verify that you retrieve $0.40 for the following member combination:
• All Time
• Mexico stores
• Drink products
• All Customer
• Average Shipped Cost
3. Verify that you retrieve 302 for the following member combination:
• 1998 Versus 1997 Variance
• USA + Canada Stores
• Drink products
• All Customer
• Units Shipped
4. Save the Warehouse and Sales virtual cube, and then close the Virtual
Cube Editor.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


38 Module 18: Case Study—Working with the Foodmart Database

Demonstration: Reviewing Lab C


Topic Objective
To demonstrate solutions to
lab C.
Lead-in
In this demonstration, you
will view and discuss the
solutions to lab C.

In this demonstration, you will view and discuss the solutions of lab C.

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 and Sales
cube to the archived version
that you demonstrate.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Module 18: Case Study—Working with the Foodmart Database 39

Review
Topic Objective
To reinforce module
objectives by reviewing key
points. ! Building the Warehouse Cube
Lead-in ! Building the Sales Cube
The review questions cover
some of the key concepts ! Building the Warehouse and Sales Virtual Cube
taught in the module.

1. How did you create the First Opened Year dimension?


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.
Students might use other methods to create this dimension. Answers
may vary.

2. How did you incorporate all the 1997 and 1998 data into the Sales cube?
The Sales cube contains three partitions—one pulling data from
sales_fact_1997, one pulling data from sales_fact_1998, and one pulling
data from sales_fact_dec_1998.

3. Why did you delete the calculated member Average Selling Price in the
Warehouse and Sales virtual cube?
The expression for the Average Selling Price calculated member
included the Units Sales measure that does not exist in the Warehouse
and Sales virtual cube.

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

You might also like