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

Tài liệu McGraw-Hill - Delivering Business Intelligence with Microsoft SQL Server 2008 (2009)01 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 (586.51 KB, 40 trang )


Microsoft® SQL Server™ 2008

Delivering
Business
Intelligence


About the Author
Brian Larson is a Phi Beta Kappa graduate of Luther College in Decorah, Iowa,
with degrees in physics and computer science. Brian has 23 years of experience in the
computer industry and 19 years experience as a consultant creating custom database
applications. He is currently the Chief of Technology for Superior Consulting
Services in Minneapolis, Minnesota, a Microsoft Consulting Partner for Reporting
Services. Brian is a Microsoft Certified Solution Developer (MCSD) and a
Microsoft Certified Database Administrator (MCDBA).
Brian served as a member of the original Reporting Services development team
as a consultant to Microsoft. In that role, he contributed to the original code base of
Reporting Services.
Brian has presented at national conferences and events, including the SQL
Server Magazine Connections Conference, the PASS Community Summit, and
the Microsoft Business Intelligence Conference, and has provided training and
mentoring on Reporting Services across the country. He has been a contributor and
columnist for SQL Server Magazine. In addition to this book, Brian is the author of
Microsoft SQL Server 2008 Reporting Services, also from McGraw-Hill.
Brian and his wife Pam have been married for 23 years. Pam will tell you that
their first date took place at the campus computer center. If that doesn’t qualify
someone to write a computer book, then I don’t know what does. Brian and Pam
have two children, Jessica and Corey.

About the Technical Editor


Robert M. Bruckner is a senior developer with the SQL Server Reporting Services
(SSRS) product group at Microsoft. Prior to this role at Microsoft, he researched,
designed, and implemented database and business intelligence systems as a scientific
researcher at Vienna University of Technology, and as a system architect at T-Mobile
Austria. Robert joined the Reporting Services development team in early 2003
and has been specializing on the data and report processing engine that is running
inside server and client components of Reporting Services. Ever since the initial
beta release of SSRS 2000, Robert has been sharing insights, tips, tricks, and expert
advice about RDL, data and report processing, and SSRS in general, helping people
learn about, understand, and succeed with SSRS (e.g., by posting on newsgroups
and MSDN forums, publishing whitepapers, and speaking at conferences). Robert
holds Master and PhD degrees with highest distinctions in Computer Science from
Vienna University of Technology, Austria.


Microsoft® SQL Server™ 2008

Delivering
Business
Intelligence
Brian Larson

New York Chicago San Francisco Lisbon
London Madrid Mexico City Milan
New Delhi San Juan Seoul Singapore
Sydney Toronto


Copyright © 2009 by The McGraw-Hill Companies. All rights reserved. Except as permitted under the United States Copyright
Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database

or retrieval system, without the prior written permission of the publisher.
ISBN: 978-0-07-154945-5
MHID: 0-07-154945-5
The material in this eBook also appears in the print version of this title: ISBN: 978-0-07-154944-8, MHID: 0-07-154944-7.
All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of a
trademarked name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention of
infringement of the trademark. Where such designations appear in this book, they have been printed with initial caps.
McGraw-Hill eBooks are available at special quantity discounts to use as premiums and sales promotions, or for use in
corporate training programs. To contact a representative please visit the Contact Us page at www.mhprofessional.com.
Information has been obtained by McGraw-Hill from sources believed to be reliable. However, because of the possibility of
human or mechanical error by our sources, McGraw-Hill, or others, McGraw-Hill does not guarantee the accuracy, adequacy,
or completeness of any information and is not responsible for any errors or omissions or the results obtained from the use of
such information.
TERMS OF USE
This is a copyrighted work and The McGraw-Hill Companies, Inc. (“McGraw-Hill”) and its licensors reserve all rights in and
to the work. Use of this work is subject to these terms. Except as permitted under the Copyright Act of 1976 and the right to
store and retrieve one copy of the work, you may not decompile, disassemble, reverse engineer, reproduce, modify, create
derivative works based upon, transmit, distribute, disseminate, sell, publish or sublicense the work or any part of it without
McGraw-Hill’s prior consent. You may use the work for your own noncommercial and personal use; any other use of the work
is strictly prohibited. Your right to use the work may be terminated if you fail to comply with these terms.
THE WORK IS PROVIDED “AS IS.” McGRAW-HILL AND ITS LICENSORS MAKE NO GUARANTEES OR WARRANTIES AS TO THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TO BE OBTAINED FROM
USING THE WORK, INCLUDING ANY INFORMATION THAT CAN BE ACCESSED THROUGH THE WORK VIA
HYPERLINK OR OTHERWISE, AND EXPRESSLY DISCLAIM ANY WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
PURPOSE. McGraw-Hill and its licensors do not warrant or guarantee that the functions contained in the work will meet your
requirements or that its operation will be uninterrupted or error free. Neither McGraw-Hill nor its licensors shall be liable to
you or anyone else for any inaccuracy, error or omission, regardless of cause, in the work or for any damages resulting therefrom. McGraw-Hill has no responsibility for the content of any information accessed through the work. Under no circumstances
shall McGraw-Hill and/or its licensors be liable for any indirect, incidental, special, punitive, consequential or similar damages
that result from the use of or inability to use the work, even if any of them has been advised of the possibility of such damages.
This limitation of liability shall apply to any claim or cause whatsoever whether such claim or cause arises in contract, tort or
otherwise.



This book is dedicated to my parents. To my father, Robert, who even after 40-plus years
as a junior high mathematics teacher and computer instructor, has a love of teaching. He has
shown me a real commitment to sharing knowledge with others. To my mother, Beverly,
who was my first editor, coaching me through elementary school papers on this state or that
president. She taught me the value of sticking with a job and seeing it through to the end.
I owe them both a debt of love, caring, and support that can never be adequately repaid.


This page intentionally left blank


Contents at a Glance


Part I

Business Intelligence

Chapter 1

Equipping the Organization for Effective Decision Making   . . . . . . . . . . . .

3

Chapter 2

Making the Most of What You’ve Got—Using Business Intelligence   . . . . . . 13


Chapter 3

Seeking the Source—The Source of Business Intelligence   . . . . . . . . . . . . 25

Chapter 4

One-Stop Shopping—The Unified Dimensional Model   . . . . . . . . . . . . . . 43

Chapter 5

First Steps—Beginning the Development of Business Intelligence   . . . . . . . 61

Part II

Defining Business Intelligence Structures

Chapter 6

Building Foundations—Creating Data Marts   . . . . . . . . . . . . . . . . . . . . 91

Chapter 7

Transformers—Integration Services Structure and Components   . . . . . . . . 135

Chapter 8

Fill ’er Up—Using Integration Services for Populating Data Marts   . . . . . . . 233

Part III


Analyzing Cube Content

Chapter 9

Cubism—Measures and Dimensions   . . . . . . . . . . . . . . . . . . . . . . . . . 295

Chapter 10

Bells and Whistles—Special Features of OLAP Cubes   . . . . . . . . . . . . . . . 331

Chapter 11

Writing a New Script—MDX Scripting   . . . . . . . . . . . . . . . . . . . . . . . . . 389

Chapter 12

Pulling It Out and Building It Up—MDX Queries   . . . . . . . . . . . . . . . . . . 433

Part IV

Mining

Chapter 13

Panning for Gold—Introduction to Data Mining   . . . . . . . . . . . . . . . . . . 469

Chapter 14

Building the Mine—Working with the Data Mining Model   . . . . . . . . . . . . 495


Chapter 15

Spelunking—Exploration Using Data Mining   . . . . . . . . . . . . . . . . . . . . 529

vii




viii

Delivering Business Intelligence with Microsoft SQL Server 2008

Part V

Delivering

Chapter 16

On Report—Delivering Business Intelligence with Reporting Services   . . . . . 561

Chapter 17

Falling into Place—Managing Reporting Services Reports   . . . . . . . . . . . . 643

Chapter 18

Let’s Get Together—Integrating OLAPwith Your Applications   . . . . . . . . . . 683

Chapter 19


Another Point of View—Excel Pivot Tablesand Pivot Charts   . . . . . . . . . . . 723



Index   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741




Contents
Acknowledgments   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
The Maximum Miniatures Databases and Other Supporting Materials   . . . . . . xviii



Part I

Business Intelligence

Chapter 2

Equipping the Organization for Effective Decision Making  . . . . . . . . . . . . .

3

Effective Decision Making  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Who Is a Decision Maker?  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
What Is an Effective Decision?  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Keys to Effective Decision Making  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Are We Going Hither or Yon?  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Is Your Map Upside-Down?  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Panicked Gossip, the Crow’s Nest, or the Wireless  . . . . . . . . . . . . . . . . . . . . . . .
Business Intelligence  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Business Intelligence and Microsoft SQL Server 2008  . . . . . . . . . . . . . . . . . . . . .

Chapter 1

4
4
5
6
6
8
9
11
12

Making the Most of What You’ve Got—Using Business Intelligence  . . . . . . . 13
What Business Intelligence Can Do for You  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
When We Know What We Are Looking For  . . . . . . . . . . . . . . . . . . . . . . . . . . .
Discovering New Questions and Their Answers  . . . . . . . . . . . . . . . . . . . . . . . . .
Business Intelligence at Many Levels  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Top of the Pyramid  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mid-Level  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Broad Base  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Maximum Miniatures, Inc.  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Business Needs  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Current Systems  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Building the Foundation  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


Chapter 3























14
14
15
16
16

19
19
20
20
21
23

Seeking the Source—The Source of Business Intelligence  . . . . . . . . . . . . . 25
Seeking the Source  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Transactional Data  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

26
26

ix




x

Delivering Business Intelligence with Microsoft SQL Server 2008
The Data Mart  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Features of a Data Mart  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Data Mart Structure  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Snowflakes, Stars, and Analysis Services  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Chapter 4

29

30
32
40

One-Stop Shopping—The Unified Dimensional Model  . . . . . . . . . . . . . . . 43
Online Analytical Processing  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Building OLAP—Out of Cubes  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Features of an OLAP System  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Architecture  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Disadvantages  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Read-Only  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Unified Dimensional Model  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Structure  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Advantages  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Tools of the Trade  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Chapter 5


















44
45
48
50
52
52
53
53
58
60

First Steps—Beginning the Development of Business Intelligence  . . . . . . . 61
The Business Intelligence Development Studio  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Visual Studio  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Navigating the Business Intelligence Development Studio  . . . . . . . . . . . . . . . . . .
Business Intelligence Development Studio Options  . . . . . . . . . . . . . . . . . . . . . .
The SQL Server Management Studio  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The SQL Server Management Studio User Interface  . . . . . . . . . . . . . . . . . . . . . .
Don Your Hardhat  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .










62
62
64
78
82
82
88

Part II

Defining Business Intelligence Structures

Chapter 6

Building Foundations—Creating Data Marts  . . . . . . . . . . . . . . . . . . . . . 91
Data Mart  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Who Needs a Data Mart Anyway?  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Designing a Data Mart  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Decision Makers’ Needs  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Available Data  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Data Mart Structures  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a Data Mart Using the SQL Server Management Studio  . . . . . . . . . . . . . . .
Creating a Data Mart Using the Business Intelligence Development Studio  . . . . . . . . .

92
92
95
95

96
97
109
117




Contents
Table Compression  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Types of Table Compression  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
The Benefits of Integration  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134

Chapter 7

Transformers—Integration Services Structure and Components  . . . . . . . . . 135
Integration Services  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Package Structure  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Package Items  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Control Flow  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Data Flow  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Getting Under the Sink  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Chapter 8









136
136
149
149
183
231

Fill ’er Up—Using Integration Services for Populating Data Marts  . . . . . . . . 233
Package Development Features  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Give It a Try  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Programming in Integration Services Packages  . . . . . . . . . . . . . . . . . . . . . . . . .
Package Development Tools  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Migrating from SQL Server 2000 DTS Packages  . . . . . . . . . . . . . . . . . . . . . . . . .
Putting Integration Services Packages into Production  . . . . . . . . . . . . . . . . . . . . . . . . .
Deploying Integration Services Packages  . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Change Data Capture  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Change Data Capture Architecture  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Loading a Data Mart Table from a Change Data Capture Change Table  . . . . . . . . . . .
Loading a Fact Table  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Meanwhile, Back at the Unified Dimensional Model (UDM)  . . . . . . . . . . . . . . . . . . . . . .















234
234
241
250
262
263
263
267
267
272
277
292

Part III

Analyzing Cube Content

Chapter 9

Cubism—Measures and Dimensions  . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
Building in Analysis Services  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a Cube  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Measures  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Measure Groups  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Made-up Facts—Calculated Measures  . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
It Doesn’t Add Up—Measure Aggregates Other Than Sum  . . . . . . . . . . . . . . . . . .
Dimensions  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Managing Dimensions  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Relating Dimensions to Measure Groups  . . . . . . . . . . . . . . . . . . . . . . . . . . . . .











296
296
302
303
305
309
314
314
320

xi





xii

Delivering Business Intelligence with Microsoft SQL Server 2008
Types of Dimensions  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
Slowly Changing Dimensions  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
You Are Special  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329

Chapter 10

Bells and Whistles—Special Features of OLAP Cubes  . . . . . . . . . . . . . . . . . 331
Where No Cube Has Gone Before  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Deploying and Processing  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Deploying from the Business Intelligence Development Studio  . . . . . . . . . . . . . . .
Deploying from the Analysis Services Deployment Wizard  . . . . . . . . . . . . . . . . . .
Additional Cube Features  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Linked Objects  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Business Intelligence Wizard  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Key Performance Indicators  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Actions  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Partitions  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Aggregation Design  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Perspectives  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Translations  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
More Sophisticated Scripting  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Chapter 11

















Writing a New Script—MDX Scripting  . . . . . . . . . . . . . . . . . . . . . . . . . . 389
Terms and Concepts  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Where Are We?  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Getting There from Here  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Putting MDX Scripting to Work  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Cube Security  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
This Year to Last Year Comparisons and Year-to-Date Rollups  . . . . . . . . . . . . . . . .
Extracting Data from Cubes  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Chapter 12

332
333
334
340
351
351

353
355
362
365
380
385
386
387

390
390
409
416
416
426
431

Pulling It Out and Building It Up—MDX Queries  . . . . . . . . . . . . . . . . . . . 433
The MDX SELECT Statement  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Basic MDX SELECT Statement  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Additional Tools for Querying  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Additional Dimensions  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Additional MDX Syntax  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Operators  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Functions  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Can You Dig It?  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .











434
435
446
457
458
459
461
465




Contents

Part IV

Mining

Chapter 13

Panning for Gold—Introduction to Data Mining  . . . . . . . . . . . . . . . . . . . 469
What Is Data Mining?  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Order from Chaos  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Tasks Accomplished by Data Mining  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Steps for Data Mining  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Data Mining Algorithms  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Microsoft Decision Trees  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Microsoft Linear Regression  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Microsoft Naïve Bayes  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Microsoft Clustering  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Microsoft Association Rules  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Microsoft Sequence Clustering  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Microsoft Time Series  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Microsoft Neural Network  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Microsoft Logistic Regression Algorithm  . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Grab a Pick Axe  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Chapter 14

Building the Mine—Working with the Data Mining Model  . . . . . . . . . . . . 495
Data Mining Structure  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Data Columns  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Data Mining Model  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Training Data Set  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mining Model Viewer  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Microsoft Decision Trees  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Microsoft Naïve Bayes  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Microsoft Clustering  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Microsoft Neural Network  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Microsoft Association Rules  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Microsoft Sequence Clustering  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Microsoft Time Series  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Reading the Tea Leaves  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


Chapter 15

470
470
474
480
483
483
484
485
487
488
490
491
493
494
494

496
496
497
497
512
513
517
521
523
524
526
527

528

Spelunking—Exploration Using Data Mining  . . . . . . . . . . . . . . . . . . . . . 529
Mining Accuracy Chart  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530
Column Mapping  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
Lift Chart  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532

xiii




xiv

Delivering Business Intelligence with Microsoft SQL Server 2008
Profit Chart  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Classification Matrix  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Cross Validation  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mining Model Prediction  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A Singleton Query  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A Prediction Join Query  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Data Mining Extensions  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Prediction Query Syntax  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Types of Prediction Queries  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Special Delivery  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .













537
538
539
541
541
545
550
550
552
558

Part V

Delivering

Chapter 16

On Report—Delivering Business Intelligence with Reporting Services  . . . . . 561
Reporting Services  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Report Structure  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Report Delivery  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Report Serving Architecture  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Report Server  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

The Parts of the Whole  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Reporting Services Installation Considerations  . . . . . . . . . . . . . . . . . . . . . . . . .
Creating Reports Using the Tablix Data Region  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A Tablix Data Region Created with the Table Template  . . . . . . . . . . . . . . . . . . . .
A Tablix Data Region Created with the Matrix Template  . . . . . . . . . . . . . . . . . . . .
A Tablix Data Region Created with the List Template  . . . . . . . . . . . . . . . . . . . . .
The Chart Data Region  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Gauge Data Region  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Get Me the Manager  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Chapter 17

562
563
565
566
566
568
571
573
574
591
607
617
634
642

Falling into Place—Managing Reporting Services Reports  . . . . . . . . . . . . 643
Report Manager  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Folders  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

The Report Manager  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Deploying Reports Using the Report Designer  . . . . . . . . . . . . . . . . . . . . . . . . . .
Uploading Reports Using Report Manager  . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Printing from Report Manager  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

644
644
644
645
647
653




Contents
Managing Reports on the Report Server  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Security  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Linked Reports  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Report Caching  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Execution Snapshots  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Report History  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Standard Subscriptions  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Data-Driven Subscriptions  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Ad Hoc Reporting  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Report Model  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Report Builder Basics  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Putting It All Together  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Chapter 18


Let’s Get Together—Integrating OLAPwith Your Applications  . . . . . . . . . . 683
ADOMD.NET  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ADOMD.NET Structure  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ADOMD.NET Example  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using Reporting Services Without the Report Manager  . . . . . . . . . . . . . . . . . . . . . . . . .
URL Access  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Web Service Access  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Report Viewer Control  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Ready-Made Solution  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Chapter 19












684
684
687
693
693
710

715
721

Another Point of View—Excel Pivot Tablesand Pivot Charts  . . . . . . . . . . . . 723
Excel  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating Pivot Tables and Pivot Charts   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Pivot Table  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Pivot Chart  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Great Capabilities, Great Opportunities  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .



654
654
662
663
666
667
668
668
670
670
678
682








724
724
725
735
738

Index   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741

xv


This page intentionally left blank


Acknowledgments

N

o project of this size is the work of a single person. I need to thank a number
of people for their assistance, professionalism, dedication, and support. So, a
gianormous thank you …
To Wendy Rinaldi, who allowed me to lean on her as part editor, part coach, part
literary agent, and part psychoanalyst. Her professionalism, humor, understanding, and
faith truly made this project possible.
To Madhu Bhardwaj, who put up with my temperamental author moments and kept
me on track and organized through two simultaneous book projects.
To Robert Bruckner, who provided vital insight and product knowledge.
To the rest of the McGraw-Hill Professional staff, who saw it through to the end
and made sure there really was a book when all was said and done.

To John Miller, who founded Superior Consulting Services as a place where people
can grow and learn, produce solid technology solutions, serve customers, and have a
good time to boot.
To Jessica and Corey, my children, who allowed me time to pursue this passion.
To my wife, Pam, who continues to be gracious in her understanding of my affliction
with the writing bug. She has given generously of her time to proof and review this
book and its Learn By Doing exercises. Her incredible attention to detail has made this
a better product.
Last, but certainly not least, to you, the reader, who plunked down your hard-earned
cash for this purchase. I hope you view this as a helpful and informative guide to all of
the truly exciting business intelligence features in SQL Server 2008.
All the best,
Brian Larson


xvii




xviii

Delivering Business Intelligence with Microsoft SQL Server 2008

The Maximum Miniatures Databases
and Other Supporting Materials
All of the samples in this book are based on business scenarios for a fictional company
called Maximum Miniatures, Inc. You can download the data, image files, and other
supporting materials from the book’s web page on the McGraw-Hill Professional
website. This download also includes the complete source code for all of the Learn By

Doing activities and the applications demonstrated in the book.
The download is found on this book’s web page at www.mhprofessional.com. Search
for the book’s web page using the ISBN, which is 0071549447. Use the “Code” link
to download the zip file containing the book’s material. Follow the instructions in the
individual zip files to install or prepare each item as needed.


Part #
I

Business Intelligence


This page intentionally left blank


Chapter 1

Equipping the
Organization for Effective
Decision Making
In This Chapter
c
c

Effective Decision Making

Keys to Effective Decision
Making
cBusiness Intelligence





4

Delivering Business Intelligence with Microsoft SQL Server 2008

“Would you tell me please, which way I ought to go from here?” asked Alice.
“That depends a good deal on where you want to get to,” said the Cat.
“I don’t much care where,” said Alice.
“Then, it doesn’t matter which way you go,” said the Cat.
Alice’s Adventures in Wonderland
—Lewis Carroll

L

ife is filled with decisions. Should I have the burger and fries or the salad for
lunch? Should I get my significant other that new watch they’ve had their eye
on, or should I buy them a new vacuum cleaner? Do I invest my holiday bonus
or head for the casino? Should I buy this book or go browse the comics section? (Here
is your first bit of business intelligence: Buy this book!)
The choices we make can have life-changing consequences. Even seemingly trivial
decisions can have big consequences down the road. It’s like your parents always told
you: The key to success in life is to make good choices!

Effective Decision Making
Good decision making is as important in the working world as it is in the rest of our
lives. Every day a number of decisions must be made that determine the direction and
efficiency of the organizations we work for. Decisions are made concerning production,

marketing, and personnel. Decisions are made affecting costs, sales, and margins. Just
as in our personal lives, the key to organizational success is to make good choices. The
organization must have effective decision making.

Who Is a Decision Maker?
Just who is it that must make good choices within an organization? At first blush,
it may seem that only the person at the top, the chief executive officer (CEO), the
president, or the chairperson needs to be an effective decision maker. If that person
makes appropriate strategic decisions, the organization will succeed!
Unfortunately, it is not that easy. There are countless examples throughout history
where absolutely brilliant strategic plans went awry because of poor decisions made
by those responsible for their implementation. As emperor and leader of “La Grande
Armée,” Napoleon Bonaparte had a fairly decent strategic plan for his campaign in
Belgium. However, due to some poor decision making by his marshals, Napoleon
suffered a major defeat at a little place called Waterloo.
Given this, perhaps it is important for the next level of management to be effective
decision makers as well. The chief financial officers (CFOs), CIOs, vice presidents,
assistant chairpersons, and department heads (and marshals of the army) must make


C
h a p t e r 1 :  E q u i p p i n g t h e O r g a n i z a t i o n f o r E f f e c t i v e D e c i s i o n M a k i n g

good choices when creating the policies and setting the priorities to implement
the strategic plan. With all of upper management making effective decisions, the
organization is guaranteed to go places!
In fact, success is not even assured when this is true. Effective plans and policies
created at the top of the organization can be undone by poor decisions made further
down as those plans and policies are put into action. The opposite is also true. Good
decisions made by those working where the rubber meets the road can be quickly

overwhelmed by poor decisions made further up the line.
The answer, then, is to have effective decision makers throughout an organization.
Those lower down the organizational chart will have much better morale and will
invest more energy in an activity if they have some assurance that their efforts will not
be undone by someone higher up. In addition, the success of the person in the corner
office is, in large part, simply a reflection of the effective decisions and successes of the
people who report to them. Effective decision making at every level leads to success.

What Is an Effective Decision?
The organization that has the desired products or services, provided in the proper
place, at the correct time, produced at the appropriate cost, and backed by the necessary
customer support will be successful. This, of course, is fairly obvious. Any business plan
or mission statement worth its salt professes to do just this.
What is not so obvious is how an organization goes about making sure it provides
what is desired, proper, correct, appropriate, and necessary. The answer, as we learned
in the last section, is to have people making effective decisions at all levels of the
organization. But what exactly is an effective decision?

Definition
Effective decisions are choices that move an organization closer to an agreed-on set of goals in a timely manner.
An effective decision moves an organization toward its goals in a timely manner.
This definition is extremely broad. In fact, this makes a good slogan, but is too broad to
be of much use in day-to-day operations. Using this definition, however, we can define
three key ingredients necessary for making effective decisions:
c

First, there must be a set of goals to work toward.

c


Third, information based on those measures must be provided to the decision maker
in a timely manner.

c

Second, there must be a way to measure whether a chosen course is moving toward
or away from those goals.

5


6

Delivering Business Intelligence with Microsoft SQL Server 2008

This information serves as both the foundation for the initial decision making and as
feedback showing the results of the decision. Defining effective decision making is the
easy part. Taking this rather nebulous definition and turning it into concrete business
practices requires a bit more work.

Definition
Foundation information serves as the basis for making a particular decision as that decision is being made.

Definition
Feedback information is used to evaluate the effectiveness of a particular decision after that decision is made.

Keys to Effective Decision Making
In the previous section, we learned that three keys are necessary for effective decision
making: specific goals, concrete measures, and timely foundation and feedback information,
as shown in Figure 1-1. In this section, we take a detailed look at each of these three keys

to learn how to encourage effective decision making.

Are We Going Hither or Yon?
In Mel Brooks’s film, The Producers, Max and Leopold set out to stage an absolutely
horrible Broadway musical, certain to fail, so they can abscond with the investor’s
money. Aside from this entertaining exception, organizations do not set out to fail.
On the contrary, they come together, raise capital, create organizational charts,

Effective
Decisions

te
re s
nc ure
Co eas
M

Sp
Go ecif
als ic



Foundation and
Feedback Information

Figure 1-1

Three keys to effective decision making



×