1. Trang chủ
  2. » Công Nghệ Thông Tin

Tài liệu Module 6: Working with Cubes and Measures docx

42 630 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Working With Cubes And Measures
Trường học Microsoft Corporation
Chuyên ngành Computer Science
Thể loại module
Năm xuất bản 2000
Thành phố Redmond
Định dạng
Số trang 42
Dung lượng 861,99 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Lab A: Creating Cubes with the Cube Editor 15 Lab B: Using Properties in the Cube Editor 32 Review 35 Module 6: Working with Cubes and Measures... In this module, students use the Cube

Trang 1

Lab A: Creating Cubes with the Cube Editor 15

Lab B: Using Properties in the Cube Editor 32

Review 35

Module 6: Working with Cubes and Measures

Trang 2

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

Trang 3

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

Instructor Notes

Other modules in this course review the mechanics for creating different types

of dimensions and how to solve common online analytical processing (OLAP) design issues Though dimensions are fundamental to multidimensional reporting, the database cube combines dimensions with measures to answer 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® file2074A_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

Presentation:

60 Minutes

Labs:

30 Minutes

Trang 4

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

Trang 5

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

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

Trang 7

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

Overview

! Introduction to Cubes

! Working with Cubes

! Introduction to Measures

! Working with Measures

! Defining Cube Properties

! 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

In this module, you will learn

about the Cube Editor and

how it can be used to create

and manipulate cubes, add

measures and dimensions,

and assign properties to

improve cubes

Trang 8

# Introduction to Cubes

! Characteristics of Cubes

! Analysis Services Limitations

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

Topic Objective

To introduce the concept of

cubes

Lead-in

In this section, you learn the

characteristics of cubes and

the limitations associated

with cubes and measures

Trang 9

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

Characteristics of Cubes

! Provide the Mechanism for Uniform and Rapid Query 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 The following are important characteristics of cubes:

! Cubes combine dimensions and measures into one logical storage medium

! Cubes provide the mechanism for rapid and uniform response to complex queries by users

! Cubes usually contain subsets of data pulled from a data warehouse at the lowest level that are then organized into multidimensional structures and aggregated into more summarized levels

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

Point out that cubes can

store data directly in the

RDBMS The slide mentions

the most common method of

storing cube data in

multidimensional structures,

but there are other options

for storing cube data in

Analysis Services

Note

Trang 10

Analysis Services Limits

Limit Item

65,535Calculated members per cube

1,024Measures per cube

256Levels per cube

128Dimensions per cube

64 kilobytesRecord size for cube’s source

database table

When designing cubes and measures, you need to know the programmable limits of Analysis Services In most cases, the limits far exceed real-world requirements However, cube and measure requirements sometimes require changes because of the limitations

The following table lists some published limits of Analysis Services

Item Limit

Record size for cube’s source database table

When designing cubes and

measures, you need to

understand the

programmable limits of

Analysis Services

Delivery Tips

Review each of the limits,

using the slide to illustrate

the discussion

Ask students whether any

limit might be a problem for

them when they design

cubes for their business

needs

Trang 11

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

! Working with the Cube Editor

! Creating a New Cube

! Setting Dimension Properties

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

Topic Objective

To introduce the basics of

working with cubes

Lead-in

In this section, you explore

the basic elements of the

Cube Editor and learn how

to use it to create and edit

cubes

Trang 12

Working with the Cube Editor

! Accessing the Cube Editor

! Cube Editor Elements

If you are familiar with the Dimension Editor, the Cube Editor is a very straightforward interface for working with cubes and measures

Accessing the Cube Editor

Analysis Manager is an easily navigated interface Because of the 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

context-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

Topic Objective

To describe how to work

with the Cube Editor

Lead-in

If you are familiar with the

Dimension Editor, the Cube

Editor is a very

straightforward interface for

working with cubes and

measures

Delivery Tip

Open the Cube Editor for a

cube in Analysis Manager

and demonstrate the

interface described on this

page

Trang 13

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

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

Trang 14

Creating a New Cube

1 Access the Cube Editor

2 Choose a Fact Table

3 Select the Measures

4 Insert Shared Dimensions

5 Create Private Dimensions

6 Validate the Cube Structure

The Cube Wizard provides you with a systematic interface for creating new cubes Creating cubes through the Cube Editor is also very straightforward The following steps take you through the process of creating a new cube by using the Cube Editor:

1 Right-click the Cubes folder, click New Cube, and then click Editor

2 Choose a fact table from the data source

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

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

Topic Objective

To describe the process of

creating a new cube by

using the Cube Editor

Lead-in

The following steps take you

through the process of

creating a new cube by

using the Cube Editor

Key Point

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 have legitimate

joins

Note

Trang 15

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

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

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

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

Important

Note

Trang 16

Setting Dimension Properties

! Setting Properties for Private Dimensions

$ Administration occurs in the Cube Editor

$ Any level property can be modified

! Setting Properties for Shared Dimensions

$ Properties apply to all cubes that contain the dimension

$ 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

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

Topic Objective

To describe the process of

setting properties for private

and shared dimensions and

to compare the two types of

dimensions

Lead-in

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

Note

Trang 17

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

! Defining Measures

! Adding, Deleting, and Modifying Measures

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

Topic Objective

To introduce the concept of

measures

Lead-in

Measures are the numeric

data of primary interest to

the users of a cube

Trang 18

aggregations when added, deleted, or modified

dimensions

! The Measures Dimension

Measures

The following items are characteristics of measures:

! 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

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

dimension The measures

dimension is different from

other dimensions in several

respects

Delivery Tip

The slide bullet “Is always

private” may be confusing

for students If so, explain

that measures are not

shared across multiple

cubes, similar to private

dimensions

Note

Trang 19

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

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

Trang 20

Adding, Deleting, and Modifying Measures

! Adding a Measure to a Cube

! Deleting a Measure from a Cube

! Modifying a Measure in a Cube

The Cube Wizard walks you through the steps required to create a cube Once a cube is defined, however, the only way to add, delete, or modify a measure is

by using the Cube Editor

Adding a Measure to a Cube

To add a measure to a cube by using the Cube Editor, perform the following 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:

! In the Cube Editor, right-click the measure and click Delete

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

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

Topic Objective

To describe how to add,

delete, and modify

measures by using the

Cube Editor

Lead-in

After a cube is defined, the

only way to add, delete, or

production cube is a major

procedure In doing so, you

must redesign cube storage,

redesign aggregations, and

reprocess the cube

Delivery Tip

Open the Cube Editor and

demonstrate how to add,

delete, and modify

measures in cubes

Important

Trang 21

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

Lab A: Creating Cubes with the Cube Editor

Objectives

After completing this lab, you will be able to:

! Create a new cube by using the Cube Editor

! Add measures and dimensions to 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

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

After students complete the

lab, ask the students what

Sales Dollars values they

record for both exercises in

the lab

Ngày đăng: 18/01/2014, 05:20

TỪ KHÓA LIÊN QUAN