Foundations of SQL Server 2008 R2 Business Intelligence Second Edition Guy Fouche Lynn Lang it Apress*
Contents at a Glance About the Authors About the Technical Reviewer Acknowledgments iv xiii xiv xv Chapter 1: What Is Business Intelligence? 1 Just What Is Business Intelligence? 1 Defining Bl Using Microsoft's Tools 4 What Microsoft Products Are Involved? 5 Bl Languages 7 Understanding Bl from an End User's Perspective 9 Building the First Sample Using AdventureWorks 10 Deploying the Standard Edition Version of the Sample Cube 10 To deploy the Standard edition of the sample cube, follow these steps; 10 How to Connect to the Sample Cube Using Excel 17 Understanding Bl Through the Sample 21 Understanding the Business Problems That Bl Addresses 22 Reasons to Switch to Microsoft's Bl Tools 23 Summary 24 Chapter 2: OLAP Modeling Concepts 25 Modeling OLAP Source Schemas Stars 25 Understanding the Star Schema 26 Understanding a Dimension Table 27 Why Create Star Schemas? 30 Effectively Creating Star Schema Models Using Grain Statements 33 v
II CONTENTS Tools for Creating Your OLAP Model d* Modeling Source Schemas Snowflakes and Other Variations 37 48 «Understanding the Snowflake Schema 37 Knowing When to Use Snowflakes 41 Considering Other Possible Variations 42 Choosing Whether to Use Views Against the Relational Data Sources 42 Understanding Unified Dimensional Modeling 42 Using the UDM 43 The Slowly Changing Dimension (SCD) 45 Type1,2,3SCD Solutions 48 The Rapidly Changing Dimension (RCD) 47 Writeback Dimension 48 Understanding Fact (Measure) Modeling 48 An Example Calculated Measure vs. Derived Measure 50 Other Types of Modeling 50 Data Mining 5 Key Performance Indicators, 51 Actions, Perspectives, Translations 51 Source Control and Other Documentation Standards 51 Summary 51 Chapter 3: Introducing OLAP Modeling with SSAS 53 Using BIDS to Build a Cube 53 Defining Your First Cube 61 Adding Dimension Attributes 64 Defining Hierarchies 66 Building Your First Cube 67 Refining Your Cube...70 Reviewing Measures 70 Reviewing Dimensions: Attributes 73 Reviewing Dimensions: Hierarchies 75 Summary 81 vi
Chapter 4: Intermediate OLAP Modeling with SSAS. 83 Adding Key Performance Indicators (KPIs) 83 Implementing KPIs in SSAS 84 Implementing KPIs in SSMS 89 Using Perspectives and Translations 91 Perspectives 91 Translations 92 Localizing Measure Values 94 Using Actions 100 Creating Actions in SSAS 100 Creating Actions in SSMS 104 Summary 105 IChapter 5: Advanced OLAP Modeling with SSAS 107 Multiple Fact Tables in a Single Cube 107 Nulls 109 Nonstar Dimensions 112 Snowflake Dimensions 112 Degenerate Dimensions 114 Parent-Child Dimensions 115 Many-to-Many Dimensions 116 Role-Playing Dimensions 120 Writeback Dimensions 121 Dimensions That Change 123 Error Handling for Dimension Attribute Loads 124 Using the Business Intelligence Wizard 125 Summary 129 IChapter 6: Cube Storage and Aggregation 131 Using the Default Storage: MOLAP 131 XML for Analysis 131 Aggregations 133 vii
MOLAP as Default in SSAS Adding Aggregations * The Aggregation Design Wizard The Usage-Based Optimization Wtzard The SQL Server Profiler as an Aggregation Design Aid 143 Using Advanced Storage -142 Understanding ROLAP 142 Understanding HOLAP Considering Non-MOLAP Storage 143 Handling Huge Dimensions 146 Summarizing OLAP Storage Options 148 Using Proactive Caching 149 Fine-Tuning Proactive Caching 151 Setting Notifications for Proactive Caching 152 Deciding Between OLTP and OLAP Partitioning 153 Relational Table Partitioning in SQL Server 153 135,J 135 139 141 ' OLAP Partition Configurations, 154 Choosing Cube and Dimension Processing Options 154 Summary -159 Chapter 7: Introducing SSIS 161 Understanding ETL 161 Creating a Plan 161 Creating a Data Map 162 Refining a Data Map 164 Adding a Staging Server, 165 Creating a Basic SSIS Package 166 Building Basic SSIS Packages 171 Developing SSIS Packages 172 Designing SSIS Packages 174 Adding Transformations to the Data Flow 182 Summary 186 viii
m IiUnicimio Chapter 8: Intermediate SSIS 187 Common ETL Package-Design Practices 187 Creating an SSIS Package from Scratch 188 Creating the Package Itself 188 Configuring Connections 193 Using Data Source Views (DSVs) 196 Reviewing the Included Samples Packages 197 Adding Control Flow Tasks 198 Container Tasks 200 SQL Tasks 201 File System Tasks 204 Operating System Tasks 205 Script Tasks 206 Remote Tasks 207 SSAS Tasks 207 Precedence Constraints 209 Using Expressions with Precedence Constraints 211 Understanding Data Flow Transformations 214 Data Sources 214 Data Flow Destinations 216 Transformation Types 217 Adding Data Transformations 219 Split Data Transformations... 221 Translate Data Transformations 223 SSAS Data Transformations 227 Slowly Changing Dimension Transformation 227 Sample Data Transformations 231 Run Command Data Transformations 231 Enterprise Edition-Only Data Transformations 232 Using the Dynamic Package Configuration Wizard 234 Assigning SSIS Expressions 236 Summary 236 ix
Chapter 9: Advanced SSIS 237 Understanding Package Execution 237 Data Viewers 241 Debugging SSIS Packages 243 Logging Execution Results -245 Error Handling 248 Event Handlers 251 Deploying SSIS Packages 252 SSIS Package Deployment Options 253 SSIS Package Execution Options 256 SSIS Package Security 260 Placing Checkpoints 261 Using Transactions in SSIS Packages 262 Data Profiling 264 Creating a Data Profile 264 Viewing a Data Profile 267 Summary 270 1 Chapter 10: Reporting Tools 271 Using Excel Pivot Tables and Pivot Charts 271 Creating a Pivot Table 271 Creating a Pivot Chart 274 Publishing Your Workbook 275 Using SQL Server Reporting Services 276 SSRS Components 276 SSRS Reporting Samples 277 Building Your First SSRS Report, 277 Running the Report Server Project Wizard 278 Designing the Query 279 Previewing and Designing Your Report 284 Publishing Your Report 287 Producing Reports with Report Builder 290
Creating a Report Model 290 Creating a Dataset 292 Creating a Report 293 Summary, 299 Chapter 11: Data Mining with Excel 301 Exploring Excel 2010 301 The Excel Ribbon 301 KPI Support in Excel 306 Using Excel for Data Mining 308 Configuring Excel as a Data Mining Client 309 Using Excel as a Data Mining Client 312 Using the Data Preparation Group 318 Using the Data Modeling Group 323 Using the Accuracy and Validation Group 324 Summary 328 Chapter 12: Introducing PowerPivot 329 The PowerPivot for Excel GUI...329 The PowerPivot Ribbon 329 The PowerPivot Designer 332 Using PowerPivot with Adventure Works 336 Importing Adventure Works Data 336 Enriching the Adventure Works Data 338 Using PowerPivot Data in Excel 345 Summary 346 Chapter 13: Introduction to MDX, 347 MDX Query Syntax...347 Understanding the Core Terminology 348 Learning the Basic Syntax 350 Writing Your First MDX Query 352 Discovering Members, Tuples, and Sets 353 xi
Calculated Members, Named Sets, and Script Commands 355 Adding MDX Objects to Your Cube 356 Using Calculated Measures 359 Working with Named Sets 361 Writing Script Commands 362 Common MDX Functions 364 Summary 367 IChapter 14: Introduction to Data Mining 369 Defining SSAS Data Mining 369 Data-Mining Concepts 372 Architectural Considerations 373 Reviewing Data Mining Structures 374 Mining Structure Tab 374 Mining Models Tab 375 Mining Model Viewer Tab 378 Mining Accuracy Chart Tab 381 Mining Model Prediction Tab 382 Understanding and Using the Included Data Mining Algorithms 383 The Nine Algorithms 384 The Data Mining Wizard 390 Content and Datatypes 392 Processing Mining Models 396 Processing Methods 396 SSIS and Data Mining 397 Working with the DMX Language 399 Summary 402 Appendix: The HIERARCHYID Datatype 403 Creating A HIERARCHYID Table 403 Adding Data to the Table 404 Displaying Hierarchical Data in SSMS 405 Index: 407 xii