Tải bản đầy đủ (.pdf) (64 trang)

Tài liệu Module 5: Using Advanced Dimension Settings doc

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (999.28 KB, 64 trang )





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

Module 5: Using
Advanced Dimension
Settings

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

Information in this document is subject to change without notice. The names of companies,
products, people, characters, and/or data mentioned herein are fictitious and are in no way intended
to represent any real individual, company, product, or event, unless otherwise noted. Complying
with all applicable copyright laws is the responsibility of the user. No part of this document may
be reproduced or transmitted in any form or by any means, electronic or mechanical, for any
purpose, without the express written permission of Microsoft Corporation. If, however, 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.


Module 5: Using Advanced Dimension Settings iii

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY


Instructor Notes
There are several types of dimensions that can be created by using Microsoft
®

SQL Server

2000 Analysis Services. In this module, you lead students through
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 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.

Presentation:
50 Minutes

Labs:
70 Minutes
iv Module 5: Using Advanced Dimension Settings

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY





Demonstration: Creating Virtual Dimensions
To place a virtual dimension in a cube, you must perform the following tasks:
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.


Demonstration:
10 Minutes
Module 5: Using Advanced Dimension Settings v

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

!
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.







vi Module 5: Using Advanced Dimension Settings

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

Other Activities
Difficult Questions
Below are difficult questions that students may ask you during the delivery of
this module and answers to the questions. These materials delve into subjects
that are within the scope of the module but are not specifically addressed in the
content of the student notes.
1. 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.

Module 5: Using Advanced Dimension Settings vii

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

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.


Module 5: Using Advanced Dimension Settings 1


BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

Overview
!
Working with Levels and Hierarchies
!
Working with Time Dimensions
!
Creating Custom Rollups
!
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.
Topic Objective
To provide an overview of
the module topics and
objectives.
Lead-in
In this module, you will learn
about advanced dimension
types and settings.
2 Module 5: Using Advanced Dimension Settings

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

#
##
#

Working with Levels and Hierarchies
!
Applying Level Settings
!
Defining a Hierarchy
!
Creating Multiple 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.
Topic Objective
To introduce the concept of
levels and hierarchies.
Lead-in
In this section, we will
discuss important settings
and processes that enhance
levels and hierarchies.
Module 5: Using Advanced Dimension Settings 3

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

Applying Level Settings
!

Member Count
!
Key Data Size
!
Key Data Type
!
Level Type
!
Visible


As you click each level in a dimension, you have an assortment of level
properties available that enhance various characteristics of levels. Each property
applies to a level and influences how members in a level are stored and
displayed.
Member Count
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.
Topic Objective
To describe level settings
and tips for using each of
them effectively.
Lead-in
As you click each level in a
dimension, you have an
assortment of level
properties available that
enhance various
characteristics of levels.
Delivery Tip
Open the Dimension Editor
and give an informal
demonstration, clicking
through each of the
properties to show students
how to access properties.
4 Module 5: Using Advanced Dimension Settings

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

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.
Module 5: Using Advanced Dimension Settings 5

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

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.

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




Note
6 Module 5: Using Advanced Dimension Settings

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

Defining a Hierarchy
!
A Hierarchy Is a Set of Members and Levels within a
Dimension
!
By Default, a Dimension Contains One Hierarchy
!
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,
the terms dimension and hierarchy are used interchangeably. However, to
Analysis Server, there is a subtle difference in the meaning of the two terms.
The term hierarchy refers to the set of members in a dimension and the levels to

which the members belong. By default, a dimension contains one hierarchy.
The default hierarchy is defined when you assigned the levels and the Member
Key Columns in a 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.

Topic Objective
To define the term
hierarchy.
Lead-in
The term hierarchy refers to
the set of members in a
dimension and the levels to
which the members belong.
Delivery Tip
Tell students that if they
have created dimensions in
the past, they have already
created hierarchies, possibly
without knowing it. When
you create a dimension, you
define the default hierarchy

for that dimension.
Module 5: Using Advanced Dimension Settings 7

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

Creating Multiple Hierarchies
Department Dimension
Department.Management
Region 1
Department.Region
Region 2
Department A
Department D
Department C
Department B
Manager 1
Department B
Department D
Department C
Department A
Manager 2
Two Hierarchies


Creating multiple hierarchies in a dimension is very straightforward in Analysis
Services. If you have the skills to create multiple dimensions in an OLAP
database, you have the skills to create multiple hierarchies in a dimension.
To create multiple hierarchies in one dimension, perform the following steps in
the Dimension Wizard:
1. For each hierarchy, create a new dimension.

2. At the final step of the wizard, name each dimension and select the Create a
hierarchy of a dimension check box. Type the hierarchy name and click
Finish. The final name format is DimensionName.HierarchyName.

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.

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

Topic Objective
To describe how to create
multiple hierarchies in a
single dimension.
Lead-in
Creating multiple hierarchies
in a dimension is very

straightforward in Analysis
Services.
Explain how the
Department dimension
summarizes the leaf-level
members in two
independent ways.

Ask students if they can
think of a use for multiple
hierarchies in their own
companies.
Note
Note
8 Module 5: Using Advanced Dimension Settings

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

Grouping Members into Levels
All
All
Large Level
Large Level
Grouping
Grouping
Level
Level
A
A



G
G
H
H


O
O
O
O


Z
Z


In a dimensional structure, there can be no more than 64,000 direct children. In
other words, a single parent is limited to 64,000 children. Practically speaking,
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
on a parent.
Using the Grouping Property
The level property Grouping solves the potential problem of the 64,000
children limitation. Grouping creates intermediate parents in the level. The
children are broken into meaningful hierarchies, which makes the members at
the level more easily understood by users and eliminates the problem of having
more than 64,000 children per parent.

You have no direct control over the number of groups created by

automatic grouping. Automatic grouping creates approximately the same
number of groups as there are members in each group by using the square root
of the number of members. This strategy enables grouping to automatically
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.

Topic Objective
To describe how to create
intermediate parents to
group members of a
particular level.
Lead-in
In a dimensional structure,
there can be no more than
64,000 direct children. In
other words, a single parent
is limited to 64,000 children.
Delivery Tips
Be aware that this slide is a
build slide.

First, introduce the large
level that does not contain
higher classification in the
dimension table. Next, build
the Grouping Level, and
tell students that the
Grouping Level can be
created by setting the

Grouping property, or by
creating expressions in
Member Key and Member
Name Columns.

Tell students that they will
create both types of levels in
the upcoming labs.
Note
Module 5: Using Advanced Dimension Settings 9

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

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)


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.

Note
10 Module 5: Using Advanced Dimension Settings

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

#
##
#

Working with Time Dimensions
!
Using the Dimension Wizard to Create Dates
!
Using a Separate Table for Dates
!
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.


Topic Objective
To introduce the concept of
Time dimensions.
Lead-in
Nearly every OLAP
database has a Time
dimension.
Module 5: Using Advanced Dimension Settings 11

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

Using the Dimension Wizard to Create Dates
!
When Possible, It Is Best Practice to Use the Dimension
Wizard When Creating Time Dimensions
!
Contains Built-In Intelligence

!
Defines Entire Hierarchy From a Single Date/Time
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
new Time dimension by using the Dimension Wizard instead of the Dimension
Editor. The Dimension Wizard constructs an entire hierarchy from a single
Date/Time column and uses built-in intelligence to define the levels.
Any valid SQL statement can be used for the Member Key Column and the
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.
Topic Objective
To describe the benefits of
using the Dimension Wizard
when creating Time
dimensions.
Lead-in
The Dimension Wizard can
construct an entire hierarchy
from a single Date/Time
column.
Key Point
When you create a new
Time dimension, the best
practice is to create it by
using the Dimension Wizard
instead of the Dimension
Editor.
12 Module 5: Using Advanced Dimension Settings

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

Using a Separate Table for Dates

!
Contains Additional Date Properties
!
Reduces Storage Space
!
Is Used with Multiple Fact Tables


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.
Topic Objective
To explain the benefits of
creating a separate date
dimension table in the cube
data source.
Lead-in
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.
Module 5: Using Advanced Dimension Settings 13

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

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.

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.


Note
14 Module 5: Using Advanced Dimension Settings

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

Setting Time Dimension Properties
!
Some MDX Functions Use Time Dimension Properties
!
Third-Party Products Use Time Properties
!
Several Time Dimension Level Properties Exist
!
The Type Property Has No Effect on the Analysis Server


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.
Topic Objective
To describe Time dimension
properties and explain why
they are used in cubes.
Lead-in
By flagging certain
dimensions as Time, and
certain levels in a dimension
as specific units of time, you
can take advantage of time-
intelligent MDX functions.
Module 5: Using Advanced Dimension Settings 15

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

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.

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.


Note
16 Module 5: Using Advanced Dimension Settings

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

Creating a Fiscal Date Hierarchy

!
May Not Begin on January 1
!
Is Used for Internal Reporting Purposes
!
Causes the Need for Multiple Hierarchies within a Time
Dimension
$
Fiscal date hierarchy
$
Calendar date hierarchy


One irregularity that frequently arises when dealing with time is that many
organizations use a fiscal year in which the starting day of the year is not
January 1.
Sometimes, a company uses a fiscal year for internal reporting purposes but
must still use a calendar year when communicating with customers. The same
lowest level data—for example, March 1, 2000—could be the first month of a
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.
Topic Objective
To describe the need for
fiscal date hierarchies.
Lead-in
One irregularity that

frequently arises when
dealing with time is that
many organizations use a
fiscal year—when the
starting day of the year is
not January 1.
Delivery Tips
Tell students that they will
be creating a fiscal
hierarchy in the lab.

Ask students if they use
multiple time hierarchies in
their own reporting systems.
Module 5: Using Advanced Dimension Settings 17

BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY

Building a Date Hierarchy from a String
!
May Not Be Able to Create New Tables within the Data
Warehouse
!
Can Use Dates Stored as Strings
!
Can Use Expressions to Define Time Dimensions


You do not always have control over the source RDBMS that defines the
dimensions and cubes. Often, you are provided with the data warehouse and

you must work with it without having the flexibility of creating new tables to
define dimensions and cubes.
When building a Time hierarchy from a Date/Time column, you can use
Analysis Manager’s built-in date intelligence to define Time dimension levels
and members. However, in many systems, dates are stored as strings and no
Date/Time columns exist from which to define Time dimension levels.
When you only have string columns to build Time dimensions, you can use
expressions in the Member Key Column and Member Name Column to
define the levels and members. In addition, you can update the dimension and
level Type properties to specify the Time dimensions.

Topic Objective
To describe the issue of
using strings to define Time
dimensions.
Lead-in
You do not always have
control over the source
relational database
management system
(RDBMS) that defines the
dimensions and cubes.
Delivery Tips
For more information about
using expressions to define
dimensions, see module 4,
“Building Dimensions Using
the Dimension Editor,” in
course 2074A, Designing
and Implementing OLAP

Solutions with Microsoft
SQL Server 2000.

Tell students that they will
be creating a Time
dimension by using
expressions in the lab.

×