Post on 16-Oct-2020
ffirs.indd ivffirs.indd iv 9/15/2012 11:07:43 AM9/15/2012 11:07:43 AM
PROFESSIONAL
MICROSOFT® SQL SERVER® 2012
ANALYSIS SERVICES WITH MDX AND DAX
INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxv
� PART I INTRODUCTION
CHAPTER 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
� PART II DESIGNING MULTIDIMENSIONAL BISM
CHAPTER 2 A First Look at Multidimensional BISM . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
CHAPTER 3 Understanding MDX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
CHAPTER 4 Data Sources and Data Source Views . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
CHAPTER 5 Dimension Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
CHAPTER 6 Cube Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
CHAPTER 7 Administration and Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
� PART III ADVANCED TOPICS IN BISM
CHAPTER 8 Advanced Dimension Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
CHAPTER 9 Advanced Cube Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
CHAPTER 10 Designing Mulitdimensional BISM for Performance . . . . . . . . . . . . . . . 419
CHAPTER 11 Optimizing Query Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
CHAPTER 12 Data Mining, Multidimensional BISM, and
Data Mining Add-ins for Offi ce 2010 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
CHAPTER 13 SQL Integration Services and SQL Server
Reporting Services with Multidimensional BISM Models . . . . . . . . . . . 597
CHAPTER 14 Securing Multidimensional BISM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671
� PART IV POWERPIVOT AND TABULAR BISM
CHAPTER 15 Self-Service Business Intelligence and Introduction to
PowerPivot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719
CHAPTER 16 A First Look at Tabular BISM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .741
ffirs.indd iffirs.indd i 9/15/2012 11:07:42 AM9/15/2012 11:07:42 AM
CHAPTER 17 Enhancing Your Tabular BISM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 773
CHAPTER 18 Introduction to DAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 813
CHAPTER 19 Advanced Topics in DAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 867
CHAPTER 20 Analyzing Multidimensional and Tabular BISMs In Excel . . . . . . . . . . . 907
CHAPTER 21 PowerPivot for SharePoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .969
� PART V ADVANCED TOPICS WITH TABULAR BISM AND INTEGRATION WITH POWER VIEW
CHAPTER 22 Introduction and Confi guration of Power View . . . . . . . . . . . . . . . . . . .999
CHAPTER 23 Visual Analytics with Power View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1031
INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1077
ffirs.indd iiffirs.indd ii 9/15/2012 11:07:43 AM9/15/2012 11:07:43 AM
PROFESSIONAL
Microsoft® SQL Server® 2012
Analysis Services with MDX and DAX
ffirs.indd iiiffirs.indd iii 9/15/2012 11:07:43 AM9/15/2012 11:07:43 AM
ffirs.indd ivffirs.indd iv 9/15/2012 11:07:43 AM9/15/2012 11:07:43 AM
PROFESSIONAL
Microsoft® SQL Server® 2012
Analysis Services with MDX and DAX
Sivakumar HarinathRonald Pihlgren
Denny Guang-Yeu LeeJohn Sirmon
Robert M. Bruckner
ffirs.indd vffirs.indd v 9/15/2012 11:07:43 AM9/15/2012 11:07:43 AM
Professional Microsoft® SQL Server® 2012 Analysis Services with MDX and DAX
Published byJohn Wiley & Sons, Inc.10475 Crosspoint BoulevardIndianapolis, IN 46256www.wiley.com
Copyright © 2012 by Sivakumar Harinath, Ronald Pihlgren, Denny Guang-Yeu Lee, John Sirmon, and Robert M. Bruckner
Published by John Wiley & Sons, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-1-118-10110-0ISBN: 978-1-118-22343-7 (ebk)ISBN: 978-1-118-23708-3 (ebk)ISBN: 978-1-118-26209-2 (ebk)
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifi cally disclaim all warranties, including without limitation warranties of fi tness for a particular purpose. No warranty may be created or extended by sales or pro-motional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the pub-lisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Web site may provide or recommendations it may make. Further, readers should be aware that Internet Web sites listed in this work may have changed or disappeared between when this work was written and when it is read.
For general information on our other products and services please contact our Customer Care Department within the United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with stan-dard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com. For more information about Wiley products, visit www.wiley.com.
Library of Congress Control Number: 2012933620
Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affi liates, in the United States and other coun-tries, and may not be used without written permission. Microsoft and SQL Server are registered trademarks of Microsoft Corporation. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc., is not associated with any product or vendor mentioned in this book.
ffirs.indd viffirs.indd vi 9/15/2012 11:07:44 AM9/15/2012 11:07:44 AM
Thanks to my wife Shreepriya and my kids Praveen
and Divya for their love and patience.
—Sivakumar Harinath
Thanks to my wife Nujsaran for her continual
support, understanding, and love. Thanks also to Siva
for the opportunity.
—Ron Pihlgren
To the patience and love from Samantha, Isabella, and
Hua-Ping.
—Denny Guang-Yeu Lee
Dedicated to my parents.
—Robert M. Bruckner
ffirs.indd viiffirs.indd vii 9/15/2012 11:07:44 AM9/15/2012 11:07:44 AM
ffirs.indd viiiffirs.indd viii 9/15/2012 11:07:44 AM9/15/2012 11:07:44 AM
ABOUT THE AUTHORS
SIVAKUMAR HARINATH was born in Chennai, India. He has a Ph.D. in Computer Science from the University of Illinois at Chicago. His thesis title was “Data Management Support for Distributed Data Mining of Large Datasets over High Speed Wide Area Networks.” He has worked for Newgen Software Technologies (P) Ltd; IBM Toronto Labs, Canada; National Center for Data Mining, University of Illinois at Chicago; and has been at Microsoft since February of 2002. Siva started as a Software Design Engineer in Test (SDET) in the Analysis Services Performance team, and currently is a Senior Program Manager in the Analysis Services team. His other interests include high-performance computing, distributed systems, and high-speed networking.
Siva is married to Shreepriya and has twins, Praveen and Divya. His personal interests include travel, games, and sports (in particular carrom, chess, racquet ball, and board games). Siva has co-authored books Professional Microsoft SQL Server Analysis Services 2005 with MDX (Wrox, 2006), MDX Solutions 2nd edition (Wiley, 2006), Professional Microsoft SQL Server AnalysisServices 2008 with MDX (Wrox, 2009), and Professional Microsoft PowerPivot for Excel andSharePoint (Wrox, 2010). You can reach Siva at sivakumar.harinath@microsoft.com.
RONALD PIHLGREN is a native of Chicago, Illinois. He has a Bachelor of Science degree in Computer Science from DePaul University. A 17-year veteran at Microsoft, he is currently a Senior Software Development Engineer in Test on the SQL Server Analysis Services team. He was one of the principal tech reviewers for the book Professional Microsoft SQL Server Analysis Services 2008 with MDX(Wrox, 2009) and was one of the co-authors of the book Professional Microsoft PowerPivot forExcel and SharePoint (Wrox, 2010). He has a blog at http://ronaldpihlgren.wordpress.com.
DENNY GUANG-YEU LEE is a Technical Principal Program Manager within Microsoft based out of Redmond, WA. He is one of the original core members of Microsoft Hadoop on Windows and Azure and had helped bring Hadoop into Microsoft. In addition to Big Data, he was the Data Warehousing and BI Group Lead for the SQL Customer Advisory team and co-creator of the SSAS Maestros course.
As consulting architect enjoying working on complex technical problems, Lee has also become a SME in web analytics and healthcare. He is avid in social media (@dennylee) and continuously uses the forum to share deep technical learning. Examples of his work can be found in books ranging from Analysis Services to Healthcare Informatics (http://dennyglee.com/books-2/), comprehen-sive technical guides including Analysis Services Performance and Operations Guides (http://dennyglee.com/articles/), and in his blogs at both sqlcat.com and dennyglee.com.
ffirs.indd ixffirs.indd ix 9/15/2012 11:07:44 AM9/15/2012 11:07:44 AM
x x ABOUT THE AUTHORS
JOHN SIRMON is a Senior Program Manager with the SQL Server Customer Advisory team at Microsoft. He has worked for Microsoft since March 2001 and began working with Microsoft SQL Server over 10 years ago when he began his professional career as a consultant at PricewaterhouseCoopers. He has extensive development experience with Microsoft Visual Studio and all the components of the Microsoft BI Stack. His specialties include Analysis Services perfor-mance tuning, Reporting Services, SharePoint integration, troubleshooting Kerberos Authentication, and PowerPivot for SharePoint. John has presented topics ranging from Reporting Services SharePoint integration to Analysis Services at SQL Server PASS Summits and Microsoft TechReady conferences. John holds a BS degree in Business Administration with a minor in MIS from the Citadel, the Military College of South Carolina. In his spare time he is the lead singer/guitarist of a local rock band in Charlotte, NC. John lives in Lake Wylie, SC, with his wife, two sons, and their two bloodhounds.
ROBERT M. BRUCKNER is a Principal Software Architect and developer with the Microsoft SQL Server division. Robert is responsible for the technical architecture of SQL Server Reporting Services including Power View. One of Robert’s core areas has been the design and development of the scal-able report processing engine utilized by Reporting Services and Power View. Power View is an enhancement of Reporting Services 2012, enabling end users to easily and interactively visualize data, quickly gain analytical insights, and simply have fun exploring data!
Prior to joining Microsoft in 2003, Robert researched, designed, and implemented database and business intelligence systems as a system architect at T-Mobile Austria, and as a researcher at Vienna University of Technology, Austria. Robert holds Masters and PhD degrees with highest dis-tinctions in Computer Science from Vienna University of Technology, and holds several patents.
Anyone good with a search engine can fi nd thousands of Robert’s past postings on public news-groups and MSDN forums sharing his insights, tips, tricks, and expert advice related to Reporting Services and other SQL Server technologies. Robert has co-authored books on SQL Server Reporting Services as well as Analysis Services. Robert regularly presents at industry conferences and also maintains a popular blog at http://blogs.msdn.com/robertbruckner. In his spare time, Robert enjoys mountain biking, skiing, and reading.
ffirs.indd xffirs.indd x 9/15/2012 11:07:44 AM9/15/2012 11:07:44 AM
ABOUT THE CONTRIBUTORS
ADAM JORGENSEN is a SQL Server MVP and President of Pragmatic Works Consulting. He also serves as a Director for the Professional Association of SQL Server (PASS). His focus is on using his over 12 years of experience to mentor executives and teams to maximize their insight and execution based on improved analytics and data performance. He lives in Jacksonville, FL and is a regular speaker at SQL Saturdays, SQL Rally, and PASS Summit events. You can catch up with Adam at AdamJorgensen.com or @AJBigData.
DUSTIN RYAN is Senior Business Intelligence Consultant with Pragmatic Works. He began work-ing with Pragmatic Works as a Junior Business Intelligence Consultant in 2008. Dustin’s special-ties include Reporting Services, Integration Services, and Analysis Services. Dustin has worked as a technical editor for the book Knight’s 24-Hour Trainer: Microsoft SQL Server 2008 IntegrationServices (Wiley, 2009). You can fi nd Dustin speaking at community events such as SQL Saturdays, Code Camps, and various PASS events. Dustin blogs regularly at http://sqldusty.wordpress.com and http://www.bidn.com.
Dustin is a native of Jacksonville, Florida and is married to his beautiful wife, Angela, and is the father of their two amazing children, Dallas and Bradley. In his spare time, Dustin enjoys spending time with his family and serving at his church.
CHRIS PRICE is a Senior Business Intelligence Consultant with Pragmatic Works based out of Lakeland, Florida. He has a BS degree in Management Information Systems and a Masters of Business Administration, both from the University of South Florida. He began his career 12 years ago as a developer and has extensive experience across a wide range of Microsoft technologies. His current interests include ETL, Data Integration, Analysis Services, SharePoint and Big Data. Chris regularly presents at SQL Saturdays, Code Camps, and other community events such as 24 Hours of PASS. You can follow Chris on his blog at http://bidn.com/blogs/cprice1979/ or on Twitter at @BluewaterSQL.
ffirs.indd xiffirs.indd xi 9/15/2012 11:07:44 AM9/15/2012 11:07:44 AM
ffirs.indd xiiffirs.indd xii 9/15/2012 11:07:45 AM9/15/2012 11:07:45 AM
EXECUTIVE EDITOR
Robert Elliott
PROJECT EDITOR
Tom Dinse
TECHNICAL EDITORS
Leon Cyril
Wayne Robertson
Sergey Volegov
PRODUCTION EDITOR
Daniel Scribner
COPY EDITOR
San Dee Phillips
EDITORIAL MANAGER
Mary Beth Wakefi eld
FREELANCER EDITORIAL MANAGER
Rosemarie Graham
ASSOCIATE DIRECTOR OF MARKETING
David Mayhew
MARKETING MANAGER
Ashley Zurcher
BUSINESS MANAGER
Amy Knies
PRODUCTION MANAGER
Tim Tate
VICE PRESIDENT AND EXECUTIVE GROUP
PUBLISHER
Richard Swadley
VICE PRESIDENT AND EXECUTIVE PUBLISHER
Neil Edde
ASSOCIATE PUBLISHER
Jim Minatel
PROJECT COORDINATOR, COVER
Katie Crocker
PROOFREADERS
Scott Klemp, Word One
Paul Sagan, Word One
Louise Watson, Word One
INDEXER
Robert Swanson
COVER DESIGNER
Ryan Sneed
COVER IMAGE
© braverabbit / iStockPhoto
CREDITS
ffirs.indd xiiiffirs.indd xiii 9/15/2012 11:07:45 AM9/15/2012 11:07:45 AM
ffirs.indd xivffirs.indd xiv 9/15/2012 11:07:45 AM9/15/2012 11:07:45 AM
ACKNOWLEDGMENTS
WOW!!! IT HAS BEEN AN AMAZING 10 MONTHS from when we started writing this book. The fi rst edition of this book started when Siva jokingly mentioned to his wife the idea of writing a book on SQL Server Analysis Services 2005. She took it seriously and motivated him to start working on the idea in October 2003. Because the fi rst two editions were well received, we identifi ed co-authors for the new edition. All the co-authors of this book are part of the Microsoft SQL Server team.
As always, there are so many people who deserve mentioning that we are afraid we will miss some-one. If you are among those missed, please accept our humblest apologies. We fi rst need to thank the managers of each co-author for their support. Next we thank our colleagues on the Analysis Services and Reporting Services team for their help and support with improving the content of the book, drawing on their expertise from proven best practices from large-scale customer deployments of Analysis Services and Reporting Services. We thank our editors, Bob Elliott and Tom Dinse, who supported us right from the beginning, and also prodded us along, which was necessary to make sure the book published on time. We thank Kay Unkroth, Wei Zou, Wee Hyong Tok, Karen Aleksanyan from SQL Server team for their contributions for Chapters 3, 12, 13, 18, and 19. In addition, the authors thank Adam Jorgensen, Dustin Ryan, and Chris Price from Pragmatic Works for their contributions to Chapters 8, 9, 10, 11, 17, 20, and 21. We would like to thank our technical reviewers Leon Cyril, Sergey Volegov, and Wayne Robertson who graciously offered us their assis-tance and signifi cantly helped in improving the content and samples in the book.
Most importantly, we owe our deepest thanks to our wonderful families. Without their support and sacrifi ce, this book would have become one of those many projects that begins and never fi nishes. Our families truly took the brunt of it and sacrifi ced shared leisure time, all in support of our liter-ary pursuit. We especially want to thank them for their patience with us, and the grace it took to not kill us during some of the longer work binges.
ffirs.indd xvffirs.indd xv 9/15/2012 11:07:45 AM9/15/2012 11:07:45 AM
ffirs.indd xviffirs.indd xvi 9/15/2012 11:07:45 AM9/15/2012 11:07:45 AM
CONTENTS
INTRODUCTION xxxv
PART I: INTRODUCTION
CHAPTER 1: INTRODUCTION 3
BISM Multidimensional Mode 4
A Closer Look at Data Warehousing 5
Key Elements of a Data Warehouse 8
Fact Tables 8
Dimension Tables 9
Dimensions 10
Cubes 11
The Star Schema 12
The Snowfl ake Schema 13
Inmon Versus Kimball — Diff erent Approaches 14
Business Intelligence Is Data Analysis 15
BISM Tabular Mode 15
SQL Server Analysis Services 2012 17
The Business Intelligence Semantic Model 18
Data Model 19
Query Language 20
Data Access Technology 20
Summary 21
PART II: DESIGNING MULTIDIMENSIONAL BISM
CHAPTER 2: A FIRST LOOK AT MULTIDIMENSIONAL BISM 25
Development, Administrative, and Client Tools 26
Upgrading to Analysis Services 2012 26
Using SQL Server Data Tools to Build Analysis Services Multidimensional Applications 31
Creating a Project Using SQL Server Data Tools 32
The Solution Explorer 34
The Properties Window 35
The Output Window 35
ftoc.indd xviiftoc.indd xvii 9/15/2012 11:07:56 AM9/15/2012 11:07:56 AM
xviii
CONTENTS
Creating an Analysis Services Database Using SQL Server Data Tools 35
Creating a Data Source 36
Creating a Data Source View (DSV) 40
Creating a Cube Using the Cube Wizard 44
Deploying and Browsing a Cube 53
Using SQL Server Management Studio 56
The Object Explorer Pane 59
Querying Using the MDX Query Editor 61
Summary 63
CHAPTER 3: UNDERSTANDING MDX 65
What Is MDX? 66
MDX Concepts 66
Measures and Measure Groups 66
Hierarchies and Hierarchy Levels 67
Members 68
Cells 70
Tuples 72
Sets 72
MDX Queries 73
SELECT Statement and Axis Specifi cation 74
FROM Clause and Cube Specifi cation 75
Subselect Clauses 75
WHERE Clause and Slicer Specifi cation 76
Slicer Dimension 76
WITH Clause, Named Sets, and Calculated Members 77
Named Sets 77
Calculated Members 79
Ranking and Sorting 81
MDX Expressions 82
MDX Operators 83
Arithmetic Operators 83
Set Operators 83
Comparison Operators 84
Logical Operators 84
Special MDX Operators — Curly Braces, Commas, and Colons 84
MDX Functions 85
MDX Function Categories 85
Set Functions 85
Crossjoin 86
NONEMPTYCROSSJOIN and NONEMPTY 86
ftoc.indd xviiiftoc.indd xviii 9/15/2012 11:07:57 AM9/15/2012 11:07:57 AM
xix
CONTENTS
Filter and Having 87
Member Functions 87
Numeric Functions 88
Dimension Functions, Level Functions, and Hierarchy Functions 89
String Manipulation Functions 89
Other Functions 89
MDX Scripts 89
MDX Script Execution 90
CALCULATE Statement 90
Cube Space 92
AUTO EXISTS 93
Cell Calculations and Assignments 94
Recursion 97
Freeze Statement 97
Restricting Cube Space/Slicing Cube Data 98
SCOPE Statement 98
CREATE and DROP SUBCUBE 98
Using EXISTS 99
Using EXISTING 99
Using SUBSELECT 100
Parameterized MDX Queries 101
MDX Comments 102
Summary 102
CHAPTER 4: DATA SOURCES AND DATA SOURCE VIEWS 103
Data Sources 104
Data Sources Supported by Analysis Services 105
.NET Versus OLE DB Data Providers 109
.NET Framework Data Providers 109
OLE DB Data Providers 109
The Trade-Off s 110
Data Source Views 110
DSV Wizard 111
DSV Designer 111
Adding/Removing Tables in a DSV 113
Specifying Primary Keys and Relationships in the DSV 114
Customizing Your Tables in the DSV Designer 115
Data Source Views in Depth 119
Diagrams 119
Data Source View Properties 121
Diff erent Layouts in DSVs 123
Validating Your DSV and Initial Data Analysis 125
ftoc.indd xixftoc.indd xix 9/15/2012 11:07:57 AM9/15/2012 11:07:57 AM
xx
CONTENTS
Multiple Data Sources Within a DSV 126
Summary 127
CHAPTER 5: DIMENSION DESIGN 129
Working with the Dimension Wizard 130
Working with the Dimension Designer 136
Attributes 137
Attribute Relationships 139
User Hierarchies 144
Browsing the Dimension 148
Sorting Members of a Level 157
Optimizing Attributes 159
Defi ning Translations in Dimensions 159
Creating a Snowfl ake Dimension 162
Creating a Time Dimension 165
Creating a Parent-Child Hierarchy 168
Summary 172
CHAPTER 6: CUBE DESIGN 173
The BISM Multidimensional Mode 173
Creating a Cube Using the Cube Wizard 176
Browsing Cubes 180
Cube Dimensions 184
Relationship Types 185
No Relationship 185
Regular Relationships 186
Fact Relationships 186
Many-to-Many Relationships 187
Data Mining Relationships 187
Referenced Relationships 187
Browsing Reference Dimensions in Excel 190
Measures and Measure Groups 192
Calculated Members 198
Calculated Measures 200
Querying Calculated Measures 203
Creating Perspectives 203
Creating Translations 205
Browsing Perspectives and Translations 206
Summary 208
ftoc.indd xxftoc.indd xx 9/15/2012 11:07:57 AM9/15/2012 11:07:57 AM
xxi
CONTENTS
CHAPTER 7: ADMINISTRATION AND MANAGEMENT 209
Administration Using SQL Server 2012 Tools 210
Managing Analysis Servers 210
Managing Analysis Services Objects 214
Database Creation 215
Processing Analysis Services Database Objects 217
Processing a Cube 221
Processing a Dimension 226
Managing Partitions 228
Managing Assemblies 234
Backup and Restore 237
Detach and Attach 241
Synchronization 244
Managing Security 249
Server and Database Roles 249
Enabling or Disabling Features 249
Online Mode 250
Programmatic and Advanced Administration 253
Analysis Management Objects (AMO) 253
Processing Analysis Services Databases 253
Back Up and Restore 258
Adding Assemblies to Analysis Services 259
PowerShell and Analysis Services 261
Resource and Activity Monitoring 261
HTTP Connectivity to Analysis Services 264
Analysis Services and FailOver Clustering 265
Summary 265
PART III: ADVANCED TOPICS IN BISM
CHAPTER 8: ADVANCED DIMENSION DESIGN 269
Custom Rollups 270
Enhancements to Parent-Child Hierarchies 280
Unary Operators 280
Specifying Names of Levels in a Parent-Child Hierarchy 286
Using Properties to Customize Dimensions 288
Ordering Dimension Members 289
The All Member, Default Member, and Unknown Member 289
Error Confi gurations for Processing 292
ftoc.indd xxiftoc.indd xxi 9/15/2012 11:07:57 AM9/15/2012 11:07:57 AM
xxii
CONTENTS
Storage Mode 293
Grouping Members 294
Dimension Intelligence Using the Business Intelligence Wizard 295
Account Intelligence 295
Time Intelligence 301
Dimension Intelligence 305
Server Time Dimension 307
Dimension Writeback 311
Summary 314
CHAPTER 9: ADVANCED CUBE DESIGN 315
Measure Groups and Measures 316
Adding and Enhancing Dimensions 321
Fact Dimensions 322
Many-to-Many Dimensions 323
Data Mining Dimensions 325
Role-Playing Dimensions 328
Adding Calculations to Your Cube 329
Key Performance Indicators (KPIs) 337
KPI Creation 337
KPIs in Depth 344
Using ADOMD.NET to Query KPIs 345
Drillthrough 347
Actions 348
Action Types 348
Action Target Types 348
URL Action 349
Browse URL Action in the Cube Browser 353
Report Actions 354
Drillthrough Action 356
Adding Intelligence to the Cube 362
Semiadditive Measures 363
Currency Conversion 365
Working with Partitions 371
Building a Local Partition 373
Building a Remote Partition 375
Storage Modes and Storage Settings 384
Building Aggregations 386
The Aggregation Design Process 389
Usage-Based Optimization 392
Real-Time Cubes 393
Long Latency Scenario 393
ftoc.indd xxiiftoc.indd xxii 9/15/2012 11:07:57 AM9/15/2012 11:07:57 AM
xxiii
CONTENTS
Caching After Data Change 394
Caching Using Timed Updates 396
Average Latency Scenario 397
Caching with MOLAP Storage Option 397
No Latency Scenario 401
Real-Time ROLAP Storage Option 402
Defi ning Security 403
Cell Writeback 407
Cell Writeback Prerequisites 408
Writeback Statement 409
Update Nonleaf Cell Value Using Allocation 411
Equal Allocation 411
Weighted Allocation 412
Incremental Allocation 413
Cautions 413
AMO Warnings 414
Design Experience 415
Dismissing Warnings 415
Warnings Designer 416
Summary 418
CHAPTER 10: DESIGNING MULITDIMENSIONAL BISM FOR PERFORMANCE 419
Optimizing Multidimensional BISM Design 422
Fine-Tuning Your Dimensions 422
Choosing the Right Key Attribute 422
Avoiding Unnecessary Attributes 423
Turning Off Optimization for Rarely Used Attributes 424
Turning Off AttributeHierarchy for Member Properties 425
Defi ning Relationships between Attributes 425
Fine-Tuning Your Cube 427
Fact Table Í Measure Groups or Partitions 427
Optimizing Reference Dimensions 429
Many-to-Many Dimensions 429
Partitions 430
Merging Partitions 431
Partition Slices 434
Partition Slices and ROLAP 434
A Partition Slice Example 435
Distinct Count Partitioning 437
Optimizing for Processing 439
Creating Partitions to Speed Up Processing 441
ftoc.indd xxiiiftoc.indd xxiii 9/15/2012 11:07:57 AM9/15/2012 11:07:57 AM
xxiv
CONTENTS
Choosing Small and Appropriate Data Types and Sizes 441
SQL Server and Analysis Services Installations 442
Optimizing a Relational Data Source 442
Avoiding Excessive Aggregation Design 443
Using Incremental Processing When Appropriate 443
Parallelism during Processing 445
Identifying Resource Bottlenecks 449
Designing Aggregations 450
Understanding Aggregations 451
Creating Aggregations 453
Applying Aggregation Design 459
Usage-Based Aggregation Design 462
Aggregation Design Options 468
Designing Effi cient Aggregations Using Hints 468
Relationships between Attributes 468
Properties Controlling Attributes and Aggregation Design 471
Managing Aggregation Designs 474
Scalability Optimizations 475
Confi guring Server Confi guration Properties 476
Scaling Out 477
Scaling Up 477
Handling Large Dimensions 478
Summary 478
CHAPTER 11: OPTIMIZING QUERY PERFORMANCE 479
How OLAP Enhances Performance 480
The Calculation Model 480
MDX Scripts 481
Scope and Assignments 483
Dimension Attribute Calculations 483
Session and Query Calculations 484
Query Execution Architecture 485
Analysis Services Engine Components 485
Stages of Query Execution 486
Query Evaluation Modes 487
Cell-by-Cell Mode 487
Subspace Computation 489
Performance Analysis and Tuning Tools 492
SQL Server Profi ler 492
Analysis Services Trace Events 497
ftoc.indd xxivftoc.indd xxiv 9/15/2012 11:07:58 AM9/15/2012 11:07:58 AM
xxv
CONTENTS
Performance Monitor 498
Task Manager 501
SQL Server Management Studio 502
SQL Server Data Tools 502
Server Properties 502
Analyzing Query Performance Issues 503
Understanding FE and SE Characteristics 504
Common Solutions for Slow Queries 504
Large Storage Engine Requests 504
Several Storage Engine Requests 505
Formula Engine-Intensive Query 505
Query Optimization Techniques 505
Using NON EMPTY on Axes 506
Using Non Empty for Filtering and Sorting 508
Using SCOPE Versus IIF and CASE 509
Auto Exists Versus Properties 509
Member Value Versus Properties 509
Move Simple Calculations to Data Source View 510
Features Versus MDX Scripts 510
Scale Out with Read-Only Database 510
Writeback Query Performance 512
Summary 512
CHAPTER 12: DATA MINING, MULTIDIMENSIONAL BISM, AND DATA MINING ADD-INS FOR OFFICE 2010 513
The Data Mining Process 514
Topic Area Understanding 515
Data: Understand It, Confi gure It 516
Choose the Right Algorithm 517
Train, Analyze, and Predict 517
Real-World Applications 518
Fraud Detection 518
Increasing Profi ts in Retail 519
Data Mining in the NBA 519
Data Mining in Call Centers 519
Data Mining Algorithms in SQL Server Analysis Services 2012 520
Microsoft Decision Trees 521
Microsoft Naïve Bayes 521
Microsoft Clustering 522
Microsoft Sequence Clustering 522
Microsoft Association Rules 522
ftoc.indd xxvftoc.indd xxv 9/15/2012 11:07:58 AM9/15/2012 11:07:58 AM
xxvi
CONTENTS
Microsoft Neural Network 522
Microsoft Time Series 523
Microsoft Linear Regression 523
Microsoft Logistic Regression 523
Working with Mining Models 524
Relational Mining Model 524
OLAP Mining Models 548
Analyzing the Cube with a Data Mining Dimension 555
Using Data Mining with Offi ce 2010 557
Table Analytics 558
Analyze Key Infl uencers 559
Detect Categories 562
Fill from Example 565
Forecast 566
Highlight Exceptions 568
Shopping Basket Analysis 569
Scenario Analysis 571
Data Mining Tools 571
Explore Data Wizard 572
Clean Data: Outliers and Re-label Wizards 574
Sample Data Wizard 576
Classifi cation Model 577
Model Accuracy 579
Classifi cation Matrix 582
Visio Add-in 584
The Decision Tree Shape 584
The Cluster Shape Wizard 588
The Dependency Shape Wizard 592
Summary 594
CHAPTER 13: SQL INTEGRATION SERVICES AND SQL SERVER REPORTING SERVICES WITH MULTIDIMENSIONAL BISM MODELS 597
SQL Server Integration Services 599
Creating an Integration Services Project 599
Creating Integration Services Packages for Analysis Services Operations 600
The Execute DDL Task 601
Processing an Analysis Services Object 611
Loading Data into an Analysis Services Partition 613
Deploying the Integration Services Project 622
Integration Services Tasks for Data Mining 626
ftoc.indd xxviftoc.indd xxvi 9/15/2012 11:07:58 AM9/15/2012 11:07:58 AM
xxvii
CONTENTS
Automating Execution of SSIS Packages 627
Monitoring SSIS Package Executions 634
SQL Server Reporting Services 635
Report Designer, Report Builder 635
Report Defi nition Language 636
Report Wizard 636
Report Server 636
Creating a Report on a Relational Database 637
Connecting and Deploying to a Report Server 644
Creating a Report on a Multidimensional Model 648
Designing Your Analysis Services Report 649
Enhancing Your Analysis Services Report 654
Enhancing Your Report Using Extended Properties 662
Custom Aggregates 665
Summary 669
CHAPTER 14: SECURING MULTIDIMENSIONAL BISM 671
Securing Your Source Data 672
Securing Your Dimension Data 674
A Scenario Using Dimension Security 674
The User-Role Approach 682
The Access-Role Approach 697
The Member Property Approach 698
The Security Measure Group Approach 700
The External Function Approach 703
Securing Your Cube Data 705
Scenario Using Cell Security 706
Summary 715
PART IV: POWERPIVOT AND TABULAR BISM
CHAPTER 15: SELF-SERVICE BUSINESS INTELLIGENCE AND INTRODUCTION TO POWERPIVOT 719
SQL Server 2012 720
Self-Service Business Intelligence 721
PowerPivot: Microsoft’s Implementation of SSBI 722
PowerPivot Applications 722
PowerPivot for Excel 723
PowerPivot for SharePoint 732
The Analysis Services Engine in VertiPaq Mode 736
Summary 739
ftoc.indd xxviiftoc.indd xxvii 9/15/2012 11:07:58 AM9/15/2012 11:07:58 AM
xxviii
CONTENTS
CHAPTER 16: A FIRST LOOK AT TABULAR BISM 741
Tabular Mode Projects in SSDT 742
Setting Up a Tabular Instance of Analysis Services 2012 742
Creating a Tabular Project Using SQL Server Data Tools 743
Workspace Server and Deployment Server 744
Importing Data 746
The Tabular Designer 748
The Model Menu 750
Working with Tables in the Designer 752
Working with Columns in the Designer 756
Relationships 759
Adding Calculations to Your Tabular Model 761
Calculated Columns 761
Measures 762
Browsing the Model 765
Modeling and Deploying 767
Administering Your Tabular Model Using SSMS 769
Summary 772
CHAPTER 17: ENHANCING YOUR TABULAR BISM 773
Sourcing Data for Your Model 773
Refi ning Your Tabular Model 774
Changing the Model 774
Adding a New Table 774
Modifying an Existing Table 775
Hiding and Deleting Tables, Columns, and Measures 776
Creating a Date Table 777
Creating and Managing Relationships 777
Column Operations 777
Filtering and Sorting 777
Confi guring for PowerPivot and Power View 779
Enhancing Your Model with Hierarchies 779
Creating a Date Hierarchy 780
Making Use of Time Intelligence Functions 783
Creating a Geography Hierarchy 785
Creating a Product Hierarchy by Combining Columns from Diff erent Tables 786
Creating Parent/Child Hierarchies 788
Enhancing Measures 788
Building Explicit Measures with DAX 788
Implicit Measures 790
Change Measure Properties 792
ftoc.indd xxviiiftoc.indd xxviii 9/15/2012 11:07:58 AM9/15/2012 11:07:58 AM