MSTR Project Design Guide
MSTR Project Design Guide
Version: 9.0.1
Document Number: 09330901
This product is patented. One or more of the following patents may apply to the product sold herein: U.S. Patent Nos. 6,154,766, 6,173,310, 6,260,050, 6,263,051, 6,269,393, 6,279,033, 6,501,832, 6,567,796, 6,587,547, 6,606,596, 6,658,093, 6,658,432, 6,662,195, 6,671,715, 6,691,100, 6,694,316, 6,697,808, 6,704,723, 6,707,889, 6,741,980, 6,765,997, 6,768,788, 6,772,137, 6,788,768, 6,792,086, 6,798,867, 6,801,910, 6,820,073, 6,829,334, 6,836,537, 6,850,603, 6,859,798, 6,873,693, 6,885,734, 6,888,929, 6,895,084, 6,940,953, 6,964,012, 6,977,992, 6,996,568, 6,996,569, 7,003,512, 7,010,518, 7,016,480, 7,020,251, 7,039,165, 7,082,422, 7,113,993, 7,181,417, 7,127,403, 7,174,349, 7,194,457, 7,197,461, 7,228,303, 7,260,577, 7,266,181, 7,272,212, 7,302,639, 7,324,942, 7,330,847, 7,340,040, 7,356,758, 7,356,840, 7,415,438, 7,428,302, 7,430,562, 7,440,898, 7,457,397, 7,486,780, 7,509,671, 7,516,181, 7,559,048 and 7,574,376. Other patent applications are pending. Various MicroStrategy products contain the copyrighted technology of third parties. This product may contain one or more of the following copyrighted technologies: Graph Generation Engine Copyright 1998-2010. Three D Graphics, Inc. All rights reserved. Actuate Formula One. Copyright 1993-2010 Actuate Corporation. All rights reserved. XML parser Copyright 2003-2010 Microsoft Corporation. All rights reserved. Xalan XSLT processor. Copyright 1999-2010. The Apache Software Foundation. All rights reserved. Xerces XML parser. Copyright 1999-2010. The Apache Software Foundation. All rights reserved. FOP XSL formatting objects. Copyright 2004-2010. The Apache Software Foundation. All rights reserved. Portions of Intelligence Server memory management Copyright 1991-2010 Compuware Corporation. All rights reserved. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit. (http://www.openssl.org/) International Components for Unicode Copyright 1999-2010 Compaq Computer Corporation Copyright 1999-2010 Hewlett-Packard Company Copyright 1999-2010 IBM Corporation Copyright 1999-2010 Hummingbird Communications Ltd. Copyright 1999-2010 Silicon Graphics, Inc. Copyright 1999-2010 Sun Microsystems, Inc. Copyright 1999-2010 The Open Group All rights reserved. Real Player and RealJukebox are included under license from Real Networks, Inc. Copyright 1999-2010. All rights reserved.
CONTENTS
Description of guide ................................................................. xiii About this book .............................................................................xv How to find business scenarios and examples .......................xv Whats new in this guide ........................................................ xvi Prerequisites ......................................................................... xvii Who should use this guide.................................................... xvii Resources.................................................................................. xviii Documentation..................................................................... xviii Education .............................................................................. xxv Consulting ............................................................................ xxvi International support ............................................................ xxvi Technical Support ............................................................... xxvii Feedback .................................................................................. xxxii
Introduction.................................................................................. 1 Business intelligence architecture ................................................. 2 Source systems for data collection .......................................... 3 Extraction, transformation, and loading process...................... 4 Data warehouse for data storage and relational design .......... 5 The MicroStrategy platform ........................................................... 7 MicroStrategy metadata........................................................... 8 MicroStrategy Intelligence Server .......................................... 11 MicroStrategy Desktop........................................................... 11 MicroStrategy Web and Web Universal ................................. 13 MicroStrategy project ............................................................. 14 MicroStrategy Architect.......................................................... 15
Contents
Introduction................................................................................ 17 Overview of a logical data model................................................. 18 Facts: Business data and measurements.................................... 20 Attributes: Context for your levels of data.................................... 22 Attribute elements: Data level values..................................... 23 Attribute relationships ............................................................ 24 Hierarchies: Data relationship organization ................................. 24 Sample data model...................................................................... 25 Building a logical data model ....................................................... 26 User requirements ................................................................. 26 Existing source systems ........................................................ 27 Converting source data to analytical data.............................. 28 Logical data modeling conventions.............................................. 33 Unique identifiers ................................................................... 34 Cardinalities and ratios .......................................................... 35 Attribute forms ....................................................................... 36
Introduction................................................................................ 39 Columns: Data identifiers and values .......................................... 41 Tables: Physical groupings of related data.................................. 41 Uniquely identifying data in tables with key structures........... 42 Lookup tables: Attribute storage ............................................ 43 Relate tables: A unique case for relating attributes ............... 45 Fact tables: Fact data and levels of aggregation ................... 46 Homogeneous versus heterogeneous column naming.......... 49 Schema types: Data retrieval performance versus redundant storage......................................................................................... 51 Highly normalized schema: Minimal storage space............... 52 Moderately normalized schema: Balanced storage space and query performance.......................................................... 54 Highly denormalized schema: Enhanced query performance........................................................................... 56 Design trade-offs ......................................................................... 59
vi
Contents
Schema type comparisons .......................................................... 60 Supporting data internationalization ............................................ 61 Internationalization through tables and columns or databases .............................................................................. 62 Supporting various character sets within databases.............. 68
Introduction................................................................................ 69 Overview of project creation ........................................................ 70 Project connectivity components ................................................. 72 MicroStrategy metadata......................................................... 73 Metadata shell ....................................................................... 73 Project source ........................................................................ 73 Database instance ................................................................. 75 Project.................................................................................... 76 Summary of project connectivity ............................................ 76 Creating the metadata repository ................................................ 77 Connecting to the metadata repository and data source ............. 77 Connecting to the metadata repository .................................. 78 Connecting to a data source .................................................. 78 Creating a project ........................................................................ 79 Creating a production project................................................. 80 Creating a test or prototype project using Project Builder...... 95 Creating facts and attributes........................................................ 97 Configuring additional schema-level settings .............................. 97 Deploying your project and creating reports ................................ 99
Introduction.............................................................................. 101 Creating and modifying projects ................................................ 102 Defining project creation and display options ...................... 102 Creating projects using Architect ......................................... 113 Modifying projects using Architect ....................................... 118 Adding, removing, and administering tables.............................. 119 Displaying data sources in Architect .................................... 121 Adding tables ....................................................................... 122 Removing tables .................................................................. 123 Updating, modifying, and administering tables .................... 125 Organizing project tables: Layers ........................................ 132 Creating and modifying facts ..................................................... 133 Creating facts....................................................................... 134
vii
Contents
Creating and modifying multiple facts .................................. 137 Creating and modifying attributes .............................................. 145 Creating attributes ............................................................... 146 Creating and modifying multiple attributes........................... 149 Defining attribute relationships .................................................. 167 Using the System Dimension Editor .................................... 173 Automatically defining attribute relationships....................... 174 Creating and modifying user hierarchies ................................... 176 Creating user hierarchies..................................................... 177
6. The Building Blocks of Introduction.............................................................................. 181 Business Data: Facts Creating facts............................................................................. 183 Simultaneously creating multiple, simple facts .................... 184 Creating and modifying simple and advanced facts ............ 187 The structure of facts ................................................................. 193 How facts are defined ............................................................... 194 Mapping physical columns to facts: Fact expressions ......... 195 Fact column names and data types: Column aliases ................ 202 Modifying the levels at which facts are reported: Level extensions.................................................................................. 204 Defining a join on fact tables using table relations............... 206 Defining a join on fact tables using fact relations................. 211 Forcing facts to relate to attributes: Using cross product joins ..................................................................................... 212 Lowering the level of fact data: Fact degradations .............. 214 Disallowing the reporting of a fact at a certain level............. 219
Introduction.............................................................................. 221 Overview of attributes ................................................................ 222 Creating attributes ..................................................................... 224 Simultaneously creating multiple attributes.......................... 225 Adding and modifying attributes .......................................... 230 Unique sets of attribute information: Attribute elements ............ 237 Supporting data internationalization for attribute elements .............................................................................. 240 Column data descriptions and identifiers: Attribute forms ......... 243 Displaying forms: Attribute form properties.......................... 245 Attribute form expressions ................................................... 247 Modifying attribute data types: Column aliases ................... 256
viii
Contents
Attribute forms versus separate attributes ........................... 259 Attribute relationships ................................................................ 260 Viewing and editing the parents and children of attributes .............................................................................. 262 Supporting many-to-many and joint child relationships ....... 264 Attributes that use the same lookup table: Attribute roles ......... 275 Specifying attribute roles ..................................................... 278 Attributes with multiple ID columns: Compound attributes ........ 284 Example: Creating compound attributes.............................. 285 Using attributes to browse and report on data........................... 287 Defining how attribute forms are displayed by default ......... 289
Introduction.............................................................................. 291 Creating user hierarchies........................................................... 292 Creating user hierarchies using Architect ............................ 294 Types of hierarchies .................................................................. 295 System hierarchy: Project schema definition ....................... 296 User hierarchies: Logical business relationships ................. 297 Hierarchy organization............................................................... 297 Hierarchy structure............................................................... 298 Viewing hierarchies: Hierarchy Viewer ................................ 299 Configuring hierarchy display options........................................ 299 Controlling the display of attribute elements ........................ 300 Filtering attributes in a hierarchy.......................................... 304 Entry point............................................................................ 305 Hierarchy browsing .............................................................. 307 Using the Hierarchy Viewer and Table Viewer .......................... 312 Using the Hierarchy Viewer ................................................. 312 Using the Table Viewer........................................................ 314
Introduction.............................................................................. 317 Updating your MicroStrategy project schema............................ 318 Data warehouse and project interaction: Warehouse Catalog ...................................................................................... 320 Before you begin using the Warehouse Catalog? ............... 321 Accessing the Warehouse Catalog...................................... 322 Adding and removing tables for a project ............................ 322 Managing warehouse and project tables ............................. 323
ix
Contents
Modifying data warehouse connection and operation defaults ................................................................................ 330 Customizing catalog SQL statements.................................. 338 Troubleshooting table and column messages ..................... 344 Accessing multiple data sources in a project............................. 345 Connecting data sources to a project .................................. 346 Adding data into a project .................................................... 348 Improving database insert performance: parameterized queries ....................................................................................... 355 Using summary tables to store data: Aggregate tables ............. 358 When to use aggregate tables ............................................. 358 Determining the frequency of queries at a specific level...... 362 Considering any related parent-child relationships .............. 363 Compression ratio................................................................ 364 Creating aggregate tables ................................................... 365 The size of tables in a project: Logical table size................. 366 Dividing tables to increase performance: Partition mapping...... 366 Server versus application partitioning .................................. 367 Metadata partition mapping ................................................. 368 Warehouse partition mapping .............................................. 370 Metadata versus warehouse partition mapping ................... 372
Introduction.............................................................................. 373 Creating transformations ........................................................... 374 Expression-based versus table-based transformations ....... 375 Building a table-based transformation ................................. 376 Building an expression-based transformation...................... 378 Transformation components ...................................................... 379 Transformation metrics and joint child attributes ....................... 381
A. MicroStrategy Tutorial Introduction.............................................................................. 385 What is the MicroStrategy Tutorial?........................................... 385 MicroStrategy Tutorial data model............................................. 389 Data modeling notations ...................................................... 390 Geography hierarchy ........................................................... 390 Products hierarchy ............................................................... 392 Customers hierarchy............................................................ 393 Time hierarchy ..................................................................... 395 Viewing the MicroStrategy Tutorial data model ................... 397
Contents
MicroStrategy Tutorial schema .................................................. 398 Exploring the MicroStrategy Tutorial schema ...................... 398
B. Logical Tables
Introduction.............................................................................. 403 Logical tables............................................................................. 403 How should I use logical tables? ............................................... 405 Creating logical tables ............................................................... 406 Using SQL for logical views ................................................. 409 Logical view examples............................................................... 410 Business case 1: Distinct attribute lookup table................... 410 Business case 2: Attribute form expression across multiple tables ................................................................................... 411 Business case 3: Slowly changing dimensions.................... 412 Business case 4: One-to-many transformation tables ......... 423 Business case 5: Outer joins between attribute lookup tables ................................................................................... 424
C. Data Types
Introduction.............................................................................. 429 Mapping of external data types to MicroStrategy data types..... 429 MicroStrategy data types ........................................................... 449 Format types.............................................................................. 450 Data type and format type compatibility..................................... 451 Big Decimal................................................................................ 452 Using the Big Decimal data type.......................................... 453 MicroStrategy support for binary data types .............................. 454
xi
Contents
xii
PREFACE
Description of guide
The MicroStrategy Project Design Guide provides comprehensive information on planning, creating, and modifying a project in MicroStrategy and covers a wide range of project-related topics, including the following: Chapter 1, BI Architecture and the MicroStrategy Platform, provides a brief introduction to business intelligence architecture and some of the main components within the MicroStrategy platform. Chapter 2, The Logical Data Model, explores logical data modeling and how it can help you identify the different elements within your business data and plan your project. Chapter 3, Warehouse Structure for Your Logical Data Model, describes components of the physical warehouse schema such as columns and tables and explores how you can map components from the logical data model to components in the database to form the physical warehouse schema. Chapter 4, Creating and Configuring a Project, describes the major components involved in project creation and guides you through the process of creating a project in MicroStrategy. Chapter 5, Creating a Project Using Architect, guides you through the process of creating a project in MicroStrategy using Architect.
xiii
Preface
Chapter 6, The Building Blocks of Business Data: Facts, describes the structure of facts and explores different types of facts and how they relate to your business data. This chapter also covers all the steps necessary to create facts for your project. Chapter 7, The Context of Your Business Data: Attributes, provides a conceptual look at the structure of attributes and explores different types of attributes and how they relate to your business data. This chapter also covers all the steps necessary to create attributes for your project. Chapter 8, Creating Hierarchies to Organize and Browse Attributes, discusses the different types of hierarchies in MicroStrategy, and explains how you can create user hierarchies to help organize and enhance your project. Chapter 9, Optimizing and Maintaining Your Project, describes methods you can implement to better optimize and maintain your project for both the short and long term. Chapter 10, Creating Transformations to Define Time-Based and Other Comparisons, discusses the different types of transformations in MicroStrategy and describes how you can create transformations in your project.
The appendixes contain the following additional reference information, which you may or may not require depending on your specific needs: Appendix A, MicroStrategy Tutorial, provides information on the MicroStrategy Tutorial project, which includes a metadata and warehouse, and a set of demonstration applications designed to illustrate the features of the MicroStrategy platform. Appendix B, Logical Tables, discusses logical tables, the different types of logical tables, and how to create logical tables and views in MicroStrategy. Appendix C, Data Types, provides information about the different data types in MicroStrategy. Information on integrating MicroStrategy with your MDX Cube sources such as SAP BW, Microsoft
xiv
Preface
Analysis Services, and Hyperion Essbase is provided in the MicroStrategy MDX Cube Reporting Guide.
xv
Preface
MicroStrategy 9.0
Create a project using the new, intuitive design tool called Architect. Architect lets you perform project design and object creation tasks in one interface (see Creating a Project Using Architect, page 101.) Internationalize your projects to support your language-specific user communities (see Supporting data internationalization, page 61.)
Preface
Define how attribute forms are displayed by taking advantage of new attribute form properties (see Displaying forms: Attribute form properties, page 245.) Connect a project to multiple relational data sources using MultiSource Option (see Accessing multiple data sources in a project, page 345.)
Prerequisites
Before working with this document, you should be familiar with: The information provided in the MicroStrategy Installation and Configuration Guide The nature and structure of the data you want to use for your business intelligence application
xvii
Preface
Resources
Documentation
MicroStrategy provides both manuals and online help; these two information sources provide different types of information, as described below. Manuals: In general, MicroStrategy manuals provide: Introductory information and concepts Examples Checklists and high-level procedures to get started
Help: In general, MicroStrategy help provides: Detailed steps to perform procedures Descriptions of each option on every software screen
Manuals
The following manuals are available from your MicroStrategy disk or the machine where MicroStrategy was installed. The steps to access them are below. Adobe Acrobat Reader is required to view these manuals. If you do not have Acrobat Reader installed on your computer, you can download it from www.adobe.com/products/acrobat/readstep2 _allversions.html. The best place for all users to begin is with the MicroStrategy Basic Reporting Guide.
MicroStrategy Overview
Introduction to MicroStrategy: Evaluation Guide Instructions for installing, configuring, and using the MicroStrategy Evaluation Edition of the software. This
xviii Resources
2010 MicroStrategy, Inc.
Preface
guide also includes a detailed, step-by-step evaluation process of MicroStrategy features, where you perform reporting with the MicroStrategy Tutorial project and its sample business data. MicroStrategy Quick Start Guide Overview of the installation and evaluation process, and additional resources. Evaluate MicroStrategy for Linux Guide Evaluate MicroStrategy for Linux, in a Microsoft Windows or Linux environment, with the MicroStrategy Evaluation Edition Virtual Appliance. This guide provides all details to download, activate, and evaluate MicroStrategy software running in a Linux environment. MicroStrategy Reporting Suite Quick Start Guide Evalute MicroStrategy as a departmental solution. Provides detailed information to download, install, configure, and use the MicroStrategy Reporting Suite.
xix
Preface
MicroStrategy Advanced Reporting Guide Instructions for advanced topics in the MicroStrategy system, building on information in the Basic Reporting Guide. Topics include reports, Freeform SQL reports, Query Builder reports, filters, metrics, Data Mining Services, custom groups, consolidations, and prompts.
MicroStrategy Report Services Document Creation Guide Instructions to design and create Report Services documents, building on information in the Basic Reporting Guide and Advanced Reporting Guide.
MicroStrategy OLAP Services Guide Information on MicroStrategy OLAP Services, which is an extension of MicroStrategy Intelligence Server. OLAP Services features include Intelligent Cubes, derived metrics, derived elements, dynamic aggregation, view filters, and dynamic sourcing.
MicroStrategy Office User Guide Instructions for using MicroStrategy Office to work with MicroStrategy reports and documents in Microsoft Excel, PowerPoint, Word, and Outlook, to analyze, format, and distribute business data.
MicroStrategy Mobile User Guide Instructions for using MicroStrategy Mobile to view and analyze data, and perform other business tasks with MicroStrategy reports and documents on a mobile device. Covers installation and configuration of MicroStrategy Mobile and how a designer working in MicroStrategy Desktop or MicroStrategy Web can create effective reports and documents for use with MicroStrategy Mobile.
MicroStrategy System Administration Guide Volume 1 Concepts and high-level steps to implement, deploy, maintain, tune, and troubleshoot a MicroStrategy business intelligence system.
xx Resources
Preface
MicroStrategy System Administration Guide Volume 2 Concepts and high-level steps for using various administrative tools such as MicroStrategy Command Manager, MicroStrategy Enterprise Manager, MicroStrategy Integrity Manager, and MicroStrategy Health Center.
MicroStrategy Functions Reference Function syntax and formula components; instructions to use functions in metrics, filters, attribute forms; examples of functions in business scenarios.
MicroStrategy MDX Cube Reporting Guide Information to integrate MicroStrategy with MDX cube sources. You can integrate data from MDX cube sources such as SAP BW, Microsoft Analysis Services, and Hyperion Essbase into your MicroStrategy projects and applications.
MicroStrategy Web Services Administration Guide Concepts and tasks to install, configure, tune, and troubleshoot MicroStrategy Web Services.
Resources
xxi
Preface
MicroStrategy Narrowcast Server Installation and Configuration Guide Information to install and configure Narrowcast Server.
MicroStrategy Narrowcast Server Application Designer Guide Fundamentals of designing Narrowcast Server applications.
MicroStrategy Narrowcast Server System Administrator Guide Concepts and high-level steps to implement, maintain, tune, and troubleshoot Narrowcast Server.
MicroStrategy Narrowcast Server Upgrade Guide Instructions to upgrade an existing Narrowcast Server.
xxii Resources
Preface
1 From the Windows Start menu, choose Programs (or All Programs), MicroStrategy, then Product Manuals. A page opens in your browser showing a list of available manuals in PDF format and other documentation sources. 2 Click the link for the desired manual or other documentation source. 3 The Narrowcast Services SDK Guide must be downloaded. When you select this guide, the File Download dialog box opens. Select Open this file from its current location, and click OK. If bookmarks are not visible on the left side of an Acrobat (PDF) manual, from the View menu click Bookmarks and Page. This step varies slightly depending on your version of Adobe Acrobat Reader.
To access installed manuals on UNIX and Linux
1 Within your UNIX or Linux machine, navigate to the directory where you installed MicroStrategy. The default location is /opt/MicroStrategy, or $HOME/MicroStrategy/install if you do not have write access to /opt/MicroStrategy. 2 From the MicroStrategy installation directory, open the Documentation folder. 3 Open the Product_Manuals.htm file in a web browser. A page opens in your browser showing a list of available manuals in PDF format and other documentation sources. 4 Click the link for the desired manual or other doucmentation source.
Resources
xxiii
Preface
5 The Narrowcast Services SDK Guide must be downloaded. When you select this guide, the File Download dialog box opens. Select Open this file from its current location, and click OK. If bookmarks are not visible on the left side of an Acrobat (PDF) manual, from the View menu click Bookmarks and Page. This step varies slightly depending on your version of Adobe Acrobat Reader.
Help
MicroStrategy provides several ways to access help: Help button: Use the Help button or ? (question mark) icon on most software windows to see help for that window. Help menu: From the Help menu or link at the top of any screen, select MicroStrategy Help to see the table of contents, the Search field, and the index for the help system. F1 key: Press F1 to see context-sensitive help that describes each option in the software window you are currently viewing.
Documentation standards
MicroStrategy online help and PDF manuals (available both online and in printed format) use standards to help you
xxiv Resources
Preface
identify certain types of content. The following table lists these standards. These standards may differ depending on the language of this manual; some languages have rules that supersede the table below.
Type bold Indicates Button names, check boxes, dialog boxes, options, lists, and menus that are the focus of actions or part of a list of such GUI elements and their definitions Text to be entered by the user Example: Click Select
c:\filename d:\foldername\filename
Courier font
Calculations Code samples Registry keys Path and file names URLs Messages displayed in the screen
Example:
Sum(revenue)/number of months.
UPPERCASE Keyboard command key (such as ENTER) Shortcut key (such as CTRL+V) Example: To bold the selected text, press CTRL+B. + A keyboard command that calls for the use of more than one key (for example, SHIFT+F1) A note icon indicates helpful information for specific situations. A warning icon alerts you to important information such as potential security risks; these should be read before continuing.
Education
MicroStrategy Education Services provides a comprehensive curriculum and highly skilled education consultants. Many customers and partners from over 800 different organizations have benefited from MicroStrategy instruction.
Resources
xxv
Preface
Courses that can help you prepare for using this manual or that address some of the information in this manual include: MicroStrategy Architect: Project Design
For the most up-to-date and detailed description of education offerings and course curricula, visit www.microstrategy.com/Education.
Consulting
MicroStrategy Consulting Services provides proven methods for delivering leading-edge technology solutions. Offerings include complex security architecture designs, performance and tuning, project and testing strategies and recommendations, strategic planning, and more. For a detailed description of consulting offerings, visit www.microstrategy.com/Consulting.
International support
MicroStrategy supports several locales. Support for a locale typically includes native database and operating system support, support for date formats, numeric formats, currency symbols, and more. It also includes the availability of translated interfaces and documentation. The level of support is defined in terms of the components of a MicroStrategy business intelligence environment. A MicroStrategy business intelligence environment consists of the following components, collectively known as a configuration: Warehouse, metadata, and statistics databases MicroStrategy Intelligence Server MicroStrategy Web server MicroStrategy Desktop client Web browser
xxvi Resources
Preface
MicroStrategy is certified in homogeneous configurations (where all the components lie in the same locale) in the following languages: English (US), French, German, Italian, Japanese, Korean, Portuguese (Brazilian), Spanish, Chinese (Simplified), Chinese (Traditional), Danish, and Swedish. MicroStrategy also provides limited support for heterogeneous configurations (where some of the components may lie in different locales). Please contact MicroStrategy Technical Support for more details. A translated user interface is available in each of the above languages. In addition, translated versions of the online help files and product documentation are available in several of the above languages.
Technical Support
If you have questions about a specific MicroStrategy product, you should: 1 Consult the product guides, Help, and readme files. Locations to access each are described above. 2 Consult the MicroStrategy Knowledge Base online at https://resource.microstrategy.com/support. A technical administrator in your organization may be able to help you resolve your issues immediately. 3 If the resources listed in the steps above do not provide a solution, contact MicroStrategy Technical Support directly. To ensure the most productive relationship with MicroStrategy Technical Support, review the Policies and Procedures document in your language, posted at http://www.microstrategy.com/Support/Policies. Refer to the terms of your purchase agreement to determine the type of support available to you. MicroStrategy Technical Support can be contacted by your companys Support Liaison. A Support Liaison is a person whom your company has designated as a point-of-contact with MicroStrategys support personnel. All customer
Resources
xxvii
Preface
inquiries and case communications must come through these named individuals. Your company may designate two employees to serve as their Support Liaisons, and can request to change their Support Liaisons two times per year with prior written notice to MicroStrategy Technical Support. It is recommended that you designate Support Liaisons who have MicroStrategy Administrator privileges. This can eliminate security conflicts and improve case resolution time. When troubleshooting and researching issues, MicroStrategy Technical Support personnel may make recommendations that require administrative privileges within MicroStrategy, or that assume that the designated Support Liaison has a security level that permits them to fully manipulate the MicroStrategy projects and has access to potentially sensitive project data such as security filter definitions.
xxviii Resources
Preface
The following table shows where, when, and how to contact MicroStrategy Technical Support. If your Support Liaison is unable to reach MicroStrategy Technical Support by phone during the hours of operation, they can leave a voicemail message, send email or fax, or log a case using the Online Support Interface. The individual Technical Support Centers are closed on certain public holidays.
North America Email: support@microstrategy.com Web: https://resource.microstrategy.com/support Fax: (703) 8428709 Phone: (703) 8488700 Hours: 9:00 A.M.7:00 P.M. Eastern Time, MondayFriday except holidays Email: eurosupp@microstrategy.com Web: https://resource.microstrategy.com/support Fax: +44 (0) 208 711 2525 The European Technical Support Centre is closed on national public holidays in each country. Phone: Belgium: + 32 2792 0436 France: +33 17 099 4737 Germany: +49 22 16501 0609 Ireland: +353 1436 0916 Italy: +39 023626 9668 Poland: +48 22 321 8680 Scandinavia & Finland: +46 8505 20421 Spain: +34 91788 9852 The Netherlands: +31 20 794 8425 UK: +44 (0) 208 080 2182 International distributors: +44 (0) 208 080 2183 Hours: United Kingdom: 9:00 A.M.6:00 P.M. GMT, Monday-Friday except holidays EMEA (except UK): 9:00 A.M.6:00 P.M. CET, Monday-Friday except holidays Email: apsupport@microstrategy.com Web: https://resource.microstrategy.com/support Phone: Australia: +61 2 9333 6499 Korea: +82 2 560 6565 Fax: +82 2 560 6555 Japan: +81 3 3511 6720 Fax: +81 3 3511 6740 Asia Pacific (except Australia, Japan, and Korea): +65 6303 8969 Fax: +65 6303 8999 Hours: Japan and Korea: 9:00 A.M.6:00 P.M. JST (Tokyo), Monday-Friday except holidays Asia Pacific (except Japan and Korea): 8 A.M.-6 P.M. (Singapore) Monday-Friday except holidays Email: latamsupport@microstrategy.com Web: https://resource.microstrategy.com/support Phone:
Asia Pacific
Latin America
LATAM (except Brazil and Argentina): +54 11 5222 9360 Fax: +54 11 5222 9355 Argentina: 0 800 444 MSTR Fax: +54 11 5222 9355 Brazil: +55 11 3054 1010 Fax: +55 11 3044 4088
Hours: 9:00 A.M.7:00 P.M. BST (So Paulo), MondayFriday except holidays
Resources
xxix
Preface
Support Liaisons should contact the Technical Support Center from which they obtained their MicroStrategy software licenses or the Technical Support Center to which they have been designated.
If this is the Support Liaisons first call, they should also be prepared to provide the following: Street address Phone number Fax number Email address
To help the Technical Support representative resolve the problem promptly and effectively, be prepared to provide the following additional information: Case number: Please keep a record of the number assigned to each case logged with MicroStrategy Technical
xxx Resources
Preface
Support, and be ready to provide it when inquiring about an existing case Software version and product registration numbers of the MicroStrategy software products you are using Case description: What causes the condition to occur? Does the condition occur sporadically or each time a certain action is performed? Does the condition occur on all machines or just on one? When did the condition first occur? What events took place immediately prior to the first occurrence of the condition (for example, a major database load, a database move, or a software upgrade)? If there was an error message, what was its exact wording? What steps have you taken to isolate and resolve the issue? What were the results? System configuration (the information needed depends on the nature of the problem; not all items listed below may be necessary): Computer hardware specifications (processor speed, RAM, disk space, and so on) Network protocol used ODBC driver manufacturer and version Database gateway software version (For MicroStrategy Web-related problems) browser manufacturer and version (For MicroStrategy Web-related problems) Web server manufacturer and version If the issue requires additional investigation or testing, the Support Liaison and the MicroStrategy Technical Support representative should agree on certain action items to be
2010 MicroStrategy, Inc. Resources
xxxi
Preface
performed. The Support Liaison should perform any agreed-upon actions before contacting MicroStrategy Technical Support again regarding the issue. If the Technical Support representative is responsible for an action item, the Support Liaison may call MicroStrategy Technical Support at any time to inquire about the status of the issue.
Feedback
Please send any comments or suggestions about user documentation for MicroStrategy products to: documentationfeedback@microstrategy.com Send suggestions for product enhancements to: support@microstrategy.com When you provide feedback to us, please include the name and version of the products you are currently using. Your feedback is important to us as we prepare for future releases.
xxxii Feedback
1
1.
Introduction
Before planning and creating a project in MicroStrategy, it is important to understand how business intelligence systems work and, specifically, how the MicroStrategy platform interacts with your business data to provide a wide range of functionality. Business intelligence (BI) systems facilitate the analysis of volumes of complex data by providing the ability to view data from multiple perspectives. An optimum business intelligence application: Gives users access to data at various levels of detail Allows users to request information and have it delivered to them accurately and quickly Provides a foundation for the proactive delivery of information to system subscribers
This chapter introduces you to the basic architecture of BI systems, as well as some of the components within the
MicroStrategy platform that allow you to create and analyze your business intelligence.
The diagram above illustrates the common setup for standardizing data from source systems and transferring that data into MicroStrategy. MicroStrategy can also access data from text files, Excel files, SAP BI, Hyperion Essbase, Microsoft Analysis Services, and other data sources. For more information on how MicroStrategy can access your data sources, see Data warehouse for data storage and relational design, page 5.
Recall the example of a bank that relies on several source systems to store data related to the many services the bank offers. Each of these business services has a different and specific workflow.
2010 MicroStrategy, Inc. Business intelligence architecture
At an automated teller machine (ATM), you can withdraw or deposit money as well as check on balances. However, to get a money order, you must enter the bank and perform the transaction with a bank teller. This is because the operational systems supporting these two services are designed to perform specific tasks, and these two services require different operational systems. If a bank wants to see a unified view of a particular customer, such as a customer's ATM activity, loan status, account balances, and money market account information, the customer information stored in each of these different systems must be consolidated. This consolidation is achieved using the extraction, transformation, and loading (ETL) process. The ETL process consolidates data so it can be stored in a data warehouse.
each source system can have its own naming conventions, the data that comes from one system may be inconsistent with the data that comes from another system. In this case, the ETL process extracts the data from the different banking source systems, transforms it until it is standardized and consistent, and then loads the data into the data warehouse.
OLTP source systems which must be able to handle frequent updates as data is gathered. For more information on source systems, see Source systems for data collection, page 3. Data is aligned by business subjects. Data formats are uniformly integrated using an ETL process (see Extraction, transformation, and loading process, page 4). Data history extends long-term, usually two to five years. A data warehouse is populated with data from the existing operational systems using an ETL process, as explained in Extraction, transformation, and loading process, page 4. The structure of data in a data warehouse and how it relates to your MicroStrategy environment can be defined and understood through a logical data model and physical warehouse schema. Defining a projects logical data model and physical warehouse schema are important steps in preparing your data for a MicroStrategy project. For more information on the steps of the project design process, see Chapter 2, The Logical Data Model and Chapter 3, Warehouse Structure for Your Logical Data Model.
MDX Cube sources. MicroStrategy can integrate with these data sources while simultaneously accessing a relational database effectively. For more information on connecting to and integrating MDX Cube sources in MicroStrategy, see the MicroStrategy MDX Cube Reporting Guide. Text files and Excel files: With MicroStrategys Freeform SQL and Query Builder features, you can query, analyze, and report on data stored in text files and Excel files. As with MDX Cube sources described above, MicroStrategy can report against these alternative data sources while concurrently accessing a relational database to integrate all of your data into one cohesive project. For more information on using text files and Excel files with the Freeform SQL and Query Builder features, see the MicroStrategy Advanced Reporting Guide.
MicroStrategy environment, which together provide a flexible reporting environment MicroStrategy Architect, page 15a project design tool, which allows you to define all the required components of your project from a centralized interface.
The MicroStrategy platform components work together to provide an analysis and reporting environment to your user community, as shown in the following diagram.
The sections that follow provide a brief overview of each of these components. For more detailed information about these and the other components that make up the MicroStrategy platform, refer to the MicroStrategy Installation and Configuration Guide. To learn how to administer and tune the MicroStrategy platform, see the MicroStrategy System Administration Guide.
MicroStrategy metadata
MicroStrategy metadata is a repository that stores MicroStrategy object definitions and information about your
data warehouse. The information is stored in a proprietary format within a relational database. The metadata maps MicroStrategy objectswhich are used to build reports and analyze datato your data warehouse structures and data. The metadata also stores the definitions of all objects created with MicroStrategy Desktop and Web such as templates, reports, metrics, facts, and so on. In general, report creation in MicroStrategy is achieved through using various types of objects which represent your data as report building blocks. You can build and manipulate several fundamentally different kinds of objects in MicroStrategy; these objects, which are described below, are all created and stored in the metadata repository. Configuration objectsObjects that provide important information or governing parameters for connectivity, user privileges, and project administration. Examples include database instances, users, groups, and so on. These objects are not used directly for reporting, but are created by a project architect or administrator to configure and govern the platform. As a general rule, configuration objects are created and maintained with the managers in MicroStrategy Desktop within the Administration icon. For more information about creating and administering configuration objects, see the MicroStrategy System Administration Guide. Schema objectsObjects that are created in the application to correspond to database objects, such as tables, views, and columns. Schema objects include facts, attributes, hierarchies, and other objects which are stored in the Schema Objects folder in MicroStrategy Desktops folder list. Facts, attributes, and hierarchies are three essential pieces to any business intelligence application. These schema objects are often created and managed by a MicroStrategy architect: Facts relate numeric data values from the data warehouse to the MicroStrategy reporting environment. Facts are used to create metrics, which are analytical calculations that are displayed on a report. The number of units sold is one example of a fact. Facts are discussed in more detail in Chapter 6, The Building Blocks of Business Data: Facts.
Attributes represent the business context in which fact data is relevant. In the example of regional sales in the Southeast, Southeast represents the attribute or context of the sales data. Attributes are used to define the level at which you want to view the numeric data on a report. Attributes are discussed in more detail in Chapter 7, The Context of Your Business Data: Attributes. Hierarchies are groupings of attributes so that they can be displayed to reflect their relationships to other attributes. These groupings can help users make logical connections between attributes when reporting and analyzing data. One of the most common examples of a hierarchy is a time hierarchy which includes attributes such as Year, Month, Quarter, and so on. Hierarchies are discussed in more detail in Chapter 8, Creating Hierarchies to Organize and Browse Attributes. Application objectsObjects used to provide analysis of and insight into relevant data. Application objects include reports, documents, filters, templates, custom groups, metrics, and prompts. Application objects are created using schema objects as building blocks. All application objects can be created and maintained in MicroStrategy Desktop. Reports and documents can also be created and managed in MicroStrategy Web. Information on creating application objects is in the MicroStrategy Basic Reporting Guide and MicroStrategy Advanced Reporting Guide. For more information about MicroStrategy Web, see MicroStrategy Web and Web Universal, page 13. The metadata enables the sharing of objects across MicroStrategy applications by providing a central repository for all object definitions. MicroStrategy Intelligence Server evaluates the most efficient data retrieval scenario to provide excellent query performance. MicroStrategy metadata also facilitates the retrieval of data from the data warehouse when using MicroStrategy applications. It converts user requests into SQL queries and translates the results of those SQL queries back into
MicroStrategy objects such as reports and documents which can be easily analyzed and understood.
MicroStrategy Intelligence Server also provides a library of over 150 different sophisticated mathematical and statistical functions. You can also add and define your own functions. See the MicroStrategy Functions Reference for details about these functions. For information on how to install and configure MicroStrategy Intelligence Server, refer to the MicroStrategy Installation and Configuration Guide. For a detailed description of MicroStrategy Intelligence Server functionality and tuning recommendations, refer to the MicroStrategy System Administration Guide.
MicroStrategy Desktop
MicroStrategy Desktop is an advanced, Windows-based environment providing a complete range of analytical functionality designed to facilitate the deployment of reports. MicroStrategy Desktop provides the project designer functionality essential to creating both schema and application objects necessary to serve the user communities of both MicroStrategy Desktop and Web.
11
Desktop enables you to model applications using an intuitive, graphical interface. It provides a unified environment for creating and maintaining business intelligence projects. If you need to change how to view your business information or how the data is modeled, Desktop provides the ability to modify one aspect of the application without affecting the others. Desktop is where you can manage application objects such as reports, filters, and metrics. However, before application objects are created, schema objects must first exist. Schema objects allow application objects to interact with the data warehouse to access the data for analysis. Facts, attributes, hierarchies, and other schema objects are the building blocks for application objects such as reports and documents. For example, facts are used to create metrics, which are in turn used to design reports. Application objects such as reports are used to analyze and provide insight into the relevant data. One of the other functions of MicroStrategy Desktop is to create projects. Projects are discussed in Chapter 4, Creating and Configuring a Project. The following examples highlight some ways in which Desktop allows you to model your business intelligence applications: Every report or query can automatically benefit from the tables you include in an application. Tables in MicroStrategy are references to tables in your data warehouse, thus providing access to your data. You can change the structure of a business hierarchy by re-ordering it. This modification is necessary if you have new requirements that require you to add or remove new levels of data in a hierarchy. The change automatically takes effect in the application, without making any alterations to the database.
After reports have been created, report designers and analysts can deploy them through different interfaces, including MicroStrategy Desktop, MicroStrategy Web, and MicroStrategy Office. For information about the various components that comprise MicroStrategy Desktop, refer to the MicroStrategy Installation and Configuration Guide.
12 The MicroStrategy platform
2010 MicroStrategy, Inc.
For more information about creating application objects such as reports in MicroStrategy Desktop, refer to the MicroStrategy Basic Reporting Guide. For information on advanced Desktop functionality, see the MicroStrategy Advanced Reporting Guide.
13
MicroStrategy project
A project is where you build and store all schema objects and information you need to create application objects such as reports in the MicroStrategy environment, which together provide a flexible reporting environment. A project also represents the intersection of a data source, metadata repository, and user community. In MicroStrategy Desktop, projects appear one level below project sources in the Folder List. A project: Determines the set of data warehouse tables to be used, and therefore the set of data available to be analyzed. Contains all schema objects used to interpret the data in those tables. Schema objects include facts, attributes, hierarchies, and so on. Schema objects are discussed in later chapters in this guide. Contains all reporting objects used to create reports and analyze the data. Reporting objects include metrics, filters, reports, and so on. Report objects are covered in the MicroStrategy Basic Reporting Guide and the MicroStrategy Advanced Reporting Guide. Defines the security scheme for the user community that accesses these objects. Security objects include security filters, security roles, privileges, access control, and so on. Security and other project-level administrative features are discussed in the MicroStrategy System Administration Guide.
A project can contain any number of reports in addition to a number of other objects that support simple and advanced reporting requirements. Conceptually, a project the environment in which all related reporting is done. A project can contain many types of objects, including application objects such as filters, prompts, metrics, and reports that you can create using schema objects such as attributes and facts. Projects are often used to separate data from a data warehouse into smaller sections of related data that fit user requirements. For example, you may have a project source separated into four different projects with analysis areas such as human resources, sales distribution, inventory, and
14 The MicroStrategy platform
2010 MicroStrategy, Inc.
customer satisfaction. This allows all of your users in the human resources department to use the human resources project and they do not have to look through inventory data that they are not interested in. Some key concepts to understand before you begin creating a project are as follows: A project is created within a specified metadata repository, determined by the project source through which you create the project. The projects warehouse location is specified by associating it with the appropriate database instance.
The procedures associated with these concepts are explained in Creating a project, page 79.
MicroStrategy Architect
MicroStrategy 9.0 introduces a new project design tool known as Architect. Architect allows you to define all the required components of your project from a centralized interface. Architect also provides a visual representation of your project as you create it, which helps to provide an intuitive workflow. Creating and modifying a project using Architect is covered in Chapter 4, Creating and Configuring a Project and Chapter 5, Creating a Project Using Architect.
15
modeling, schema design and implementation, and project creation, which are each covered in the following chapters:
Notice that the project design process includes a feedback loop. Designing a project is very rarely a single, linear process. As projects are deployed and tested, new user requirements and project enhancements require modification to the initial project design. It is important to keep this in mind as you design your project and plan for the next phase of development.
2
2.
Introduction
Devising a model of your business data can help you analyze the structure of the data, how its various parts interact, and can also help you decide what you intend to learn from the data. This chapter describes one of the major components of data modeling: the logical data model. A logical data model is a logical arrangement of data as experienced by the general user or business analyst. This is different from the physical data model or warehouse schema, which arranges data for efficient database use. The logical data model graphically depicts the flow and structure of data in a business environment, providing a way of organizing data so it can be analyzed from different business perspectives.
17
The logical data modeling process produces a diagram similar to the one shown in the following diagram:
A logical data model represents the definition, characteristics, and relationships of data in a technical, conceptual, or business environment. This process can help you think about the various elements that compose your companys business data and how those elements relate to one another. Devising a logical data model for your business intelligence environment allows you to then consider various ways to physically store the business data in the data warehouse. This
19
is usually one of the first steps in designing a project, as shown in the following diagram:
This chapter provides conceptual information about logical data models, the elements that exist within them, and also general instructions and guidelines for creating these models. A logical data model is a graphic representation of the following concepts: Facts: Business data and measurements, page 20 Attributes: Context for your levels of data, page 22 Hierarchies: Data relationship organization, page 24
Inventory, and Account Balance are some examples of facts you can use as business measurements. Facts allow you to access data stored in a data warehouse and they form the basis for the majority of users analysis and report requirements. In MicroStrategy, facts are schema objects that relate data values (typically numeric data) from the data warehouse to the MicroStrategy reporting environment. Facts are the building blocks used to create business measurements or metrics from which to derive insight into your data. The rest of data modeling consists mostly of providing context for the data that facts provide access to. In a data warehouse, facts exist as columns within the fact tables. They can come from different source systems and they can have different levels of detail. For example, you can capture sales data in one system and track it daily, while you capture stock and inventory data in another system and track it weekly. To those familiar with SQL, facts generally represent the numeric columns in database tables on which you perform SQL aggregations, such as SUM and AVG. For example, in the following SQL statement, the ORDER_AMT column in the warehouse may correspond to the Order Amount fact in the MicroStrategy environment: SELECT sum(a21.ORDER_AMT) EMP_NAME FROM ORDER_FACT a21 JOIN LU_EMPLOYEE a22 ON (a21.EMP_ID = a22.EMP_ID) WHERE a22.CALL_CTR_ID in (5, 9, 12) In addition, while ORDER_AMT is the fact, sum(a21.ORDER_AMT) represents a metric, which are business calculations often built using facts. Metrics are discussed in detail in the MicroStrategy Basic Reporting Guide. For a more complete discussion about facts, refer to Chapter 6, The Building Blocks of Business Data: Facts.
21
Attributes provide context and levels for convenient summarization and qualification of your data to help answer the type of questions listed above. They are used to answer business questions about facts at varying levels of detail. For example, if your sales data is stored at the day level, a Month attribute allows you to see the same sales data summarized at the month level. To those familiar with SQL, attributes generally represent the non-numeric and non-aggregatable columns in database tables. These columns are used to qualify and group fact data. For example, in the following SQL statement, the MONTH_ID column in the warehouse maps to the Month attribute in the MicroStrategy environment: SELECT a11.MONTH_ID MONTH_ID, max(a12.MONTH_DESC) MONTH_DESC, sum(a11.TOT_DOLLAR_SALES) DLRSALES FROM MNTH_CATEGORY_SLS a11 join LU_MONTH a12 on (a11.MONTH_ID = a12.MONTH_ID)
WHERE a11.MONTH_ID in (200201,200202,200203) GROUP BY al1.MONTH_ID Attribute forms contain additional descriptive information about a given attribute and are discussed in terms of the logical data model in Attribute forms, page 36. For a complete discussion about attributes, refer to Chapter 7, The Context of Your Business Data: Attributes.
23
By recognizing and understanding the elements of an attribute, you can better design your data model and project. Although attribute elements are not included in the logical data model, they are necessary in understanding attribute relationships. Attribute elements are discussed in more detail in Unique sets of attribute information: Attribute elements, page 237.
Attribute relationships
Building an effective project in MicroStrategy requires you, as the project designer, to have a solid understanding of all the attributes in the project, as well as how each of them relates to the other attributes. Attribute relationships, which are associations between attributes that specify how attributes are connected, are essential to the logical data model. Without relationships, there is no interaction between data, and therefore no logical structure. The relationships give meaning to the data by providing logical associations of attributes based on business rules. Every direct relationship between attributes has two partsa parent and a child. A child must always have a parent and a parent can have multiple children. The parent attribute is at a higher logical level than the child is. For example, in a relationship between Year and Quarter, Year is the parent attribute and Quarter is the child. Attributes are either related or unrelated to each other. Examples of related and unrelated attributes, along with more detailed information about attribute relationships, are discussed in Attribute relationships, page 260.
organize or group attributes into logical business areas. For example, you can group the attributes Year, Month, and Day to form the Time hierarchy. In a logical data model, hierarchies contain attributes that are directly related to each other. Attributes in one hierarchy are not directly related to attributes in another hierarchy. For example, Year and Quarter are attributes that are usually directly related to each other. One year has many quarters and both attributes are in the Time hierarchy. Year and Customer are attributes that are usually not in the same hierarchy and are not directly related to each other. However, if you want to create a report that shows information about customer purchases in a particular year, there must be some way to determine how these two attributes are related. Year and Customer are related through a fact. It is the existence of a fact that ties the Time hierarchy to the Customer hierarchy. In this case, the fact is a customer purchase. Therefore, facts exist at the intersection of hierarchies. They are identified by multiple attributes, which represent the level at which a fact is stored. A graphical example of how facts, attributes, and hierarchies are related and form a complete logical data model is shown in the section Sample data model, page 25 below. For a complete discussion about hierarchies, refer to Chapter 8, Creating Hierarchies to Organize and Browse Attributes.
25
User requirements
The primary goal of logical data modeling is to meet the needs of your users reporting requirements. Developing such a model involves the following: Identification of user requirements Design of solutions Evaluation of those solutions
Logical data modeling is a reiterative process, where additional questions and concerns arise with each draft of the logical data model. Your user community can consist of people with vastly different requirements. For example, company executives are typically interested in overall trends and may want reports showing data aggregated across the company and over a long period of time. Lower-level managers are typically more interested in data about their particular areas of responsibility. These managers may want reports about their specific region or store over short-and long-terms. When creating the logical data model, you must consider all the potential users and how to accommodate their varied requirements. In some cases, lack of data in the source systems can limit user requirements. Sometimes, to satisfy user requirements, you can derive additional data not found in the source systems, as explained in Existing source systems, page 27. User requirements are an important part of the initial project design process. However, additional user requirements can be encountered after deploying a project as users encounter areas for enhancement. In some cases, new user requirements may require you to modify the logical data model to better support the type of analysis and the retrieval of data that users demand.
27
work in creating a suitable logical data model involves determining what additional components are required to satisfy the needs of the user community. For example, an insurance companys transactional system records data by customer and city, but the business analysts want to see data for different states or regions. State and region do not appear in the existing source data and so you need to extract them from another source. Additionally, although data is stored at a daily level in the source system, users also want to see data at the monthly or yearly level. In this case, you can plan additional attributes to provide the levels at which you intend to analyze the facts in your data model. Although some data may not exist in a source system, this does not mean that it should not be included in the logical data model. Conversely, everything you find in the source data does not necessarily need to be included in the logical data model. User requirements should drive the decision on what to include and what to exclude.
Whether you start from nothing or have an existing source system to use, the steps to create a logical data model are as follows: Step 1: Identify the facts, page 29 Step 2: Identify the attributes, page 30 Step 3: Determine attribute relationships, page 31 Step 4: Define hierarchies, page 32 The details in these steps are related to using an existing source system.
29
is an iterative process; if necessary, you can always add more attributes and facts later.
31
define the attribute Month as simply the month name (Dec, Jan, and so on) and not directly connected to a year (Dec 2005, Jan 2006, and so on) then the relationship would become many-to-many. If you have documentation for the existing data, such as an ERD, it is likely that the documentation provides some additional details about the nature of the data and any inherent relationships.
have one big hierarchy. Again, the requirements of your user community should help you determine what hierarchies are necessary.
These logical modeling conventions can provide cues for system optimization opportunities, help with system maintenance, and make for a more robust logical data model. Although the user community is the ultimate beneficiary of a well-optimized and maintained system, these conventions are primarily intended for project designers, administrators, and advanced report designers. Each convention adds more information about the data to the logical data model. This additional information can be particularly useful to a person learning about the system.
33
Unique identifiers
An additional modeling convention is to add unique identifiers for each attribute and fact. Unique identifiers denote the key that maps an attribute to its source data in the source system, when applicable. This information can help define primary keys in the physical warehouse schema (see Uniquely identifying data in tables with key structures, page 42). Remember that facts are usually identified by multiple attributes and therefore will have multiple unique identifiers. The following diagram shows a logical data model with unique identifiers added. Some attributes rely on more than one ID column to identify its elements. For example, note the Item attribute, which requires both the Item_ID and Class_ID columns to uniquely identify its elements.
35
determine how many customers have different dates of birth in the warehouse.
Attribute forms
Including attribute forms in your logical data model can help you get a more complete view of all of the information that is made available in your project. Attribute forms contain additional descriptive information about a given attribute. For example, you create an attribute called Customer to represent customers in your system, and it is part of the Customer hierarchy. Each element of the Customer attribute represents a different customer, and in the data, you store the following information about your customers: Customer number (some numeric code used to uniquely identify customers)
In your logical data model, you could have included each of these pieces of information as separate attributes, each with a one-to-one relationship to the Customer attribute. In reality, though, these attributes simply provide additional information about the Customer attribute; they do not represent different levels within the Customer hierarchy. When a one-to-one relationship exists between an attribute and one of its descriptions, you can model these additional pieces of descriptive information as attribute forms. The following diagram shows how you add attribute forms to a logical data model:
Attribute forms are discussed in terms of their role in MicroStrategy in Column data descriptions and identifiers: Attribute forms, page 243.
37
3
3.
Introduction
As discussed in the previous chapter, the logical data model can help you think about the logical structure of your business data and the many relationships that exist within that information. The physical warehouse schema is based on the logical data model. It is a detailed graphic representation of your business data as it is stored in the data warehouse. The physical warehouse schema organizes the logical data model in a method that makes sense from a database perspective. In contrast, the logical data model is a logical arrangement of data from the perspective of the general user or business analyst. For more information on what a logical data model is and how to create one, see Chapter 2, The Logical Data Model. The logical data model is only concerned with logical objects of the business model, such as Day, Item, Store, or Account. Several physical warehouse schemas can be derived from the same logical data model. The structure of the schema
2010 MicroStrategy, Inc.
39
depends on how the data representing those logical objects are to be stored in the warehouse. For example you can store logical objects in the same table, in separate tables, duplicated across several tables, or in some other arrangement. While the logical data model tells you what facts and attributes to create, the physical warehouse schema tells you where the underlying data for those objects is stored. The physical warehouse schema describes how your data is stored in the data warehouse and how it can be retrieved for analysis. Creating a physical warehouse schema is the next step in organizing your business data before you create a project, as shown below:
The key components that make up the physical warehouse schema are columns and tables. Columns and tables in the physical warehouse schema represent facts and attributes from the logical data model. The rows in a table represent attribute elements and fact data.
40
While each type of table may function differently within the data warehouse, each type of table can be assigned a primary key that uniquely identifies the elements within the given table.
41
Which key structure you use to identify a unique attribute in a table depends on the nature of your data and business requirements. The following diagram shows how the different key structures can be used to identify a calling center.
The simple key shows how you can identify a calling center with only its Call_Ctr_id. This means that every calling center has its own unique ID. In the compound key, calling centers are identified by both Call_Ctr_id and Region_id. This means that two calling centers from different regions can share the same Call_Ctr_id. For example, there can be a calling center with ID 1 in region A, and another calling center with ID 1 in region B. In this case, you cannot identify a unique calling center without knowing both the Call_Ctr_id and the Region_id. Simple keys are generally easier to handle in the data warehouse than are compound keys because they require less storage space and they allow for simpler SQL. Compound keys tend to increase SQL query complexity, query time, and
required storage space. However, compound keys have a more efficient ETL process. Which key structure you use for a particular attribute depends entirely on the nature of the data and your system. Consider what key structures work best when creating lookup tables in the physical warehouse schema.
43
tables each contain only a subset of all of the information about the attributes.
You can use either structure for any table in the physical warehouse schema, though each structure has its advantages and disadvantages, as explained in the following sections and outlined in the table in Schema type comparisons, page 60.
In the case of a many-to-many relationshipin which multiple elements of a parent attribute can relate to multiple elements of a child attributeyou must create a separate relate table as shown in the following diagram:
45
For more details on the level of aggregation of your fact data, see Fact table levels: The context of your data, page 48.
Derived fact columns are created through a mathematical combination of other existing fact columns. The following diagram shows an example of a fact table and how you can create a derived fact column from base fact columns:
In the example, the derived fact Tot_Dollar_Sales is created using the Qty_Sold, Unit_Price, and Discount fact columns. Also, the derived fact exists in several tables, including Item_Mnth_Sls and City_Ctr_Sls.
47
Because facts in different fact tables are typically stored at different levels, derived fact columns can only contain fact columns from the same fact table. There are advantages and disadvantages to consider when deciding if you should create a derived fact column. The advantage of storing derived fact columns in the warehouse is that the calculation of data is previously performed and stored separately, which translates into simpler SQL and a speedier query at report run time. The disadvantage is that derived fact columns require more storage space and more time during the ETL process. You can create the same type of data analysis in MicroStrategy with the use of metrics. Metrics allow you to perform calculations and aggregations on fact data from one or more fact columns. For more information on what metrics are and how to create them, see the MicroStrategy Advanced Reporting Guide. For more information on the different types of facts in MicroStrategy and how they are defined, see How facts are defined, page 194.
The Item_id, Day_id, and Call_Ctr_id columns in the table above represent practical levels at which sales and inventory data can be analyzed on a report. The Sales and Inventory facts can be analyzed at the item, day, and call center levels because those levels exist as ID columns in the fact table.
You do not need to include more lookup column IDs than are necessary for a given fact table. For example, notice that the table above does not include the Customer_id column; this is because analyzing inventory data at the customer level does not result in a practical business calculation. Fact tables should only include attribute ID columns that represent levels at which you intend to analyze the specific fact data. The levels at which facts are stored become especially important when you begin to have complex queries with multiple facts in multiple tables that are stored at levels different from one another, and when a reporting request involves still a different level. You must be able to support fact reporting at the business levels which users require.
49
The data for the Lookup_Region table came from a different source system than the data for the Lookup_Call_Ctr and the source systems have different naming conventions. This explains why the same information about regions is represented by two columns with different names. When you define facts and attributes in MicroStrategy Desktop, consider the heterogeneous column names that may exist in your source systems. In order for reports to retrieve accurate and complete results, heterogeneous columns must be mapped to their corresponding facts and attributes. For example, if you create a Region attribute given the tables in the example above, you must map both the Region_id and Reg_id columns to the attribute so all information about regions is calculated correctly and displayed on reports when the Region attribute is used. For consistency, it is a good idea for columns that contain the same data to have the same column name. This is called homogeneous column naming. In this case, the Region_ID column has the same name in both tables, as shown in the following diagram:
Just as it is possible for the same attribute data to exist in different lookup tables, it is also possible for the same fact data to exist in different fact tables. A fact column may or
may not have the same name in different tables, as shown below:
51
In each of these schemas a base fact table and any number of aggregate fact tables are used (For more information on aggregate fact tables, see Using summary tables to store data: Aggregate tables, page 358). Fact table keys consist of attribute keys relevant to the level of data stored in the table. The schema examples that follow show data at the Item/Call Center/Date level. When comparing the different schema types, you should keep in mind the following concepts: Redundant data can cause a couple of drawbacks. The most obvious drawback is that redundant data requires more storage space to hold the same amount of data as a system with no redundancy. Data redundancy also makes updating data a more intensive and difficult process because data resides in multiple places. With no data redundancy, data only has to be updated in a single place. Joins are SQL operations that are required to combine two tables together in order to retrieve data. These operations are necessary, but as with any operation performed on your data warehouse, the number of joins required to build your queries affects the performance of those queries. The sections below are not meant to be an exhaustive list of all possible schema types. However, the sections below are meant to give a description of the most common or general schema types that are used to develop a physical warehouse schema.
the ID column of the parent attribute, such as Dist_Ctr_id in the Lookup_Call_Ctr table.
53
The following diagram shows what physical lookup tables look like in the warehouse:
One benefit of using a highly normalized schema is that it requires minimal storage space in the warehouse because of it uses smaller lookup tables than the other schema types. However, there is a drawback to using only small tables in the data warehouse. When accessing higher-level lookup tables such as Lookup_Region in the example above, numerous joins are required to retrieve information about the higher-level tables. This is because each table contains only a small amount of information about a given attribute; therefore, multiple tables must be joined until the required column is found.
here is the higher-level attribute ID columns are present within all tables of related attributes. For example, Region_id is included in the Lookup_Call_Ctr table.
The fact table structure within a moderately normalized schema is identical to that of the highly normalized schema.
55
The following diagram shows what the physical lookup tables look like in the warehouse.
Using a moderately normalized schema provides a balance between the pros and cons of normalized and denormalized schema types. Because the ID columns of both the parents and grandparents of an attribute exist in multiple tables, fewer joins are required when retrieving information about an attribute. However, since some tables contain the same ID columns (as shown above with the Region_ID column), the tables within this type of schema take up some redundant storage space in the warehouse.
are present as well. For example, Region_desc is included in the Lookup_Call_Ctr table.
Using a highly denormalized schema further reduces the joins necessary to retrieve attribute descriptions. For example, you can include the descriptions of Call Center, Distribution Center, and Region along with Sales Dollars in the same report while only having to join the Lookup_Call_CTR and Fact_Sales tables. This is possible because Lookup_Call_CTR contains all information (including description data) for Call Center as well as for Distribution Center and Region. However, this schema type requires the largest amount of storage space within the warehouse because of its large lookup tables. High denormalized schemas also cause the highest level of data redundancy.
57
As with any schema type model there are advantages and disadvantages to using a star schema. As with a highly denormalized schema type, the amount of join operations are reduced by using a star schema. A star schema can also reduce the amount of storage space necessary in a highly denormalized schema. However, star schemas can often require large lookup tables that can take a more time to
search than the smaller tables that are used in the other schema types.
Design trade-offs
Constructing a logical data model and physical warehouse schema is an iterative process of compromises and trade-offs. The following diagram shows the three major requirements that must be balanced to create an effective system.
Each of these categories affects the others. If you try to satisfy every single user requirement from the simplest to the most complex, you will have to create an extensive data model and schema to support those requirements. This results in an increased load on the warehouse, slower query performance, and greater maintenance for the database administrator. You must decide which factors are most important in your particular environment and weigh them against the other factors. For example, if you have the storage space necessary to accommodate data in a star schema it may seem that you would never want to normalize your schema. However, SQL queries directed at a consolidated table require the use of a DISTINCT operator and these types of queries tend to be very expensive in terms of database resources and processing
2010 MicroStrategy, Inc. Design trade-offs
59
time. The use of a resource-intensive DISTINCT query could therefore negate any performance gain achieved by reducing the number of joins between higher-level lookup tables. In addition to the previous points, you may need higher level lookup tables to take advantage of aggregate tables, which are discussed in Using summary tables to store data: Aggregate tables, page 358. For more comparisons between the different schema types described in this chapter, see the following section Schema type comparisons, page 60.
Lookup Table Structure Attribute ID Attribute description column ID column of parent description column of parent ID column of grandparents description column of grandparents Consolidates an entire hierarchy into a single lookup table
Advantages Further reduces joins necessary to retrieve attribute descriptions as compared to a moderately normalized schema
Disadvantages Requires the most storage space and redundant data requires a more intensive process to update
Star schema
Further reduces joins necessary to retrieve attribute descriptions as compared to a moderately normalized schema Requires less storage space and data redundancy than a highly denormalized schema and thus data is easier to update
Large lookup tables can negatively affect query performance when searching tables and requiring DISTINCT operations to be performed
Now that you have gained an understanding of data modeling and the roles of facts and attributes, you can learn about these same schema objects in terms of how they exist in the MicroStrategy environment. As facts and attributes are the cornerstones of the reports you intend to create using MicroStrategy, it is essential to understand the structure of each of these schema objects before creating a project.
61
include translated data in your database depends on many factors. Some guidelines are provided below to help define your strategy so that internationalization can be supported and integrated easily into your MicroStrategy projects: Internationalization through tables and columns or databases, page 62 Supporting various character sets within databases, page 68
For a complete overview of internationalization in MicroStrategy, see the System Administration Guide.
To support displaying the name of each month in multiple languages, you can include the translated names in a separate column, one for each required language, within the same table. Each column can use a suffix to identify that the column contains translated data for a certain language. The same LU_MONTH_OF_YEAR table with translated data for the Spanish and German languages is shown below:
The data for Spanish is included in a MONTH_OF_YEAR_NAME column with the suffix _ES, and the data for German is included in a MONTH_OF_YEAR_NAME column with the suffix _DE. As an alternative to supplying translations by using separate columns in the same table, you can create separate tables for your translations. Each table can share the same column name for the same data in different languages. In the tables
63
below, the Spanish and German data is provided in separate Spanish and German tables:
The data for Spanish is included in a LU_MONTH_OF_YEAR table with the suffix _ES, but the MONTH_OF_YEAR column shares the same column name as in the English LU_MONTH_OF_YEAR table. The data for German uses the same technique and is stored in a LU_MONTH_OF_YEAR table with the suffix _DE. You can also use both techniques (separate tables and extra columns in one table) to store and identify your translated data. This can be helpful to distinguish the language used for each table and column. It can also be helpful if you have a primary language stored in one table, and you store all internationalizations in an internationalization table. For
example, you can store the Spanish and German data in the same internationalization table, as shown below:
In this scenario, the LU_MONTH_OF_YEAR_LANG table includes all translations in all languages other than the primary language, for the MONTH_OF_YEAR_NAME column. Each column is assigned a suffix to identify the language of the translated data. Be aware of the following: In the examples above, suffixes on tables and columns are used to identify the language of the translated data. While it is not a requirement to use suffixes for these identification purposes, it is the easiest method to define and support in MicroStrategy. Using prefixes or other naming conventions requires you to use some functions to recognize the location of the translated data. If your project supports data internationalization, you cannot use logical views as lookup tables for attributes that use translated data. For information on logical views, see Appendix B, Logical Tables.
65
For information on defining your project to use tables and/or columns to enable data internationalization, see Enabling data internationalization through SQL queries, page 92.
For the purposes of this example, you can assume this data is stored in a database name Tutorial (English). You also provide your projects in Spanish and German, which means you must have a database for Spanish and a database for German. Each database contains the same table structure,
column structure, and naming conventions, but includes translated data, as shown below:
This method of data internationalization requires that the same data is available in each internationalized database. If your project supports data internationalization, you cannot use logical views as lookup tables for attributes that use translated data. For information on logical views, see Appendix B, Logical Tables. For information on defining your project to use separate databases to enable data internationalization, see Enabling data internationalization through connection mappings, page 94.
67
4
4.
Introduction
Once you create a logical model of your business data and arrange the data within the data warehouse, you are ready to create a project in MicroStrategy. This chapter guides you through the first few major steps involved in creating a project in MicroStrategy. For definitions and descriptions of the components within the MicroStrategy platform that allow you to create and analyze your business intelligence applications, see Chapter 1, BI Architecture and the MicroStrategy Platform. To see a sample project, access the MicroStrategy Tutorial provided with the MicroStrategy platform. The Tutorial is a sample data warehouse and demonstration project you can use to learn about the various features of the MicroStrategy platform. It is ready to be used and requires no additional configuration tasks. For more information about the Tutorial, refer to the MicroStrategy Basic Reporting
69
Guide. To view the structure of the MicroStrategy Tutorial, see Appendix A, MicroStrategy Tutorial.
project creation process is to create a metadata repository. For detailed instructions, see Creating the metadata repository, page 77. 2 Connecting to the metadata repository and data source Once the metadata repository is created and populated with initialization data, you must establish connections to both the metadata repository and data source. For detailed instructions, see Connecting to the metadata repository and data source, page 77. 3 Creating a project Having created a metadata repository and established the necessary connections between the different parts of your MicroStrategy environment, you are ready to create the basic definition of your project. For detailed instructions, see Creating a project, page 79. 4 Creating facts and attributes Schema objects such as facts and attributes are the basic components of the logical structure of a project. The business data your user community wants to report on is represented by schema objects in MicroStrategy. Therefore, it is necessary to setup schema objects before reports can be created. This step is covered in Creating facts and attributes, page 97 of this chapter. You can use Query Builder or Freeform SQL to create schema objects as you design reports. For more information for these features, see the MicroStrategy Advanced Reporting Guide. 5 Configuring additional schema-level settings Once you create the initial schema objects, you can configure additional schema-level settings that allow you to add complexity and depth to objects in your project and to the project as a whole. For example, you can create advanced facts and attributes to retrieve specific result sets. You can also use attributes to create time-series analysis schema objects called transformations and
71
implement various tools to optimize and maintain your project over time. For information about: Advanced fact creation, see Creating and modifying simple and advanced facts, page 187. Advanced attribute creation, see Adding and modifying attributes, page 230. Hierarchies and hierarchy creation, see Chapter 8, Creating Hierarchies to Organize and Browse Attributes. Transformations and transformation creation, see Chapter 10, Creating Transformations to Define Time-Based and Other Comparisons. Project optimization and maintenance, see Chapter 9, Optimizing and Maintaining Your Project. The steps listed above relate to the process of creating a project which connects to a database or other data source such as a text file or Excel file. MicroStrategy also supports connecting to data stored in SAP BI, Microsoft Analysis Services 2000 and 2005, and Hyperion Essbase systems. When integrated with MicroStrategy, these systems are referred to as MDX Cube sources. You can connect to any of these MDX Cube sources to report and analyze the data concurrently within a project that also connects to a database, or you can create a a standalone connection to your MDX Cube source (see the MicroStrategy MDX Cube Reporting Guide).
MicroStrategy metadata
All schema objects, application objects, configuration objects, and project settings are stored in the MicroStrategy metadata. Metadata is stored in a relational database with a predefined structure. The RDBMS for the metadata and warehouse do not need to be the same. You can find the list of supported RDBMS platforms in the readme file that is installed with MicroStrategy products. To view the readme from the Start menu select Programs, then MicroStrategy, and then select ReadMe.
Metadata shell
Before you can populate the metadata repository with data, the necessary tables to hold the data must be present. The metadata shell is the set of blank tables that are created when you initially implement a MicroStrategy business intelligence environment. You create the metadata shell with the MicroStrategy Configuration Wizard, which creates the blank tables and populates some of the tables with basic initialization data. This first step in the project creation process is outlined in Creating the metadata repository, page 77.
Project source
The project source is a configuration object which represents a connection to a metadata repository. In MicroStrategy Desktop, the project source appears in the Folder List with an icon that varies depending on the type of connection it
73
represents. A connection to a metadata repository is achieved in one of two ways: Direct or two-tier mode ( ): Connects to the metadata by specifying a DSN, login, and password to a metadata repository. It is highly recommended that you never use direct mode connection in a production environment. MicroStrategy strongly suggests you always connect to the metadata through Intelligence Server because of the security and scalability it provides. You should not connect directly to the metadata unless you are implementing a prototype environment. Server or three-tier mode( ): Connects to the metadata by pointing to an Intelligence Server definition, which in turn governs and validates the connection to the metadata. The project metadata is the first tier, MicroStrategy Desktop is the second tier, and Intelligence Server is the third tier. Intelligence Server manages all connections to databases, enforces security, and ensures metadata integrity. For these reasons, Intelligence Server is a necessary part of any production project. A four-tier connection is a Server (three-tier) connection in conjunction with MicroStrategy Web deployed on a web server. The following diagram illustrates Server connectivity between a MicroStrategy metadata repository, Intelligence Server, and MicroStrategy Desktop. This is the type of
After the connection to the metadata is established, every object definition you create within this project source is stored in this metadata. This includes application objects, schema objects, and configuration objects from any number of projects defined within this project source (see MicroStrategy metadata, page 8 for definitions of these object types). A project source connects to a single metadata repository. However, the same metadata repository can be accessed by multiple project sources. A project source may contain any number of projects.
Database instance
The database instance is a configuration object that represents a connection to a data source. When you define a project, you specify the data source location by creating and selecting a database instance with the appropriate connection parameters. For information on database instances, see the MicroStrategy Installation and Configuration Guide. Connecting to a data source through a database instance is explained in detail in Connecting to a data source, page 78.
75
Project
A project is where you build and store all schema objects and information you need to create application objects such as reports in the MicroStrategy environment. A project also represents the intersection of a data source, metadata repository, and user community. For more information on what a project is in MicroStrategy, see MicroStrategy project, page 14.
77
MicroStrategy also allows you to connect to your SAP BI, Microsoft Analysis Services, and Hyperion Essbase data sources. For information about connecting to these MDX cube sources, see the MicroStrategy MDX Cube Reporting Guide.
Creating a project
You can now begin building the MicroStrategy project that connects to the metadata repository and data source. Project creation involves creating a basic project definition and creating your projects first schema objects. There are several methods for creating and editing a project, which include: Creating a production project This section guides you through the creation of a production-ready MicroStrategy project with the Project Creation Assistant or Architect. Creating a test or prototype project using Project Builder With Project Builder, you can build project prototypes for proof-of-concept tests with your own data. Project Builder is best suited for creating a test project, and it is not intended to create production projects. The following table compares creating a production project using the Project Creation Assistant or Architect, and creating a prototype project using Project Builder. Use the table to determine the project creation tool that best suits your needs. For a comparison of the Project Creation Assistant and Architect, see Architect versus Project Creation Assistant, page 82.
Features Intended audience Project type Production Project with Project Creation Assistant or Architect Advanced users Production-ready or other large projects Prototype Project with Project Builder Newer users Test or basic projects
Creating a project
79
Features Complexity
Production Project with Project Creation Assistant or Architect Extensive features require more project design knowledge Advanced; can create the following objects and more: Multiple tables, attributes, and facts at one time Attributes with many-to-many and joint child relationships A variety of databases and other data sources
Prototype Project with Project Builder Easier to use but fewer features Limited; cannot be used to create multiple schema objects at one time, but can be used to create basic hierarchies and metrics
Functionality
Microsoft Access
No, must be done after project creation Yes, basic metrics and reports only
With the Project Creation Assistant or Architect, you create and configure a project and some of the essential schema objects that reside within it. The intended audience for these
80 Creating a project
tools includes experienced project creators who have planned all their facts, attributes, and data relationships. This information is covered elsewhere in this guide. For a listing of information covered in specific chapters, see Planning your project below. The main advantage of the Project Creation Assistant and Architect over Project Builder is its ability to create multiple schema objects at one time. Since you can efficiently add multiple tables and develop numerous attributes and facts, it is especially useful for large projects which contain many tables and schema objects. With the Project Creation Assistant or Architect, you can also create attributes with many-to-many relationships.
Creating a project
81
82 Creating a project
data source. Automatic fact and attribute creation can save a substantial amount of time in the creation of a project. As summarized above, Project Creation Assistant and Architect provide two unique workflows to support the creation of a project. To help determine which tool you should use to create your project, the table below compares these two tools:
Project Creation Task or Feature The workflow of creating a project Project Creation Assistant Provides a linear, wizard-style workflow to add tables, attributes, and facts to a project Can only be used for the initial creation of a project User hierarchies cannot be created Architect Provides a flexible workflow to add objects to a project in an order that suits your requirements from within a centralized interface Can be used to both create a project and make modifications at any time in a projects life cycle User hierarchies can be created
Can be used to modify a project Can create user hierarchies Automatic creation of facts and attributes Can create initial project object
You must first create the initial project object using the Project Creation Assistant before using Architect
Creating a project
83
defining which languages are available in the project for the internationalization of metadata object information. After you specify these settings, the shell of a project is created in the metadata. This configures the folder structure and default connectivity settings. Be aware that this process can take some time to complete. 2 Select tables from the Warehouse Catalog. In this step, you use the Warehouse Catalog to specify which data warehouse tables to include in your project. 3 Create facts. 4 Create attributes. You should complete all the steps in the Project Creation Assistant at the same time. While you can save an incomplete project definition, you cannot finish creating it later with the Project Creation Assistant. Instead, you must complete it using the appropriate interface, such as the Warehouse Catalog, Fact Creation Assistant, or Attribute Creation Assistant.
To create a new project using the Project Creation Assistant
1 Log in to a project source in MicroStrategy Desktop. To create a project source which connects to your data through Intelligence Server, see the Configuring and Connecting Intelligence Server chapter of the MicroStrategy Installation and Configuration Guide.
84 Creating a project
2 From the Schema menu, select Create New Project. The Project Creation Assistant opens, as shown below:
3 Click Create project. The New Project page opens. 4 Define the project configurations listed below: Name: A name for the project. This name is used to identify a project within a project source. Description: An optional description for the project. This description can give a brief overview of the purpose of the project as compared to your other projects. Default document directory: The default document directory for a project is the directory location to store all HTML documents. For more details on how to setup HTML documents for a project, see the MicroStrategy Installation and Configuration Guide. Enable the guest user account for this project: Select this check box to allow users to log in to a project without any user credentials. Users can then to connect to Intelligence Server with a limited set of
Creating a project
85
privileges and permissions (defined by the Public group). Enable Change Journal for this project: Select this check box to enable the Change Journal for the project. An entry is automatically included in this journal when any object in a project is modified, allowing you to keep track of any changes to your project. For information on the Change Journal, see the System Administration Guide. Languages: Click this button to define languages that are available for metadata objects in this project. The languages you select are also languages that are available for the internationalization of your metadata objects. If a language is available for a project, you can provide object names, descriptions, and other information in various languages. For example, in a project you can provide the names of attributes, metrics, folders, and other objects in multiple languages. For information on how to provide translated strings for metadata objects such as attributes, metrics, folders and so on, see the System Administration Guide. MicroStrategy provides translated strings for common metadata objects in the default available languages listed. For example, translated strings are available for the name and description of the Public Objects folder as well as other common objects for each language listed as available by default. If you add other languages not listed, you must supply all translated strings for common metadata objects. Be aware of the following: When you create a new project, a language check ensures that the language settings of the user profile of the local machine (the CURRENT_USER registry key), the language of the local machine (the LOCAL_MACHINE registry key), and the Project locale property match. When these properties do not match, it can lead to inconsistencies in the language display. The language check prevents these inconsistencies and ensures that the language display is consistent across the project.
86 Creating a project
These language options are not related to supporting the integration of translated data from your data source into MicroStrategy. Information on defining your data source to support data internationalization is provided in Supporting data internationalization, page 61. If you plan to use translated data from your data source with attributes in a project, you must define how data internationalization is enabled before creating attributes. Enabling data internationalization is described in Enabling data internationalization for a project, page 90. 5 Click OK to create the project object. 6 Proceed to the next section below (Adding tables using the Warehouse Catalog) to determine the tables to be used in your project.
Creating a project
87
the data warehouse, and are discussed in detail in Appendix B, Logical Tables. The database login you use must have read privileges so you are able to view the tables in the selected warehouse. Database instances and database logins are MicroStrategy objects that determine the warehouse to which a project connects. To learn more about these objects, refer to the MicroStrategy Installation and Configuration Guide.
To add and remove tables to the project using the Warehouse Catalog
1 In the Project Creation Assistant, select Select tables from the Warehouse Catalog. The Warehouse Database Instance dialog box opens. 2 Select a database instance from the drop-down list and click OK. The database instance selected in this dialog box determines which data source is accessed. The Warehouse Catalog opens. If you have a license for the MultiSource Option, you can add tables from multiple data sources into your project. For information on adding tables from multiple data sources into your project with the Warehouse Catalog, see Accessing multiple data sources in a project, page 345. You can edit your database instance by clicking Edit. 3 The left side of the Warehouse Catalog lists all available tables and the number of rows each table contains. The
88 Creating a project
list on the right shows all the tables currently being used in the project, if any:
4 From the left side, select the tables you want to add to the Warehouse Catalog, and click > to add the selected tables. Click >> to add all the listed tables. 5 To remove tables from your project, select them from the right side and click < to remove them. Click << to remove all the tables from your project.
Warehouse Catalog options
6 Right-clicking any table provides you with additional Warehouse Catalog functionality. For example you can view rows in a table, specify a table prefix, copy a table, or specify a database instance for a table. For more information on these abilities and how to use them, see Managing warehouse and project tables, page 323. 7 To set advanced options you can click Options on the Warehouse Catalog toolbar. For example, you can change the database instance, customize how tables and columns are read from the database system catalog, display extra table and row information, and decide whether schema objects are mapped automatically or manually. For more information
Creating a project
89
on these abilities and how to use them, see Modifying data warehouse connection and operation defaults, page 330. 8 In the toolbar, click Save and Close to save your changes to the Warehouse Catalog. The table definitions are written to the metadata. This process can take some time to complete. After exiting the Project Creation Assistant, you can still access the Warehouse Catalog to add additional tables. For steps to access the Warehouse Catalog to add tables to a project, see Adding and removing tables for a project, page 322. The next step in the Project Creation Wizard involves creating schema objects: facts and attributes. Follow the instructions outlined in Creating facts and attributes, page 97 and Configuring additional schema-level settings, page 97 to learn how to create these schema objects and configure additional schema-level settings for those objects.
90 Creating a project
More specifically, data internationalization allows attribute element data to be displayed in various languages. For example, the Month of Year attribute element data is supplied in both English and German, as shown in the reports below.
The attribute elements for the Month of Year attribute can be supplied in multiple languages through data internationalization. For example, the January, February, and March attribute elements are displayed as Januar, Februar, and Mrz for users that are defined to view data in German. Data internationalization is different than metadata internationalization. Metadata internationalization allows various MicroStrategy metadata object names, descriptions, and other strings to be supplied in various languages. For example, in a project you can provide the names of attributes, metrics, folders, and other objects in multiple languages. For information on how to provide translated strings for metadata objects such as attributes, metrics, folders and so on, see the System Administration Guide. MicroStrategy supports data internationalization through two different techniques. You can either provide translated data through the use of extra tables and columns, or you can provide separate databases to store your translated data. For a description of these two methods, see Supporting data internationalization, page 61.
Creating a project
91
If you plan to use internationalized data with your attributes, you should define how data internationalization is enabled before creating attributes. By defining how internationalized data is represented in your data source, Architect, the Attribute Creation Wizard, and the Fact Creation Wizard can recognize internationalized data when automatically creating attributes. This can save you the time that would be required to go back and modify attributes to recognize and use the internationalized data. To support one of these data internationalization methods, follow one of the procedures described below: Enabling data internationalization through SQL queries, page 92 Enabling data internationalization through connection mappings, page 94
92 Creating a project
2 Right-click the project and select Project Configuration. The Project Configuration Editor opens. 3 In the Categories list, expand Languages, and then select Data. 4 Select the Enable data internationalization check box, and then select the SQL based DI option. 5 Select the check box next to a language to include it as a language enabled for translated data. To add other languages to enable data internationalization, perform the steps below: a Click Add. The Available Languages dialog box opens. b Clear the Display metadata languages only check box. c Select the check box for languages to enable for data internationalization and click OK to return to the Project Configuration Editor.
6 For each language, include suffixes for the columns and tables that contain your translated data. Click ... in the Column Pattern for a language, to include suffixes for columns. Click ... in the Table Pattern for a language, to include suffixes for tables. For example, if your data source includes Spanish data in columns that end in _ES, type _ES in the Column Pattern. The Column Pattern and Table Pattern options expect suffixes to identify your internationalized columns and tables. If you use prefixes or other naming conventions, you can use the functions listed below to identify the columns and tables that contain translated data: LStrCut(string s, integer x): Removes x characters from the beginning of the character string s, and returns the remaining character string. For example, LStrCut(Apple,2) would return ple. RStrCut(string s, integer x): Removes x characters from the end of the character string s, and returns the remaining character string. For example, RStrCut(Apple,2) would return App.
Creating a project
93
Concat(string s1, string s2): Appends the character string s2 to the end of the character string s1, and returns the resulting character string. For example, Concat(App,le) would return Apple.
The functions listed above can be used together to support various column and table naming conventions. You can use the parameter #0 to pass the column or table name into the function. To support a prefix rather than a suffix you can use the syntax listed below: Concat(Prefix,#0) For example, to use a prefix of ES_ to identify columns that contain Spanish data, you can use the syntax listed below: Concat(ES_,#0) 7 Click OK to save your changes and close the Project Configuration Editor.
94 Creating a project
1 In MicroStrategy Desktop, log in to a project. 2 Right-click the project and select Project Configuration. The Project Configuration Editor opens. 3 In the Categories list, expand Languages, and then select Data. 4 Select the Enable data internationalization check box, and then select the Connection mapping based DI option. 5 Select the check box next to a language to include it as a language enabled for translated data. To add other languages to enable data internationalization, perform the steps below: a Click Add. The Available Languages dialog box opens. b Clear the Display metadata languages only check box. c Select the check box for languages to enable for data internationalization and click OK to return to the Project Configuration Editor.
6 For each language, from the Database Connection drop-down list, select a data source used for the language. For information on creating data sources, see the Installation and Configuration Guide. 7 Click OK to save your changes and close the Project Configuration Editor.
95
of the features and functionality of the Project Creation Assistant. It allows you to rapidly create user hierarchies and simple metrics and reports. With Project Builder, you can build project prototypes for proof-of-concept tests with your own data and simple yet functional projects. To create a project for your production environment, it is highly recommended you follow the steps outlined in Creating a production project, page 80. The Project Creation Assistant and Architect can add greater functionality and capability to your project in your production environment. To learn more about Project Builder, proceed through this section. You can also refer to the Introduction to MicroStrategy: Evaluation Guide and the Project Builder online help (press F1 from within Project Builder).
96 Creating a project
of reports. These reports are based on pre-defined templates. You can also preview and run the reports. You can learn about creating and designing reports in more detail in the MicroStrategy Basic Reporting Guide. To access Project Builder from the Start menu, point to Programs, then point to MicroStrategy, then point to Desktop, and then select Project Builder.
97
Attribute definitions: The Attribute Editor allows you to create and edit attributes, attribute relationships, attribute forms, and attribute form expressions for attributes one at a time. This is covered in Adding and modifying attributes, page 230. Architect also allows you to create and edit any and all attributes, attribute relationships, attribute forms, and attribute form expressions for your project. This is covered in Creating and modifying attributes, page 145 and Defining attribute relationships, page 167.
User hierarchies: The Hierarchy Editor allows you to create user hierarchies, which facilitate access to attribute and element browsing and drilling. This is covered in Chapter 8, Creating Hierarchies to Organize and Browse Attributes. Architect also allows you to create any and all user hierarchies for your project. This is covered in Creating and modifying user hierarchies, page 176.
Advanced configurations: These objects include transformations, aggregate tables, and partitioning and partition mappings: The Transformation Editor allows you to create transformations, which are schema objects used for time-series analysis. Transformations are covered in Chapter 10, Creating Transformations to Define Time-Based and Other Comparisons. The tools used to create aggregate tables and partitions are the Warehouse Catalog, the Metadata Partition Mapping Editor, and the Warehouse Partition Mapping Editor. This information is covered in Chapter 9, Optimizing and Maintaining Your Project.
Now that you have completed most of the key steps in creating a new project, proceed to the chapters referenced above to complete the next steps in the project creation process.
99
5
5.
Introduction
MicroStrategy includes a project design tool known as Architect. Architect allows you to define all the required components of your project from a centralized interface. Architect also provides a visual representation of your project as you create it, which helps to provide an intuitive workflow. Architect is provided in addition to the Project Creation Assistant, which is a wizard-style tool that steps you through the process of creating a project. Rather than providing a step-by-step process to create a project, Architect allows you to see your project take shape as you create it. For a comparison of Architect and the Project Creation Assistant, see Architect versus Project Creation Assistant, page 82. Architect provides a wide range of project creation and modification tasks, which are covered in the sections of this chapter listed below: Creating and modifying projects, page 102 Adding, removing, and administering tables, page 119
101
Creating and modifying facts, page 133 Creating and modifying attributes, page 145 Defining attribute relationships, page 167 Creating and modifying user hierarchies, page 176
Displaying columns and attribute forms in tables, page 107 Disabling the ability to add tables, page 110 Automatically updating the project schema, page 110 Creating metrics based on the facts of a project, page 111 Automatically defining attribute relationships, page 112
103
facts automatically when you add tables to your project. The attributes and facts are created based on data types, database column names, primary and foreign keys, and other schema creation heuristics. You can define how attributes and facts are created when tables are added to your project by defining the automatic column recognition rules. These rules are available in the Automatic Heuristic tab of the MicroStrategy Architect Settings dialog box: Do not auto recognize: Select this option to disable the automatic creation of attributes and facts when tables are added to your project using Architect. This can be a good option to use if you are updating a project in which you have already defined the bulk of the project schema. In this scenario, it prevents Architect from automatically defining attributes and facts that might not be needed in the project. After adding extra tables to your project you can create any required attributes and facts in a way that fits your current project schema. Auto recognize: Select this option to enable the automatic creation of attributes and facts when tables are added to your project using Architect. This option can save time during the schema creation process of designing a project by allowing Architect to automatically create attributes and facts. When selecting this option, facts are created for database columns that use numeric data types and are not used for attribute forms. Attributes and attribute forms are created based on various schema creation heuristics and the rules that you define with the Advanced Options listed below: Separator: Type the character used as a separator in your database column names. For example, a database column name such as USER_ID uses the underscore character (_) as a separator. Attribute naming rule: Type database column name suffixes that identify that the column should be mapped to a new attribute as the identity form. For example, the suffix ID is commonly used for database
columns that are mapped to attributes as an identity form. Use a semicolon (;) to separate suffixes that are to be mapped to new attributes. You can also define how the attribute name is created. Use the vertical bar (|) to define what the suffix is replaced with in the resulting attribute name. The text to the left of the | character is the suffix, and the text to the right of the | character is what replaces the suffix in the attribute name that is created. For example, including ID|; creates new attributes for any database columns that use the suffix ID, and removes the ID suffix from the attribute name. When a table that uses a column such as USER_ID is imported into the project, a new attribute named User is created. Including DT|DATE; creates new attributes for any database columns that use the suffix DT, and replaces the DT suffix with DATE when creating an attribute name. When a table that uses a column such as YEAR_DT is imported into a project, a new attribute named Year Date is created. Attribute form naming rule: Type database column name suffixes that identify that the column should be mapped to a new attribute form. For example, the suffix DESC is commonly used for database columns that are mapped to description attribute forms. Use a semicolon (;) to separate suffixes that are to be mapped to new attribute forms. You can also define how the attribute form name is created. Use the vertical bar (|) to define what the suffix is replaced with in the resulting attribute form name. The text to the left of the | character is the suffix, and the text to the right of the | character is what replaces the suffix in the attribute form name that is created. For example, including DSC|DESC; creates new attribute forms for any database columns that use the suffix DSC, and replaces the DSC suffix with DESC when creating an attribute form name. When a table
105
that uses a column such as PRODUCT_DSC is imported into a project, a new attribute form named Product Desc is created. In addition to using these rules to define attributes and attribute forms, selecting the Auto recognize option also employs other schema creation heuristics: The automatic column mapping rules described in Automatically mapping columns to existing attribute forms and facts, page 106, are employed to map columns to existing attribute forms that use the columns in their definitions. An attribute is created for any column defined as a primary or foreign key, and the column name for the primary key is used to define the attribute name. The column name for the primary key is used to define the attribute name even if the primary key column is not included in the project. Every column must be mapped to either a fact or an attribute. If none of the schema creation heuristics or the rules you define can determine whether to create a fact or attribute for the column, an attribute is created for the column.
compared to the column expressions used in attribute forms and facts. If an attribute form or fact is found that matches the column expression, then the column is mapped to that attribute form or fact. For example, the MicroStrategy Tutorial project maps the Revenue fact to the column TOT_DOLLAR_SALES. If automatic column mapping is enabled and you use Architect to add a table that includes the TOT_DOLLAR_SALES column to the project, the TOT_DOLLAR_SALES column for the table is automatically mapped to the Revenue fact. The Use automatic column mapping option is particularly helpful to automatically map columns in newly added tables to existing facts and attributes, without creating any new facts or attributes. To map columns in newly added tables to existing facts and attributes, as well as create new facts and attributes based on various rules, you should enable the Auto recognize option, as described in Automating the creation of facts and attributes, page 103.
107
Display table logical view: Select this option to display the columns that are available in the table and how they relate to MicroStrategy schema objects. The LU_YEAR and LU_REGION tables from the MicroStrategy Tutorial project shown below are used to illustrate the various logical view options available for displaying columns and attribute forms in tables.
You have the following logical view display options, which can be accessed by clicking Advanced Options: Display available columns on logical tables: Select this logical view option to display columns that are available in the table but are not used in any schema objects in the project. Columns are displayed in the form Column_Name : Column_Data_Type. In the LU_YEAR table shown above, selecting this option displays the PREV_YEAR_ID : INTEGER column which has not been mapped to a schema object.
108 Creating and modifying projects
2010 MicroStrategy, Inc.
You can also display this information for an individual table by right-clicking a table, pointing to Properties, then pointing to Logical View, and selecting Display Available Columns. Selecting this option also allows you to select the option described below: Display columns used for data internationalization: Select this option to display columns that are available in the table that used for data internationalization. Columns are displayed in the form Column_Name : Column_Data_Type. In the LU_REGION table shown above, selecting this option displays the various REGION_NAME columns that are used to translate the name of a region into various languages. For information on supporting internationalized data in a data source, see Supporting data internationalization, page 61. Display used columns on logical tables: Select this option to display the columns (and their data types) that are used in schema objects in the project. Columns are displayed in the form Column_Name : Column_Data_Type. In the LU_YEAR table shown above, selecting this option displays the YEAR_ID : INTEGER column, which is used for the ID form of the attribute Year. Selecting this option for the LU_YEAR table also displays the YEAR_DATE : TimeStamp column mapped to the date form of the attribute Year, as well as the YEAR_DURATION : INTEGER column mapped to the fact Year Duration. You can also display this information for an individual table by right-clicking a table, pointing to Properties, then pointing to Logical View, and selecting Display Used Columns. Display attribute forms on logical tables: Select this option to display attribute forms that are mapped to columns of the table. Attribute forms are displayed in the form Attribute_Form_Name : Attribute_Form_Category (Column_Name).
2010 MicroStrategy, Inc. Creating and modifying projects
109
In the LU_YEAR table shown above, selecting this option displays the ID form and the Date form for the attribute Year. You can also display this information for an individual table by right-clicking a table, pointing to Properties, then pointing to Logical View, and selecting Display Attribute Forms. Maximum number of visible links per row: Define the number of link lines that are displayed when you select a column, fact, attribute, or attribute form in a table. When selecting one of these objects in a table, a line is drawn to each occurrence of this object in other tables included in the project. For example, selecting the Year attribute in the LU_YEAR table displays a line that connects to every other occurrence of the Year attribute in other tables.
Updating your project schema every time that you exit Architect can be disabled. The schema update process can require a substantial load on your Intelligence Server and require a considerable amount of time to complete. You may also have other project updates that you plan to perform after using Architect. In these scenarios, you can disable the project schema update process, and instead execute a schema update manually at the desired time. You can disable the project schema update process from occurring when closing Architect by clearing the Update schema after closing Architect check box. This option is available in the Configuration tab of the MicroStrategy Architect Settings dialog box.
111
When a fact is created for a project, metrics are automatically created for the fact using the aggregation functions you select. A separate metric is created to support each aggregation of a fact. The metrics are created in the Public Objects/Metrics folder of a MicroStrategy project.
Based on lookup tables: Creates attribute relationships based on lookup tables that do not include primary key or foreign key information. To define a table as a lookup table for an attribute, see Creating attributes, page 146. Each attribute that defines a table as its lookup table is defined as a child attribute of all other attributes in the same table, that do not define the table as its lookup table. Each attribute relationship is defined as a one-to-many relationship from the parent attribute to the child attribute. Based on sample data from the table: Creates attribute relationships for attributes that share the same lookup table. To define a table as a lookup table for an attribute, see Creating attributes, page 146. Architect analyzes sample data for the table. The attributes with fewer distinct values are defined as parents of the attributes with more distinct values, using a one-to-many relationship from the parent attribute to the child attribute. For example, a lookup table includes four rows of data, which include data related to year and quarter. Each row includes the same year (for example, 2009), but the quarter changes for each row (Q1, Q2, Q3, Q4). In this case, the Year attribute is created as a parent of the Quarter attribute. After all relationships are determined by the rules that you selected, Architect performs a final analysis on the attribute relationships that are to be created. Any attribute relationships that are found to be redundant are not created. This ensures that attribute relationships are created that properly reflect the design of the data in your data source. For information on modifying the attribute relationships that are created, see Defining attribute relationships, page 167.
113
must first create the project object with the Project Creation Assistant and define various Architect project creation options. Prerequisites Before creating a project, you must connect to a metadata repository and to a data source, as described in the sections listed below: Connecting to the metadata repository, page 78 Connecting to a data source, page 78 You should also review the information in Chapter 4, Creating and Configuring a Project before creating a project using Architect.
To create a new project using Architect
1 Log in to a project source in MicroStrategy Desktop. To create a project source which connects to your data through Intelligence Server, see the Configuring and Connecting Intelligence Server chapter of the MicroStrategy Installation and Configuration Guide.
2 From the Schema menu, select Create New Project. The Project Creation Assistant opens, as shown below:
3 Click Create project. The New Project page opens. 4 Define the project configuration settings listed below: Name: A name for the project. This name is used to identify a project within a project source. Description: An optional description for the project. This description can give a brief overview of the purpose of the project as compared to your other projects. Default document directory: The directory location to store all HTML documents. For more details on how to set up HTML documents for a project, see the Installation and Configuration Guide. Enable the guest user account for this project: Select this check box to allow users to log in to a project without any user credentials. Users can then to connect to Intelligence Server with a limited set of privileges and permissions (defined by the Public group).
115
Enable Change Journal for this project: Select this check box to enable the Change Journal for the project. An entry is automatically included in this journal when any object in a project is modified, allowing you to keep track of any changes to your project. For information on the Change Journal, see the System Administration Guide. Languages: Click this button to define languages that are available for metadata objects in this project. The languages that you select are also languages that are available for the internationalization of your metadata objects. If a language is available for a project, you can provide object names, descriptions, and other information in various languages. For example, in a project you can provide the names of attributes, metrics, folders, and other objects in multiple languages. For information on how to provide internationalized data for metadata objects such as attributes, metrics, folders, and so on, see the System Administration Guide. MicroStrategy provides internationalized data for common metadata objects in the available, default languages listed. For example, data is available for the name and description of the Public Objects folder as well as other common objects for each language listed as available by default. If you add other languages, you must supply all internationalized data for common metadata objects. Be aware of the following: When you create a new project, a language check ensures that the language settings of the user profile of the local machine (the CURRENT_USER registry key), the language of the local machine (the LOCAL_MACHINE registry key), and the Project locale property match. If these properties do not match, it can lead to inconsistencies in the language display. The language check prevents these inconsistencies and ensures that the language display is consistent across the project. These language options are not related to supporting the integration of internationalized data from your data source into MicroStrategy.
Information on defining your data source to support data internationalization is provided in Supporting data internationalization, page 61. If you plan to use internationalized data from your data source with attributes in a project, you must define how data internationalization is enabled before creating attributes. Enabling data internationalization is described in Enabling data internationalization for a project, page 90. 5 Click OK to create the project object. 6 Click the arrow for Architect. The Warehouse Database Instance dialog box opens. To continue creating the project with the Project Creation Assistant, see Creating a new project using the Project Creation Assistant, page 83. 7 Select a database instance from the drop-down list. The database instance selected in this dialog box determines which data source is accessed. 8 Click OK. MicroStrategy Architect opens. 9 From the Options menu, select Settings. The MicroStrategy Architect Settings dialog box opens. 10 Define the various options for how Architect displays data, automatically creates and maps schema objects, loads the Warehouse Catalog, and updates the projects schema. Reviewing and defining these options before using Architect can save you a lot of time when creating and modifying projects. For information on all the options available, see Defining project creation and display options, page 102. 11 Click OK. You can now begin to add tables to your project, and create attributes, facts, user hierarchies, and so on. These tasks are listed below: a Adding tables, page 122 b Creating facts, page 134
117
d Defining attribute relationships, page 167 e Creating user hierarchies, page 177
1 In MicroStrategy Desktop, log in to a project. 2 From the Schema menu, select Architect. MicroStrategy Architect opens.
3 From the Options menu, select Settings. The MicroStrategy Architect Settings dialog box opens. 4 Define the various options for how Architect displays data, automatically creates and maps schema objects, loads the Warehouse Catalog, and updates the projects schema. Reviewing and defining these Architect options before using Architect can save you a lot of time when creating and modifying projects. For information on all the options available, see Defining project creation and display options, page 102. 5 Click OK to return to Architect. You can now begin to add or remove tables to your project and create and modify attributes, facts, user hierarchies, and so on: Adding, removing, and administering tables, page 119 Creating and modifying facts, page 133 Creating and modifying attributes, page 145 Defining attribute relationships, page 167 Creating and modifying user hierarchies, page 176
119
Architect displays all of the available data sources for the project in the Warehouse Tables pane, as shown below.
If the Warehouse Tables pane is not displayed in Architect, from the View menu, select Show Warehouse tables. The Warehouse Tables pane is only available in the Project Tables View of Architect. Within each data source is a list of all the tables in the data source to which you are connected through a database instance. From this list, you select the lookup, fact, and relationship tables to use in your new project. You should also include all other tables needed to complete your project, including transformation tables, aggregate tables, and partition mapping tables. The database login you use must have read privileges so you are able to view the tables in the selected data source. Database instances and database logins are MicroStrategy objects that determine the data sources to which a project connects. To learn more about these objects, refer to the MicroStrategy Installation and Configuration Guide.
Using Architect, you can perform the following tasks to add, remove, update, and manage tables for your project: Displaying data sources in Architect, page 121 Adding tables, page 122 Removing tables, page 123 Updating, modifying, and administering tables, page 125 Organizing project tables: Layers, page 132
1 With a project open in Architect, from the Options menu, select Select Database Instance. The Select Database Instance dialog box opens. 2 From the list of data sources, you can display or hide a data source: Select a check box for a data source to display it in Architect. Once displayed, you can begin to add tables from the data source into your project.
121
Clear a check box for a data source to hide it in Architect. You cannot hide a data source that is used in a project.
Adding tables
Before you can begin creating attributes, facts, and hierarchies for your project, you must add tables to your project. Along with making data available in your project, adding tables to your project can also trigger the creation of attributes and facts, and the mapping of columns to attributes and facts. For information on defining how attributes and facts are created and mapped when adding tables to your project, see Automating the creation of facts and attributes, page 103 and Automatically mapping columns to existing attribute forms and facts, page 106. Once tables are selected from the data source and added to your project, they become schema objects known as logical tables in MicroStrategy. Logical tables are representations of the tables that are available in the data warehouse, and are discussed in detail in Appendix B, Logical Tables. The procedure below provides steps to add tables to your project using Architect. Prerequisites You are creating or modifying a project using Architect. For instructions, see Creating and modifying projects, page 102. The ability to add tables using Architect is enabled. For information on enabling and disabling the ability to add tables using Architect, see Disabling the ability to add tables, page 110.
1 With a project open in Architect, select the Project Tables View. 2 From the Warehouse Tables pane, expand a data source. If you have a license for the MultiSource Option feature, you can add tables from multiple data sources into your project. For information on adding tables from multiple data sources into your project with the Warehouse Catalog or Architect, see Accessing multiple data sources in a project, page 345. 3 Right-click a table, and then select Add Table to Project. The table is added to the project and included in the Project Tables View of Architect. To view a sample of the data within a table, right-click the table and select Show Sample Data. 4 Once you have imported tables for your project, you can continue with other project design tasks, which include: a Creating and modifying facts, page 133 b Creating and modifying attributes, page 145 c Defining attribute relationships, page 167
Removing tables
You can remove tables from your project to keep your project from becoming cluttered with tables that are no longer required for your project. You can remove a table from a project using Architect by accessing Project Tables View, right-clicking a table, and selecting Remove. However, you cannot remove a table from a project if schema objects in the project are dependent on the table. For
123
example, an attribute is dependent on the table that is set as the lookup table for the attribute. When you attempt to remove a table that has dependent objects, you can view a list of dependent objects for the table. You must first delete all dependent objects from the project before you can delete the table.
Removing tables from a project that have been removed from a data source
When tables that are included in a project are removed from the data source that they were available in, you can use Architect to remove these tables from the project. This allows your project to display an accurate list of tables that are included in the project from the selected data source. The steps below show you how to perform this task using Architect. To remove these tables using the Warehouse Catalog, see Removing tables from the Warehouse Catalog that have been removed from their data source, page 328. If tables that were not included in a project are removed from the data source, these tables are automatically removed from the display of available tables in Architect.
To remove tables from a project that have been removed from a data source
1 In MicroStrategy Desktop, log in to a project. 2 From the Schema menu, select Architect. MicroStrategy Architect opens. 3 If the Warehouse Tables pane is not displayed, from the View menu, select Show warehouse tables. 4 In the Warehouse Tables pane, expand the database instance for the data source, which has had tables removed. The Warehouse Catalog dialog box opens. If this dialog box does not open, there are no tables that need to be removed from the project.
5 Select the check box for a table to remove it from the project. 6 After you have selected all the tables to delete, click OK to remove the tables that were selected to be deleted and return to Architect. 7 If a message is returned that a table cannot be removed because objects depend on it, you can click Yes to review a list of dependent objects. To remove the table from the project, all dependent objects must be deleted. 8 From the File menu, select Save and update schema to save your changes.
Updating tables
With Architect, you can update individual tables or all of the tables for a data source at once. This ensures that the data available in your project is up to date with any changes made to the tables in the data source. The procedure below describes how to update tables using Architect. Prerequisite You are creating or modifying a project using Architect. For instructions, see Creating and modifying projects, page 102.
125
1 With a project open in Architect, select the Project Tables View. 2 From the Warehouse Tables pane, you can update all tables for a data source or update individual tables as described below: To update all tables for a data source, right-click a data source, and select Update. All the tables for the data source are updated to reflect their definitions in the data source. To update an individual table, expand a data source, right-click a table, and select Update Structure. The table is updated to reflect its definition in the data source.
used as an example of how you can modify and view tables definitions using Architect.
When you select a table in Architect, the Properties pane allows you to modify and view table definitions as described below. You can select a property in the Properties pane to view a description of the property. The description is displayed at the bottom of the Properties pane. Defining and viewing table definitions: Definition section, page 128 Modifying attributes in a table: Mapped Attributes section, page 129
127
Modifying facts in a table: Mapped Facts section, page 130 Modifying column names and data types in a table: Member Columns section, page 130
Row Count: The number of rows in the table. To calculate a tables row count, right-click the table and select Calculate Row Count. The Calculate Row Count option is displayed only if the data source for the table is expanded in the Warehouse Tables pane.
Table Name Space: The table name space for a table in a data source. For information on table name spaces, see Ignoring table name spaces when migrating tables, page 337. Logical Size: The logical size of a table, which is based on an algorithm that takes into account the number of attribute columns in a table and the various levels at which they exist in their respective hierarchies. You can also type a logical size to manually change the logical size of a table. Logical table sizes are a significant part of how the MicroStrategy SQL Engine determines the tables to use in a query. Logical size locked: Specifies whether the logical size of a table can be modified. From the drop-down list, select True to lock a tables logical table size. Primary DB Instance: The primary database instance of a table. If your project supports mapping tables in a project to tables in multiple data sources, you can select Primary DB Instance and click the ... (browse) button to open the Available Database Instances dialog box. From this dialog box, you can view the tables data sources. You can also change the database instance (which is associated with a data source) that is used as the primary database instance for the table. For information on adding tables from multiple data sources into your project with the Warehouse Catalog or Architect, see Accessing multiple data sources in a project, page 345.
129
click the ... button to open the Modify Form Expression dialog box. From this dialog box, you can modify the attribute form expression. For information on creating and modifying attribute forms in Architect, see Creating and modifying attributes, page 145. For information on attribute forms and how to create and modify them from the Attribute Editor, see Column data descriptions and identifiers: Attribute forms, page 243.
Modifying column names and data types in a table: Member Columns section
When you select a table in Architect, the Member Columns section of the Properties pane displays the columns that are available in the table. From the Properties pane, you can select a column and click the ... button to open the Column Editor dialog box. From this dialog box, you can modify the column name and data type. You can modify the column name and data type if this information has changed in the data source. This allows a MicroStrategy project to be able to locate a column after it has been renamed in the data source.
1 With a project open in Architect, select the Project Tables View. 2 From the Warehouse Tables pane, right-click a data source and select Warehouse Catalog Options. The Warehouse Catalog options dialog box opens. 3 When accessed from Architect, only a subset of these Warehouse Catalog settings are displayed, including: Warehouse Connection: These options allow you to modify the database instance and database login used to connect the data warehouse to a project. For information on these options, see Data warehouse connection and read operations, page 331. Read Settings: These options allow you to customize the SQL that reads the Warehouse Catalog for every platform except Microsoft Access. For information on these options, see Data warehouse connection and read operations, page 331. Table Prefixes: These options allow you to specify whether table prefixes are displayed in table names and how prefixes are automatically defined for tables
131
that are added to the project. For information on these options, see Displaying table prefixes, row counts, and name spaces, page 335. 4 Once you are finished defining Warehouse Catalog options, click OK to save your changes and return to Architect.
1 In MicroStrategy Desktop, log in to a project. 2 From the Schema menu, select Architect. MicroStrategy Architect opens.
3 From the Project Tables View, select all the tables to include in a layer. To remove a table from a layer, right-click the table, and select Remove From Layer. 4 From the toolbar, click the Create New Layer option ( ). A dialog box to name the layer opens. 5 In the Please enter the layer name field, type a name for the layer and click OK. You are returned to Architect and the new layer is displayed in the Project Tables View. 6 Use the Layers drop-down list to switch between layers.
133
Creating facts
With Architect you can create facts as part of your initial project design effort as well as throughout the entire life cycle of a project. To save the time it takes to create all the facts required for your project, you can allow Architect to automatically create facts when tables are added to your project. When tables are added to the project using Architect, facts are created for columns in tables that use numeric data types and are not used for attribute forms. To enable this automatic fact creation, see Automating the creation of facts and attributes, page 103. The procedure below describes how to create a fact using Architect. Prerequisites The procedure below assumes you have already created a project object and added tables to the project. For information on creating a project using Architect, see Creating projects using Architect, page 113.
To create a fact using Architect
1 In MicroStrategy Desktop, log in to a project. 2 From the Schema menu, select Architect. MicroStrategy Architect opens. 3 From the Project Tables View, locate and select the table that includes a column or columns to use in a fact definition. 4 Right-click the table and select Create Fact. A dialog box opens to name the fact. Rather than creating facts by manually creating a fact expression, you can allow Architect to automatically create simple facts defined on one column. To do this, right-click the table, point to Recognize, and then select Facts. Facts are created for columns in tables that use
numeric data types and are not used for attribute forms. If you use this option to create simple facts, you can then skip to To define fact expressions and column aliases, page 136. 5 Type a name for the fact, and click OK. The Create New Form Expression dialog box opens to create a fact expression. 6 From the Available columns pane, drag and drop a column into the Form expression pane. You can include multiple columns as well as use numeric constants and mathematical operators and functions to create a fact expression. For information on creating various types of fact expressions, see Mapping physical columns to facts: Fact expressions, page 195. 7 In the Mapping area, select Automatic or Manual: Automatic mapping means that all of the tables in the project with the columns used in the fact expression are selected as possible source tables for the fact. You can then remove any tables mapped automatically and select other tables. Manual mapping means that all of the tables in the project with the columns used in the fact expression are located but are not selected as possible source tables for the fact. You can then select which of those tables are used as source tables for the fact. Other scenarios in which you should use the manual mapping method include: If you are creating a constant expression that is not based on a physical column in a project table, you must select the tables to apply the constant expression to. If the same column name does not contain the same data across different tables, manually select the appropriate source tables for each fact. For example, suppose you have a column named Sales, which exists in both the Fact_Sales table and the Fact_Discount table. In the Fact_Sales table, the Sales column contains
135
revenue data. However, in the Fact_Discount table, the Sales column contains discount data. In other words, although the column name is the same in both tables (Sales), the columns contain different fact data in each table. When creating the Revenue fact, you must select the Manual mapping method so you can select the Fact_Sales table as a source table for the Revenue fact. When creating the Discount fact, you must select the Manual mapping method so you can select the Fact_Discount table as a source table for the Discount fact. If you use the Automatic mapping method in both cases, the MicroStrategy SQL Engine may use the incorrect column for the facts. 8 Click OK to close the Create New Form Expression dialog box and create the fact. The fact is displayed in the table used to create the fact.
To define fact expressions and column aliases
9 You can continue to define the fact by right-clicking the fact and selecting Edit. The Fact Editor opens. Use the tabs of the Fact Editor to define fact expressions and create column aliases as described below: Definition: This tab allows you to define fact expressions. Fact definitions are discussed in How facts are defined, page 194. Column Alias: This tab allows you to create a column alias for the fact. Column aliases are discussed in Fact column names and data types: Column aliases, page 202. Note the following: For detailed information about the options on each tab within the Fact Editor, refer to the MicroStrategy Desktop online help. You cannot create fact level extensions using Architect. For information on how to create fact level extensions, see Modifying the levels at which facts are reported: Level extensions, page 204. 10 When your changes are complete, click OK to return to Architect.
136 Creating and modifying facts
2010 MicroStrategy, Inc.
137
below is used as an example of how you can modify and view facts using Architect.
When selecting a fact in Architect, the Properties pane allows you to modify and view facts as described below. You can select a property in the Properties pane to view a description of the property. The description is displayed at the bottom of the Properties pane. Defining and viewing attribute definitions: Definition section, page 151 Modifying attribute forms: Forms sections, page 153
fact. These properties and how to use them are described below: ID: The identifier of the fact. You cannot modify this value. Name: The name of the fact in the MicroStrategy project. Description: The description of the fact. A description can help explain the purpose of a fact in a project. Hidden: Specifies whether the fact is defined as hidden. From the drop-down list, select True to define a fact as hidden. Objects that are hidden are not displayed to a user unless the user has changed his or her Desktop Preferences and selected the Display hidden objects check box. Therefore, defining an object as hidden does not necessarily prevent users from viewing or accessing an object. The best way to prevent users from viewing or accessing an object is to restrict the user permissions for it. Location: The location of the fact in a project.
139
Fact Expression dialog box. From this dialog box, you can modify the fact expression.
1 In MicroStrategy Desktop, log in to a project. For the example scenario, log in to the MicroStrategy Tutorial project.
2 From the Schema menu, select Architect. MicroStrategy Architect opens. 3 From the Project Tables View, locate and select a table that includes a column or columns to use in a fact definition. For the example scenario, select the ORDER_DETAIL table. 4 Right-click the table and select Create Fact. A dialog box opens to name the fact. 5 Type a name for the fact, and click OK. The Create New Form Expression dialog box opens. 6 From the Available columns pane, drag and drop a column into the Form expression pane. For the example scenario, drag and drop the QTY_SOLD column to add it to the Form expression pane.
To complete the derived fact expression
A derived fact expression includes a combination of columns, numerical constants, and mathematical operators. The steps below continue the example scenario to provide a guideline of how to create derived fact expressions. 7 With the cursor in the Form expression pane, click * (the multiplication operator) to add it to the expression. 8 From the Available columns pane, double-click the UNIT_PRICE column to add it to the end of the fact expression. 9 Under Mapping method, select Automatic.
141
10 Click Validate to check whether the syntax of the expression is correct. The expression should appear as shown below:
11 Click OK. You are returned to Architect and the derived fact appears in the ORDER_DETAIL table. 12 From the File menu, select Save to save your changes.
1 In MicroStrategy Desktop, log in to a project. For the example scenario, log in to the MicroStrategy Tutorial project. 2 From the Schema menu, select Architect. MicroStrategy Architect opens.
142 Creating and modifying facts
2010 MicroStrategy, Inc.
3 From the Project Tables View, locate and select a table that includes a column or columns to use in a fact definition. For the example scenario, select the ORDER_FACT table. This is one of the tables in which a heterogeneous fact column for the Units Sold fact exists. 4 Right-click the table and select Create Fact. A dialog box opens to name the fact. 5 Type a name for the fact, and click OK. The Create New Form Expression dialog box opens. 6 From the Available columns pane, drag and drop a column into the Form expression pane. For the example scenario, drag and drop the QTY_SOLD column to add it to the Form expression pane. 7 In the Mapping method area, select Automatic. 8 Click OK. You are returned to Architect and the derived fact appears in the ORDER_FACT table. 9 Right-click the new fact and select Edit. The Fact Editor opens and the fact expression you just created appears in the Expressions pane.
To add additional columns for heterogeneous facts
Now you must add the other heterogeneous fact column as separate expression for the fact. 10 Click New. The Create New Fact Expression dialog box opens. 11 From the Source table drop-down list, select the CITY_CTR_SALES table. This is the other table that contains a heterogeneous fact column for the Units Sold fact. 12 From the Available columns pane, double-click the TOT_UNIT_SALES column to add it to the Fact expression pane on the right. 13 In the Mapping method area, select Automatic.
143
14 Click OK. You are returned to the Fact Editor and the fact expression that you just created appears in the Expressions pane. Now the fact that you are creating maps correctly to its heterogeneous fact columns. 15 Click OK. You are returned to Architect. 16 From the File menu, select Save to save your changes.
Creating and modifying fact column names and data types: Column aliases
A column alias specifies both the name of the column to be used in temporary tables and the data type to be used for the fact. By default, the data type for a fact is inherited from the data type of the column on which the fact is defined in the data warehouse. For information on column aliases, see Fact column names and data types: Column aliases, page 202. The procedure below describes how to create a column alias using Architect. Prerequisites This procedure assumes you have already created a fact with a valid fact expression.
To create a column alias for a fact using Architect
1 In MicroStrategy Desktop, log in to the project source that contains the fact to create a new column alias for. 2 From the Schema menu, select Architect. MicroStrategy Architect opens. 3 From the Project Tables View, locate and select a table that includes a fact. 4 Right-click the fact and select Edit. The Fact Editor opens. 5 Select the Column Alias tab.
6 In the Column alias area, click Select. The Column Editor - Column Selection dialog box opens. 7 Select New to create a new column alias. The Column Editor - Definition dialog box opens. 8 You can modify the following properties for the column alias: Column name: The name for the column alias. This name is used in any SQL statements which include the fact column. Data type: The data type for the fact. For a description of the different data types supported by MicroStrategy, see Appendix C, Data Types. Depending on the data type selected, you can specify the byte length, bit length, precision, scale, or time scale for your column alias. For a detailed description on each of these properties, see the MicroStrategy Desktop online help.
9 Click OK to save your changes and return to the Column Editor - Column Selection dialog box. 10 Click OK. You are returned to the Fact Editor. 11 Click OK. You are returned to Architect. 12 From the File menu, select Save to save your changes.
145
This section describes how to use Architect to create and modify attributes, which includes: Creating attributes, page 146 Creating and modifying multiple attributes, page 149
These sections focus on creating attributes and attribute forms. To create and define attribute relationships with the Hierarchy View in Architect, see Defining attribute relationships, page 167.
Creating attributes
With Architect you can create attributes as part of your initial project design effort as well as throughout the entire life cycle of a project. To save the time that it takes to create all the attributes required for your project, you can allow Architect to automatically create attributes when tables are added to your project. When tables are added to the project using Architect, attributes are created based on the automatic column recognition rules that you define in Architect. To enable and define this automatic attribute creation, see Automating the creation of facts and attributes, page 103. The procedure below describes how to create an attribute using Architect. Prerequisites The procedure below assumes you have already created a project object and added tables to the project. For information on creating a project using Architect, see Creating projects using Architect, page 113.
To create an attribute using Architect
1 In MicroStrategy Desktop, log in to a project. 2 From the Schema menu, select Architect. MicroStrategy Architect opens.
146 Creating and modifying attributes
2010 MicroStrategy, Inc.
3 From the Project Tables View, locate and select a table that includes a column or columns to use in an attribute definition. 4 Right-click the table and select Create Attribute. A dialog box opens to name the attribute. Rather than creating attributes by manually creating an attribute expression, you can allow Architect to automatically create simple attributes defined on one column. To do this, right-click the table, point to Recognize, and then select Attributes. Attributes are created based on the automatic column recognition rules that you define in Architect, described in Automating the creation of facts and attributes, page 103. If you use this option to create simple attributes, you can then skip to To define attribute lookup tables, form expressions, and column aliases, page 148. 5 Type a name for the attribute, and click OK. The Create New Form Expression dialog box opens. 6 Create a form expression for the ID form of the new attribute being created, as described below: To create a simple attribute form expression (Attribute form expressions, page 247), drag a column from the Available columns pane to the Form expression pane. To create a more advanced attribute form expression, use a combination of any of the following techniques: Enter constants in double quotes. To create a function using the Insert Function Wizard, click f(x) in the Form expression toolbar. To insert an operator into the expression, click any operator in the Form expression toolbar. 7 Click Validate to ensure that your expression is valid. 8 Under Mapping method, select Automatic or Manual: Automatic mapping means that all of the tables in the project with the columns used in the attribute form expression are selected as possible source tables for
147
the attribute form. You can then clear any tables mapped automatically or select other tables. Manual mapping means that all of the tables in the project with the columns used in the attribute form expression are located but are not selected as possible source tables for the attribute form. You can then select which of those tables are used as source tables for the attribute form. Note the following: The mapping method defaults to Automatic for the first attribute or attribute form expression you create. The system maps the expression to each of the source tables. For subsequent attributes, the default is Manual. An expression that uses only a constant value cannot use the automatic mapping method. 9 Click OK to close the Create New Form Expression dialog box and create the attribute. The attribute is displayed in the table used to create the attribute.
To define attribute lookup tables, form expressions, and column aliases
10 You can continue to define the attribute by right-clicking the ID form for the attribute and selecting Edit. The Modify Attribute Form dialog box opens. 11 From the Source tables pane, select a table and click Set as Lookup to set it as the lookup table for the attribute. A lookup table acts as the main table which holds the information for an attribute. If you chose manual mapping, select the check boxes of the tables to map to the attribute form. 12 You can use the tabs of the Modify Attribute Form dialog box to define attribute form expressions and create column aliases as described below: Definition: This tab allows you to define attribute form expressions. Attribute forms are discussed in Column data descriptions and identifiers: Attribute forms, page 243.
Column Alias: This tab allows you to create a column alias for the fact. Column aliases are discussed in Modifying attribute data types: Column aliases, page 256. For detailed information about the options on each tab within the Modify Attribute Form dialog box, refer to the MicroStrategy Desktop online help.
13 When your changes are complete, click OK to return to Architect. 14 From the File menu, select Save to save your changes.
149
When selecting an attribute in Architect, the Properties pane allows you to modify and view attributes as described below. You can select a property in the Properties pane to view a description of the property. The description is displayed at the bottom of the Properties pane.
150 Creating and modifying attributes
2010 MicroStrategy, Inc.
Defining and viewing attribute definitions: Definition section, page 151 Modifying attribute forms: Forms sections, page 153
151
Unlocked: All elements of the attribute are shown within the System Hierarchy in the Data Explorer. For example, if the attribute Year is unlocked, all elements of Year (such as 2005, 2006, and 2007) display in the Data Explorer when Year is expanded from the System Hierarchy. Limit: Incrementally retrieves the number of elements set for the attribute. For example, if the limit for the attribute Year is set to one, the years 2005, 2006, and 2007 are retrieved one-by-one as they are requested. Lock Limit: If you choose the Limit lock type above, you can define the number of elements to incrementally retrieve and display within the System Hierarchy in the Data Explorer. Apply Security Filters: Enables and disables the use of security filters in element requests. This setting also applies to the use of security filters for creating an element cache. This setting covers situations where only certain attributes need the security filters for element requests. For example, if you have an external-facing data warehouse for your suppliers, security filters can be used on attributes in the product dimension so one supplier cannot see another supplier's products. However, since security is not necessary on attributes in the Time dimension, security filters do not need to be applied and the element cache can be shared. Enable Element Caching: Enables and disables element caching at the attribute level. By caching the elements of an attribute, the elements are returned quickly from a cache when browsing the attribute elements. This is particularly helpful for attributes that rarely or never have a modification to the elements available for the attribute. The volatility of the elements within different attributes can fluctuate greatly. For example, the Order Number attribute may have elements that change once a day (depending on the warehouse load), while the Product Number attribute may only have elements that change once a week or once a month.
153
Ascending, Descending, or None. The Data Explorer is discussed in Enabling hierarchy browsing in reports: Data Explorer, page 309. Use as Browse Form: Defines whether the attribute form can be displayed in the Data Explorer. To allow an attribute form to be displayed in the Data Explorer, from the drop-down list, select True. The Data Explorer is discussed in Enabling hierarchy browsing in reports: Data Explorer, page 309. Use as Report Form: Defines whether the attribute form is displayed on reports by default. To define an attribute form to be displayed on reports by default, from the drop-down list, select True. Supports Multiple Languages: Defines whether the attribute forms information can be displayed in multiple languages using data internationalization. To define an attribute form to allow data to be displayed in multiple languages, select True. Enabling data internationalization for an attribute form is described in Supporting data internationalization for attribute elements, page 166. The ID form of an attribute does not have this option as these forms are used strictly for identification purposes. Column Alias: The column alias of the attribute form, which allows you to define a new data type that you can use in place of the default data type for a given attribute form. You can select the Column Alias property and click the ... button to modify the attribute forms column alias. For information on column aliases for attribute forms, see Modifying attribute data types: Column aliases, page 256. Attribute Expressions: The expressions used for the attribute form. You can select an attribute expression and click the ... button to modify the attribute form expression.
155
1 In MicroStrategy Desktop, log in to a project. For the example scenario, log in to the MicroStrategy Tutorial project. 2 From the Schema menu, select Architect. MicroStrategy Architect opens. 3 From the Project Tables View, locate and select a table that includes a column or columns to use in an attribute definition. For the example scenario, select the LU_CUSTOMER table. 4 Right-click the Customer attribute and select New Attribute form. The Create New Form Expression dialog box opens. 5 Double-click the CUST_LAST_NAME column to add it to the Form expression pane on the right. 6 In the Form expression pane, place the cursor to the right of [CUST_LAST_NAME] and type + , +. 7 Double-click the CUST_FIRST_NAME column to add it to the Form expression pane on the right. Your expression should be defined as shown below.
8 Select Manual as the mapping method. 9 Click OK to return to Architect. The new attribute form is displayed as part of the Customer attribute in the LU_CUSTOMER table.
10 In the Properties pane, locate the new attribute form. 11 In the Name field, type Last Name, First Name. 12 From the Category drop-down list, select None since Last Name, First Name is neither the ID form of Customer nor the primary description form. 13 Because this is only an example, you can close Architect without saving your changes.
1 In MicroStrategy Desktop, log in to a project. For the example scenario, log in to the MicroStrategy Tutorial project. 2 From the Schema menu, select Architect. MicroStrategy Architect opens. 3 From the Project Tables View, locate and select a table that includes a column or columns to use in an attribute definition. For the example scenario, select the LU_DAY table.
157
4 Right-click the Customer attribute and select New Attribute form. The Create New Form Expression dialog box opens. 5 Double-click the DAY_DATE column to add it to the Form expression pane on the right. 6 Select Automatic as the mapping method. 7 Click OK to return to Architect. The new attribute form is displayed as part of the Day attribute in the LU_DAY table. 8 Right-click the new attribute form and select Edit. The Modify Attribute Form dialog box opens. 9 Click New. The Create New Form Expression dialog box opens. 10 From the Source table drop-down list, select the ORDER_DETAIL table. 11 Double-click the ORDER_DATE column to add it to the Form expression pane on the right. 12 Select Automatic as the mapping method. 13 Click OK. The Create New Attribute Form dialog box opens. Notice that there are now two expressions for the attribute form definition, both of which use different tables as the source of their information. You can continue this process to add as many heterogeneous columns as part of one attribute form as necessary. 14 Click OK to return to Architect. 15 In the Properties pane, locate the new attribute form. 16 In the Name field, type Date Example. 17 From the Category drop-down list, select None since this is an example scenario. 18 Because this is only an example, you can close Architect without saving your changes.
1 In MicroStrategy Desktop, log in to a project. For the example scenario, log in to the MicroStrategy Tutorial project. 2 From the Schema menu, select Architect. MicroStrategy Architect opens. 3 From the Project Tables View, locate and select a table that includes an attribute to create a column alias for. 4 Right-click the attribute form to create a column alias for, and select Edit. The Modify Attribute Form dialog box opens. 5 Select the Column Alias tab. 6 In the Column alias area, click Select. The Column Editor - Column Selection dialog box opens.
159
7 Select New to create a new column alias. The Column Editor - Definition dialog box opens. 8 You can modify the following properties for the column alias: Column name: The name for the column alias. This name is used in any SQL statements which include the fact column. Data type: The data type for the fact. For a description of the different data types supported by MicroStrategy, see Appendix C, Data Types. Depending on the data type selected, you can specify the byte length, bit length, precision, scale, or time scale for your column alias. For a detailed description on each of these properties, see the MicroStrategy Desktop online help.
9 Click OK to save your changes and return to the Column Editor - Column Selection dialog box. 10 Click OK to save your changes and return to the Modify Attribute Form dialog box. 11 Click OK to return to Architect. 12 From the File menu, select Save to save your changes.
attribute using Architect, and follows the example scenario provided in Example: Creating compound attributes, page 285.
To create a compound attribute using Architect
1 In MicroStrategy Desktop, log in to a project. For the example scenario, log in to the MicroStrategy Tutorial project. 2 From the Schema menu, select Architect. MicroStrategy Architect opens. 3 From the Project Tables View, locate and select a table that includes the columns to use for a compound attribute. For the example scenario, select the LU_DIST_CTR table. 4 Right-click the table and select Create Attribute. A dialog box opens to name the attribute. 5 Type a name for the attribute, and click OK. The Create New Form Expression dialog box opens. 6 Double-click the COUNTRY_ID column to add it to the Form expression pane on the right. 7 Select Automatic mapping method. 8 Click OK to return to Architect. The new attribute is displayed in the LU_DIST_CTR table. To rename the attribute, right-click the attribute and select Rename. 9 In the Properties pane, locate the new attribute form. 10 In the Name field, type ID 1. 11 Right-click the attribute and click New Attribute form to create the other attribute ID form. The Create New Form Expression dialog box opens.
161
12 Double-click the DIST_CTR_ID column to add it to the Form expression pane on the right. 13 Select Automatic mapping method. 14 Click OK to return to Architect. The new attribute form is displayed in the LU_DIST_CTR table. 15 In the Properties pane, locate the new attribute form. 16 In the Name field, type ID 2. 17 In the Category drop-down list, select ID. A message about creating a form group is displayed. You can also create a form group by dragging and dropping one attribute form onto another attribute form for the same attribute. 18 Click Yes to create a form group. The two attribute forms are included in a form group. For more information on using form groups to create compound attributes, see Attributes with multiple ID columns: Compound attributes, page 284. 19 In the first Name field for the attribute form, type ID. 20 Because this is only an example, you can close Architect without saving your changes.
For information on modifying the attribute forms used for reporting and browsing, see Using attributes to browse and report on data, page 287. The procedure below describes how to define attribute form display using Architect. The steps below follow the example scenario provided in Defining how attribute forms are displayed by default, page 289.
To display an attribute form in reports and in the Data Explorer using Architect
1 In MicroStrategy Desktop, log in to a project. For the example scenario, log in to the MicroStrategy Tutorial project. 2 From the Schema menu, select Architect. MicroStrategy Architect opens. 3 From the Project Tables View, locate and select a table that includes the attribute to define how its attribute forms are displayed by default. For the example scenario, select the LU_DIST_CTR table, which includes the attribute Distribution Center. 4 Select an attribute. For the example scenario, select the Distribution Center attribute. 5 In the Properties pane, locate the attribute form. For the example scenario, locate the ID 2 attribute form. 6 You can define the following display options: Report Sort: Defines the default sort order of the attribute form when it is included in a report. From the drop-down list, you can choose from Ascending, Descending, or None. For information on how attribute forms are sorted when multiple attribute forms of a single attribute define a default sort order, see Default sorting of multiple attribute forms on reports, page 246.
163
Browse Sort: Defines the default sort order of the attribute form when it is viewed in the Data Explorer. From the drop-down list, you can choose from Ascending, Descending, or None. The Data Explorer is discussed in Enabling hierarchy browsing in reports: Data Explorer, page 309. Use as Browse Form: Defines whether the attribute form can be displayed in the Data Explorer. To allow an attribute form to be displayed in the Data Explorer, from the drop-down list, select True. The Data Explorer is discussed in Enabling hierarchy browsing in reports: Data Explorer, page 309. Use as Report Form: Defines whether the attribute form is displayed on reports by default. To define an attribute form to be displayed on reports by default, from the drop-down list, select True.
7 You can also define the default sort order for attributes on reports and the Data Explorer. For information on attribute form sorting options, see Displaying forms: Attribute form properties, page 245. 8 Because this is only an example, you can close Architect without saving your changes.
provided in Explicitly aliasing tables to specify attribute roles, page 281. You can also define attribute roles using automatic role recognition, which utilizes MicroStrategy VLDB properties and is described in Using automatic attribute role recognition, page 279.
To create attribute roles with explicit table aliasing using Architect
This procedure provides steps to re-create the example of explicit table aliasing described in this section. The LU_STATE table is not included in the MicroStrategy Tutorial project. However, you can use the same high-level procedure and concepts as guidelines to create attribute roles in your project setup. 1 In MicroStrategy Desktop, log in to the project to create attribute roles with explicit table aliasing. 2 From the Schema menu, select Architect. MicroStrategy Architect opens. 3 From the Project Tables View, locate and select the LU_STATE table that includes the attribute to define attribute roles for. 4 Right-click the LU_STATE table and select Create Table Alias. An LU_STATE(1) table is created. 5 Right-click LU_STATE(1), select Rename, and type LU_STATE_STORE. 6 Right-click the LU_STATE table and select Create Table Alias. An LU_STATE(1) table is created. 7 Right-click LU_STATE(1), select Rename, and type LU_STATE_VENDOR.
Create the attributes
8 Right-click the LU_STATE_STORE table and select Create Attribute. The Create New Form Expression dialog box opens.
2010 MicroStrategy, Inc. Creating and modifying attributes
165
9 In the Available columns pane, double-click STATE_ID, which identifies the attribute role. 10 Select Manual mapping and click OK. You are returned to Architect and the new attribute is created in the LU_STATE_STORE table. 11 Right-click the new attribute, select Rename, and type State Store. 12 Right-click the State Store attribute table and select New Attribute form. The Create New Form Expression dialog box opens. 13 Map any other columns to attribute forms for the State Store attribute. You must make sure to map any State Store attribute forms to columns from the LU_STATE_STORE table. 14 Click OK and save the State Store attribute. 15 Create a Vendor State attribute with the same sub-procedure (Create the attributes, page 165) used to create State Store above, except you must use the LU_STATE_VENDOR table instead of the LU_STATE_STORE table.
Prerequisites The internationalized data must be stored in your data source, as described in Supporting data internationalization, page 61. The project must enable data internationalization, as described in Enabling data internationalization for a project, page 90. An attribute has been created.
1 In Desktop, log in to a project. 2 From the Schema menu, select Architect. MicroStrategy Architect opens. 3 From the Project Tables View, locate an attribute. 4 From the Properties pane, locate an attribute form. 5 From the Support multiple languages drop-down list, select True to enable data internationalization for the attribute form. You can select False to disable internationalization for the attribute form. The ID form of an attribute does not have this option as these forms are used strictly for identification purposes. 6 Click Save and Close to save your changes and close Architect.
167
You link directly related attributes to each other by defining parent-child relationships. Attribute elements, or the actual data values for an attribute, dictate the relationships that you define between attributes. The parent-child relationships that you create determine the system hierarchy within the project. The four types of direct relationships that can exist between attributes include one-to-one, one-to-many, many-to-one, and many-to-many. For information on these direct relationships and steps to define them with the Attribute Editor, see Attribute relationships, page 260. You can also use Architect to define relationships between attributes. Architect can provide a more intuitive and helpful workflow that allows you to view and modify multiple attributes as you define attribute relationships. For example, in the MicroStrategy Tutorial project, the Time hierarchy includes relationships between the attributes Year, Quarter, Month of Year, Month, and Day. With Architect, rather than defining parent and child relationships for one attribute at a time, you can define the relationships between these attributes at the same time in a visual environment. The steps below show you how to manually define parent and child relationships between attributes, and also provides an example scenario of creating the relationships between the attributes Year, Quarter, Month of Year, Month, and Day in the MicroStrategy Tutorial project. You can also allow Architect to automatically define attribute relationships based on the design of your data, as described in Automatically defining attribute relationships, page 174. Prerequisites Attributes have been created for your project.
1 In MicroStrategy Desktop, log in to a project. For the example scenario, log in to the MicroStrategy Tutorial project. 2 From the Schema menu, select Architect. MicroStrategy Architect opens. In addition to the Hierarchy View in Architect, you can also use the System Dimension Editor to define attribute relationships. To determine which tool to use to define attribute relationships, see Using the System Dimension Editor, page 173. 3 From the Hierarchy View, in the Hierarchies drop-down list in the toolbar, select System Hierarchy View. The system hierarchy is displayed. 4 Prior to defining any relationships, you should gather the attributes that you want to relate to each other in the same area within the Hierarchy View of Architect. For example, the attributes Year, Quarter, Month of Year, Month, and
169
Day in the MicroStrategy Tutorial project are gathered close together in the Hierarchy View, as shown below.
5 Select an attribute that is to be a parent attribute in an attribute relationship. Drag from the middle of the attribute to an attribute that is to be a child of the parent attribute selected. A one-to-many relationship line is created between the two attributes.
For example, in the image below a relationship is created between the Year and Quarter attributes in which Year is a parent attribute of Quarter.
The triangular arrow on the relationship line that is created points from the parent attribute to the child attribute. In the example above, the arrow points from the Year attribute to the Quarter attribute, which identifies Year as the parent attribute of Quarter. 6 Attribute relationships created in this way are created as one-to-many relationships by default. To modify the relationship type, right-click the relationship line and select from one of the relationship types listed below: One-to-one One-to-many Many-to-one Many-to-many
For information on these relationship types, see Attribute relationships, page 260. 7 A table in which both attributes exist is chosen as the table to support the attribute relationship. To modify the relationship table, right-click the relationship line, point to Relationship table, and select a table.
To define attribute relationships with other techniques
If you are finished defining attribute relationships, you can save your changes and close Architect. The rest of this procedure describes how to define attribute relationships
171
with other techniques and completes the example scenario. 8 Right-click the Quarter attribute, and select Edit Children Relations. The Children Relations dialog box opens and lists attributes that can be related to the Quarter attribute. 9 For the Month attribute, in the Relationship type drop-down list, select One-to-many. You can select any of the available relationship types from the Relationship type drop-down list to create the required relationship. 10 For the Month attribute, in the Relationship table drop-down list, keep the default of LU_MONTH. 11 Keep the Relationship type drop-down list at None for the other attributes listed. Quarter is not directly related to any of these attributes. 12 Click OK to close the Children Relations dialog box and create the attribute relationship between Quarter and Month. 13 Drag from the middle of the Month of Year attribute to the Month attribute. A one-to-many relationship line is drawn between the two attributes. 14 Drag from the middle of the Month attribute to the Day attribute. A one-to-many relationship line is drawn between the two attributes.
This completes the definition of the required attribute relationships, as shown below.
173
To determine which tool to use to define attribute relationships, the table below lists the various features and functionalities of each tool:
Feature Defining attribute relationships Modifying attributes Architect System Dimension Editor
Architect and System Dimension Editor share the same workflow for defining attribute relationships, as described in To define attribute relationships, page 169. You can modify attributes using the various techniques and tools available through Architect, as described in Creating and modifying attributes, page 145. You cannot search for objects within the project that are dependent on attributes. You can modify attributes using the Attribute Editor by right-clicking attributes within the System Dimension Editor and selecting Edit. You can search for objects within the project that are dependent on attributes. This type of search returns objects such as reports, prompts, and filters that depend on the attribute.
1 In MicroStrategy Desktop, log in to a project. 2 From the Schema menu, select Edit System Dimension. The System Dimension Editor opens. To define attribute relationships, follow the workflow described in To define attribute relationships, page 169.
Prerequisites You have created attributes for your project (see Creating and modifying attributes, page 145).
1 In MicroStrategy Desktop, log in to a project. 2 From the Schema menu, select Architect. MicroStrategy Architect opens. 3 From the Hierarchy View, in the Hierarchies drop-down list in the toolbar, select System Hierarchy View. The system hierarchy is displayed. 4 Right-click within the area that displays the attributes for your project, and select Recognize Relationships. The System Hierarchy dialog box opens. 5 You can select from the following options to automatically define attribute relationships: Based on Primary Keys/Foreign Keys: Creates attribute relationships based on the primary keys and foreign keys defined on your tables. Each attribute that acts as a foreign key of a table is defined as a parent attribute of each attribute that acts as a primary key of the same table. The attribute relationship is defined as a one-to-many relationship from the foreign key attribute (parent attribute) to the primary key attribute (child attribute). Based on lookup tables: Creates attribute relationships based on lookup tables that do not include primary key or foreign key information. To define a table as a lookup table for an attribute, see Creating attributes, page 146. Each attribute that defines a table as its lookup table is defined as a child attribute of all other attributes in the same table, that do not define the table as its lookup table. Each attribute relationship is defined as a one-to-many relationship from the parent attribute to the child attribute.
175
Based on sample data from the table: Creates attribute relationships for attributes that share the same lookup table. To define a table as a lookup table for an attribute, see Creating attributes, page 146. Architect analyzes sample data for the table. The attributes with fewer distinct values are defined as parents of the attributes with more distinct values, using a one-to-many relationship from the parent attribute to the child attribute. For example, a lookup table includes four rows of data, which include data related to year and quarter. Each row includes the same year (for example, 2009), but the quarter changes for each row (Q1, Q2, Q3, Q4). In this case, the Year attribute is created as a parent of the Quarter attribute. 6 Once you have selected the appropriate options, click OK to allow Architect to automatically define attribute relationships. After all relationships are determined by the rules that you selected, Architect performs final analysis on the attribute relationships that are to be created. Any attribute relationships that are found to be redundant are not created. This ensures that attribute relationships are created that properly reflect the design of the data in your data source. For information on modifying the attribute relationships that are created, see Defining attribute relationships, page 167.
This section describes how to use Architect to create and modify user hierarchies.
1 In MicroStrategy Desktop, log in to a project. 2 From the Schema menu, select Architect. MicroStrategy Architect opens. 3 From the Hierarchy View, select an attribute to include in the hierarchy, and then click the New Hierarchy toolbar option( ). A dialog box to name the hierarchy opens. 4 In the Please enter the hierarchy name field, type a name for the hierarchy and click OK. You are returned to Hierarchy View with the attribute you selected included in the hierarchy.
177
5 To add additional attributes to the hierarchy, right-click within the Hierarchy View and select Add Attributes to Hierarchy. The Select Objects dialog box opens. 6 In the Available objects pane, select the attributes to use in the hierarchy and click the arrow to add them to the Selected objects pane. 7 Click OK to close the Select Attributes dialog box and return to Architect. The attributes you selected appear in Hierarchy View. 8 To create a browsing or drilling relationship, locate an attribute that is to be able to browse to and/or drill to another attribute. Drag from the middle of the attribute to another attribute. A browsing and/or drilling relationship is created between the two attributes. 9 To use the hierarchy as a drill hierarchy, right-click within the Hierarchy View and select Use As a drill hierarchy. If you clear this check box, the hierarchy is only used for browsing. A drill hierarchy can be used for browsing as well as drilling. Drill hierarchies are discussed in Drilling using hierarchies, page 310. 10 Each attribute in a user hierarchy has properties that affect how that attribute is displayed and accessed in a hierarchy. You can right-click an attribute and configure the properties listed below: Define Browse Attributes: Defines the attributes to which users can browse to and/or drill to from the selected attribute. These relationships can also be defined by dragging and dropping from one attribute to another as is described earlier in this procedure. Define Attribute Filters: Specifies whether the data retrieved and displayed should be complete or filtered by any specific criteria. A filter on a hierarchy acts like a filter in a report. Only data satisfying the filter criteria is displayed (see Filtering attributes in a hierarchy, page 304).
Set As Entry Point: Specifies whether the user can begin browsing in this hierarchy using this attribute (see Entry point, page 305). Element Display: Determines the elements a user can see. The element display may be Locked, Unlocked, or Limited (see Controlling the display of attribute elements, page 300).
11 Click Save and Close. 12 You can save user hierarchies in any folder. However, to make the user hierarchy available for element browsing in the Data Explorer, you must place it in the Data Explorer sub-folder within the Hierarchies folder. This is discussed in Enabling hierarchy browsing in reports: Data Explorer, page 309. 13 From the Schema menu, select Update Schema.
179
6
6.
Introduction
Facts are one of the essential elements within the business data model. They relate numeric data values from the data warehouse to the MicroStrategy reporting environment. Facts generally represent the answers to the business questions on which users want to report. In the MicroStrategy environment, facts are schema objects created by and shared between MicroStrategy users. The facts you create in MicroStrategy allow users to access data stored in the data warehouse. Facts form the basis for metrics, which are used in the majority of analyses and reports that users can create with MicroStrategy. Facts and attributes are necessary to define projects. In a MicroStrategy project, facts are numeric data and attributes are contextual data for the facts. For example, you want to analyze the amount of sales at a certain store during January. In this case, the amount of sales represents the fact, and the store and month represent attributes. As the project designer, you must create projects that contain facts and attributes.
181
Users can then use these facts and attributes as building blocks for metrics and reports.
Facts are stored in the data warehouse in fact tables. These fact tables are composed of different columns. Each cell in the columns represents a specific piece of information. When fact information is requested for a report in MicroStrategy, that column is accessed to retrieve the necessary data. This data is used to create a metric (such as profit) which is a business measure. Facts are based on physical columns within tables in the data warehouse, as shown below.
182
Like other schema objects such as attributes, facts are logical MicroStrategy objects that correspond to physical columns and tables. Unlike attributes, facts do not describe data. Facts are the actual data values stored at a specific fact level. A fact entry level is the lowest set of attributes at which a fact is stored. While creating facts is a major step in the initial creation of a project, it can often be necessary to modify and create facts throughout the life cycle of a project. The procedures to perform these tasks are discussed in the first section (Creating facts, page 183) of this chapter. The later sections discuss conceptual information on facts, as well as highlight some advanced fact design techniques and procedures.
Creating facts
A fact has two common characteristics: it is numeric and it is aggregatable. Examples of facts include sales dollars, units sold, profit, and cost. Data warehouses contain different types of facts depending on the purpose of the data. For example, facts such as Tenure and Compensation Cost could exist in a data warehouse that contains human resources data. Facts such as Quantity and Item Cost could exist in a warehouse containing sales and distribution data. It is important to understand how to define facts because facts are the basis for almost all metrics. Facts also allow you to create advanced metrics containing data that is not stored in the warehouse but can be derived by extending facts. This section provides steps to create facts at different phases of the project design process, using different techniques and MicroStrategy interfaces: Simultaneously creating multiple, simple facts, page 184 covers steps to create multiple, simple facts as part of the initial project design effort or later in a projects life cycle with the Fact Creation Wizard. You can also create multiple simple or advanced facts as part of the initial project design effort using Architect, as
2010 MicroStrategy, Inc. Creating facts
183
described in Creating and modifying simple and advanced facts using Architect, page 192. Creating and modifying simple and advanced facts, page 187 covers steps to add and modify both simple and advanced facts for an existing project.
This procedure is part of an initial project creation effort using the Project Creation Assistant, which launches the Fact Creation Wizard to complete the fact creation tasks. For steps to access the Project Creation Wizard, see To create a new
project using the Project Creation Assistant, page 84. You can also access the Fact Creation Wizard in MicroStrategy Desktop from the Schema menu. 1 In the Project Creation Assistant, select Create facts. The Fact Creation Wizard opens, as shown below:
2 Click Define Rules to set some basic fact creation rules. The Fact Creation Rules page opens. Rules help automate and govern the fact creation process. If the naming conventions in your warehouse do not conform to the defaults in the Fact Creation Rules page, you may need to change these rules. 3 The Column data type area allows you to select the column data types that are available as possible fact ID columns. Select the check boxes for the data types to be included when the wizard searches the data warehouse for available fact columns. For example, if you select Character and Numeric and leave the remaining check boxes cleared, only columns whose data types are numeric or character-based are displayed in the Fact Creation Wizard as possible columns to use for your facts. Unlike most attributes which can access multiple columns of description information, a fact does not have description information. Therefore, you can only select data types for the ID columns of your facts.
2010 MicroStrategy, Inc. Creating facts
185
4 The Fact name area allows you to determine how to create default fact names, that is, whether to replace underscores in the fact name with spaces and whether the first letter is capitalized. Select the appropriate check boxes to create the desired default fact names. 5 Click OK to accept your rule changes and return to the Fact Creation Wizard.
Fact column selection
6 Click Next. The Column Selection page opens, with columns that are not currently being used in the project listed in the Available columns pane. 7 From the Available columns pane, select the fact columns to use for your facts and click > to add them to your project. Click >> to add all the listed columns. Note the following: You can rename any fact to make its name more user-friendly by right-clicking the fact and selecting Rename. The Fact Creation Wizard cannot handle columns that hold the same information but have different column names (that is, heterogeneous columns). For more information about mapping facts to heterogeneous columns, see Facts with varying column names: Heterogeneous column names, page 199. 8 To remove fact columns from your project, select them from the Facts pane and click < to move them to the left side. Click << to remove all the columns in your project. 9 Click Next. The Finish page opens. 10 Review the summary information in the Finish page and click Finish to create the facts. The selected fact definitions are stored in the metadata. To continue creating a project with the Project Creation Assistant, see Simultaneously creating multiple attributes, page 225.
187
You can use the Fact Editor to edit existing facts and create fact expressions, column aliases, level extensions; map multiple or heterogeneous columns; and configure other settings. The Fact Editor allows you to modify one fact at a time, which can be helpful when only a few facts in a project need to be modified. For steps to use the Fact Editor, see Creating simple and advanced facts with the Fact Editor, page 189 and Modifying simple and advanced facts with the Fact Editor, page 191.
Creating one or more simple facts with the Fact Creation Wizard
Although the Fact Creation Wizard is primarily used to create most of a projects facts during initial project creation, you can use it at any time to create one or more simple facts at the same time.
To create facts with the Fact Creation Wizard
1 In MicroStrategy Desktop, log in to the project source that contains your project and expand your project. You must use a login that has Architect privileges. For more information about privileges, see Permissions and Privileges of the MicroStrategy System Administration Guide. 2 From the Folder List in MicroStrategy Desktop, select the project to which to add additional facts. 3 From the Schema menu, select Fact Creation Wizard. The Fact Creation Wizard opens. To use the Fact Creation Wizard to add facts, follow the procedures outlined in To create facts with the Fact Creation Wizard, page 184.
1 In MicroStrategy Desktop, log in to the project source that contains your project and expand your project. You must use a login that has Architect privileges. For more information about privileges, see Permissions and Privileges of the MicroStrategy System Administration Guide. 2 From the Folder List in MicroStrategy Desktop, select the project to which to add additional facts. 3 From the File menu, select New, and then Fact. The Fact Editor opens, with the Create New Fact Expression dialog box displayed on top of it. 4 From the Source table drop-down list, select the source table for the fact. The source table is the table or logical view that contains the fact column on which you want to base a new fact. 5 From the Available columns pane, drag and drop a column into the Fact expression pane. You can include multiple columns as well as use numeric constants and mathematical operators and functions to create a fact expression. For information on creating various types of fact expressions, see Mapping physical columns to facts: Fact expressions, page 195.
2010 MicroStrategy, Inc. Creating facts
189
6 In the Mapping area, select Automatic or Manual: Automatic mapping means that all of the tables in the project with the columns used in the fact expression are selected as possible source tables for the fact. You can then remove any tables mapped automatically or select other tables. Manual mapping means that all of the tables in the project with the columns used in the fact expression are located but are not selected as possible source tables for the fact. You can then select which of those tables are used as source tables for the fact. Other scenarios in which you should use the manual mapping method include: If you are creating a constant expression that is not based on a physical column in a project table, you must select the tables for which you want your constant expression to apply. If the same column name does not contain the same data across different tables, manually select the appropriate source tables for each fact. For example, suppose you have a column named Sales, which exists in both the Fact_Sales table and the Fact_Discount table. In the Fact_Sales table, the Sales column contains revenue data. However, in the Fact_Discount table, the Sales column contains discount data. In other words, although the column name is the same in both tables (Sales), the columns contain different fact data in each table. When creating the Revenue fact, you must select the Manual mapping method so you can select the Fact_Sales table as a source table for the Revenue fact. When creating the Discount fact, you must select the Manual mapping method so you can select the Fact_Discount table as a source table for the Discount fact. If you use the Automatic mapping method in both cases, the MicroStrategy SQL Engine may use the incorrect column for the facts. 7 Click OK to close the Create New Fact Expression dialog box.
8 Use the tabs of the Fact Editor to define fact expressions, create column aliases, and create extensions, as described below. For detailed information about the options on each tab within the Fact Editor, refer to the MicroStrategy Desktop online help. Definition: This tab allows you to define fact expressions. Fact definitions are discussed in How facts are defined, page 194. Column Alias: This tab allows you to create a column alias for the fact. Column aliases are discussed in Fact column names and data types: Column aliases, page 202. Extensions: This tab allows you to create fact level extensions. Fact extensions are discussed in Modifying the levels at which facts are reported: Level extensions, page 204.
9 When your changes are complete, click Save and Close. 10 In the Save As dialog box, navigate to the location in which to save the fact. Enter a name for the fact and click Save. The fact is saved and the Fact Editor closes. 11 From the Schema menu, select Update Schema to update the project schema.
1 In MicroStrategy Desktop, open the folder that contains the fact to modify. 2 Double-click the fact to open the Fact Editor and edit the fact. You can learn how to create more advanced facts in the various sections below.
2010 MicroStrategy, Inc. Creating facts
191
The fact definition is composed of one or more fact expressions. Every fact must have at least one expression. Fact definitions are discussed in detail in How facts are defined, page 194. The column alias stores the column name MicroStrategy uses to generate SQL statements when creating temporary tables related to the fact. Every fact must have a column alias. MicroStrategy selects a default column alias depending on the type of fact, unless you create a new column alias. Column aliases are discussed in detail in Fact column names and data types: Column aliases, page 202. Fact level extensions allow facts stored in the data warehouse at one level to be reported at an unrelated level. Extensions can also prevent a fact from being reported at a certain level, even though it is stored at that level. Level extensions are very effective for advanced data modeling scenarios. Level extensions are discussed in detail in Modifying the levels at which facts are reported: Level extensions, page 204.
193
You create facts in MicroStrategy Desktop using the Fact Creation Wizard and the Fact Editor. During project creation with the Fact Creation Wizard, when you select the numeric column used to represent the fact, both the fact definition and column alias are automatically defined. Level extensions are optional. For a discussion of the tools used to created facts and procedures on how to use them, see Creating facts, page 183.
In the example, the fact expression maps the fact to the All_Sales columns in the LU_ITEM and ORDER_DETAIL tables in the warehouse. The fact expression contained in the definition represents how the fact is calculated by MicroStrategy. In this case, the fact expression is simply the name of the column which holds the fact data. However, some facts use more advanced expressions to perform calculations on multiple columns of data to return a single fact. Facts can be found in multiple tables in a warehouse schema, and often must be calculated differently from one table to the
next. While the Unit Price fact only has one expression, multiple expressions can exist within a fact definition. Note the following: Each fact expression relates to one or more related tables that contain the fact. For each of the tables, fact expressions define how the fact is calculated.
Valid fact expressions are formulas constructed from fact columns with or without numeric constants or mathematical operators. The mathematical operators that can be used in a fact expression are:
2010 MicroStrategy, Inc.
195
You can use the Fact Editor to create fact expressions. These steps are covered in Creating and modifying simple and advanced facts, page 187. A fact can be defined using an ApplySimple function. Apply functions are discussed in the Pass-Through Expressions appendix in the MicroStrategy Advanced Reporting Guide. Most facts represent physical columns in the data warehouse. However, some facts do not exist at all in the warehouse and are defined in other ways, as explained in the following sections.
You can create a new fact, Sales, by creating the following derived fact: Sales = Quantity_Sold * Price One advantage of creating a derived fact is that a derived fact allows one consistent fact to exist in the project in lieu of having to retrieve multiple intermediary facts from multiple tables. Using a single fact saves storage space and limits the number of SQL passes used in queries. Rather than creating a derived fact, you can create such analysis in MicroStrategy with the use of metrics. Metrics allow you to perform calculations and aggregations on your fact data. For more information on what metrics are and how to create them, see the MicroStrategy Advanced Reporting Guide.
197
1 In MicroStrategy Desktop, log in to the MicroStrategy Tutorial project. 2 Navigate to the My Personal Objects folder, and open the My Objects folder. 3 From the File menu, point to New, and then select Fact. The Fact Editor opens, with the Create New Fact Expression dialog box displayed on top of it. 4 From the Source table drop-down list, select the ORDER_DETAIL table. 5 From the Available columns pane, double-click the QTY_SOLD column to add it to the Fact expression pane on the right.
To complete the derived fact expression
A derived fact expression includes a combination of columns, numerical constants, and mathematical operators. The steps below continue the example scenario to provide a guideline of how to create derived fact expressions. 6 With the cursor in the Fact expression pane, click * (multiplication operator) to add it to the expression. 7 From the Available columns pane, double-click the UNIT_PRICE column to add it to end of the fact expression. 8 Under Mapping method, select Automatic.
9 Click Validate to check whether the syntax of the expression is correct. The expression should appear as shown below:
10 Click OK. The derived fact expression appears in the Fact expression pane in the Fact Editor. 11 From the File menu, select Save As. The Save menu opens. 12 Enter a name for the derived fact and click Save. 13 When you create a fact for your project, at this point, you must update the project schema. However, since this is only an example, it is not necessary to update the schema.
MicroStrategy allows you to identify heterogeneous fact column names for each fact. With heterogeneous column names, you can refer the same fact to multiple columns with
2010 MicroStrategy, Inc. How facts are defined
199
different column names and from different tables that identify the same quantitative value. In the example above, creating a heterogeneous fact column name for dollar sales informs the system that the Dollar_Sales and Dollar_Sls columns represent the same fact. When you call for the information in a report through the use of a metric, both fact columns are used in the SQL, resulting in an accurate representation of the fact in the report.
1 In MicroStrategy Desktop, log in to the MicroStrategy Tutorial project. 2 Navigate to the My Personal Objects folder, and open the My Objects folder. 3 From the File menu, point to New, and then select Fact. The Fact Editor opens, with the Create New Fact Expression dialog box displayed on top of it.
4 From the Source table drop-down list, select the ORDER_FACT table. This is one of the tables in which a heterogeneous fact column for the Units Sold fact exists. 5 From the Available columns pane, double-click the QTY_SOLD column to add it to the Fact expression pane on the right. 6 In the Mapping method area, select Automatic. 7 Click OK. The Fact Editor opens and the fact expression you just created appears in the Fact expression pane. Now you must add the other heterogeneous fact column as separate expression for the Units Sold fact. 8 Click New. The Create New Fact Expression dialog box opens. 9 From the Source table drop-down list, select the CITY_CTR_SALES table. This is the other table in which a heterogeneous fact column for the Units Sold fact exists. 10 From the Available columns pane, double-click the TOT_UNIT_SALES column to add it to the Fact expression pane on the right. 11 In the Mapping method area, select Automatic. 12 Click OK. The Fact Editor opens and the fact expression you just created appears in the Fact expression pane. Now the Units Sold fact you are creating maps correctly to its heterogeneous fact columns. 13 From the File menu, select Save As. The Save menu opens. 14 Enter a name for the new fact and click Save. 15 When you create a fact for your project, at this point, you must update the project schema. However, since this is only an example, it is not necessary to update the schema.
201
By default, the data type for a fact is inherited from the data type of the column on which the fact is defined in the data warehouse. However, there are cases where you may need to change this. For example, you can define a fact to be the difference between two dates to perform a calculation such as the average number of days between a start and an end date. You could create this fact using the following expression: ApplySimple("DateDiff(day,#0, #1)", [Start_Date_Id], [End_Date_Id]) The expression syntax is specific to your database type. This syntax is specific to Microsoft SQL Server. The SQL you create may be different. The data type for this fact is automatically set to a Date data type because the Start_Date_ID and End_Date_ID have
Date data types. However, the result of the calculation, that is, the difference between the two dates, is an integer. This is used when a temporary SQL table needs to be created for the calculation. If you did not change the data type of the column alias, then the system uses a Date data type and tries to insert integer data into this column. This can cause an error for some database platforms. To avoid the possibility of an error due to conflicting data types, you should modify the column alias for the fact to change the default Date data type to an Integer data type. The procedure below describes how to use the Fact Editor to create column aliases. You can create column aliases using Architect, which is described in Creating and modifying fact column names and data types: Column aliases, page 144. Prerequisites This procedure assumes you have already created a fact with a valid fact expression for which to create a new column alias.
To create a column alias for a fact
1 In MicroStrategy Desktop, log in to the project source that contains the fact to create a new column alias for. 2 Right-click the fact and select Edit. The Fact Editor opens. 3 Select the Column Alias tab. 4 In the Column alias area, click Modify. The Column Editor - Column Selection dialog box opens. 5 Select New to create a new column alias. The Column Editor - Definition dialog box opens. 6 You can modify the following properties for the column alias: Column name: The name for the column alias which is used in any SQL statements which include the fact column.
203
Data type: The data type for the fact. For a description of the different data types supported by MicroStrategy, see Appendix C, Data Types. Depending on the data type selected, you can specify the byte length, bit length, precision, scale, or time scale for your column alias. For a detailed description on each of these properties, see the MicroStrategy Desktop online help.
7 Click OK to save your changes and return to the Column Editor - Column Selection dialog box. 8 Click OK to save your changes and return to the Fact Editor. 9 Select Save and Close to save your changes.
Level extensions are necessary when facts are stored in the data warehouse at one level and reported at different levels. Every fact is tied to a set of attributes that may or may not satisfy all users reporting requirements. A fact extension is
204 Modifying the levels at which facts are reported: Level extensions
needed when a fact does not relate directly or indirectly to an attribute included on a report.
If the entry level of a fact is at the lowest level of a hierarchy, all attributes at a higher logical level in the hierarchy are available for use as well, without the use of level extensions. For example if you have a cost fact at the level of a date attribute in a time hierarchy, MicroStrategy can aggregate the cost fact data to the level of the year attribute because it is in the same hierarchy as the date attribute and at a higher level. However, facts require level extensions to be related to any attributes that are at a lower logical level in the same hierarchy than the entry level for a fact (see Lowering the level of fact data: Fact degradations, page 214). You can use level extensions to change a fact level and extend a fact level to a level in a completely different hierarchy. For example, you record a Discount fact at the Item/Date level. That is, discounts apply to particular items on particular days. To see if some call centers are selling significantly more items at a discount than other call centers, you have to extend the level of the Discount fact to the Call Center level, which is an attribute from a different hierarchy. Level extensions define how facts can be extended, lowered, or disallowed to other attributes across the schema. By creating a level extension, you are allowing facts or attributes that have been captured at one level to be extended to other levels to meet reporting requirements.
205
Level extensions are not required like the fact definition and column alias, and they tend to be used only in specific cases. Before a metric containing a fact can be used with an attribute that is not in or related to the attributes entry level, a level extension must be defined for the fact. This is because if a fact is stored at a level unrelated to an attribute on a report, a level extension must exist to relate the fact data to the attribute. Otherwise, there is no way to make a connection between the fact data and the attribute. You can create fact level extensions by using any of the following methods: Defining a join on fact tables using table relations, page 206 Defining a join on fact tables using fact relations, page 211 Forcing facts to relate to attributes: Using cross product joins, page 212 Lowering the level of fact data: Fact degradations, page 214 Disallowing the reporting of a fact at a certain level, page 219
You can find complete descriptions for each of these methods in the online help for the Level Extension Wizard in the Fact Editor. You can use the Fact Editor to create level extensions.
206 Modifying the levels at which facts are reported: Level extensions
For example, the MicroStrategy Tutorial project includes a Freight metric. This metric has a table relation fact extension to the Item attribute. Since the ORDER_FACT table that defines Freight does not include the identity column for the Item attribute, the Freight fact cannot be reported at the Item level. A fact extension is required to view freight values for each item included in an order. In this example, the ORDER_DETAIL table is used to create the Freight fact extension to Item because: 1 The ORDER_FACT and ORDER_DETAIL tables both contain the Order attributes identity column to join the tables, and ORDER_DETAIL contains the Item attributes identity column to extend the fact to Item. 2 The Freight fact cannot simply be joined with a table containing Item information to return a meaningful freight value for each item. An allocation expression is required to extend Freight to the Item level. Notice that the ORDER_FACT and ORDER_DETAIL tables include Order-level Units Sold and Item-level Units Sold columns respectively. These two columns are used to allocate the fact expression in the procedure below. The following procedure steps through how to create the fact extension that has been created for the Freight fact of the Tutorial project. The procedure also describes general principles of creating fact extensions which you can use to create fact extensions for the facts in your project.
To define a fact extension with a table relation
1 In Desktop, log in to the MicroStrategy Tutorial project. 2 Browse to the Facts folder and double-click the Freight fact to edit it. The Fact Editor opens. 3 Click the Extensions tab. 4 Select Extension to Item and click Modify. The Level Extension Wizard opens. To create a new fact extension you would click New. However, this example steps through how the
207
Freight fact extension Extension to Item was created. 5 Read the Welcome statement and click Next. The General Information page opens.
To lower, extend, or disallow the fact entry level
6 Enter a name and a description for your fact extension (already provided). Then select whether you want to: Lower the fact entry level: define a fact degradation (see Lowering the level of fact data: Fact degradations, page 214) Extend the fact entry level: define a fact extension on a table relation, dynamic fact relation, or a cross product join Disallow partially or completely the fact entry level: define a fact extension that does not allow a fact to be reported at a certain level (see Disallowing the reporting of a fact at a certain level, page 219)
For this example you are creating a fact extension on a table relation, so select Extend the fact entry level, and click Next. The Extended Attributes page opens.
To select attributes to extend the fact to
7 Select the attributes you want to extend the fact to, allowing the fact to be reported at the new level. For this example Item is already selected. Click Next. The Extension Type page opens. To extend the fact so that it can be reported at any level in a hierarchy, choose the lowest level attribute in that hierarchy.
To select the type of fact extension
8 Select how you want to extend the fact: Specify the relationship table used to extend the fact: select a relationship table and join attributes. Select the relationship table dynamically: select a fact and join attributes. This allows the MicroStrategy
208 Modifying the levels at which facts are reported: Level extensions
Engine to select the table that includes the fact and join attributes you choose to create the fact extension (see Defining a join on fact tables using fact relations, page 211). Perform the extension through a cross product: select to apply a cross product join (see Forcing facts to relate to attributes: Using cross product joins, page 212).
For this example select Specify the relationship table used to extend the fact, and click Next to continue defining your fact extension on a table relation. The Table Selection page opens.
To select the table, join attributes, and define the allocation expression
9 Select the table used to extend the fact to the new level. For this example, the ORDER_DETAIL table is already selected. Click Next. The Join Type page opens. 10 Select whether to allow Intelligence Server to dynamically select what attribute(s) to perform the join, or manually select the attribute(s). Since you know that you want to join the ORDER_FACT and ORDER_DETAIL tables using the Order attribute, select Order and click Next. The Join Attributes Direction page opens. 11 You can choose to join using the attribute, or join using the attribute and its children. In this case Order has no children, so you do not have to click the Join against arrow to change the default. Click Next. The Allocation page opens. 12 Enter an allocation expression that calculates the fact at the new level. For this example, the allocation expression is already provided, ((Freight * [Item-level Units Sold]) / [Order-level Units Sold]). Take a moment to review the allocation expression. Notice that the expression returns an average freight amount per item of an order. Therefore, the extension of Freight provides an estimate of the freight for each item of an order, not an exact calculation. A more detailed description of why this occurs follows this procedure.
209
13 Click Finish to create the fact extension. When the engine processes a report containing Order, Item, and Freight, it joins ORDER_FACT and ORDER_DETAIL and considers the resulting table as one logical fact table at the Item, Day, Order, Employee, Promotion level. The SQL generated for the report containing Order, Item, and Freight (metric mapped to the Freight fact) is: select a11.[ORDER_ID] AS ORDER_ID, max(a11.[ORDER_DATE]) AS ORDER_DATE, a12.[ITEM_ID] AS ITEM_ID, max(a13.[ITEM_NAME]) AS ITEM_NAME, sum(((a11.[FREIGHT] * a12.[QTY_SOLD]) / a11.[QTY_SOLD])) AS WJXBFS1 from [ORDER_FACT] a11, [ORDER_DETAIL] a12, [LU_ITEM] a13 where a11.[ORDER_ID] = a12.[ORDER_ID] and a12.[ITEM_ID] = a13.[ITEM_ID] group by a11.[ORDER_ID], a12.[ITEM_ID] The SQL statement above is for an Access database. The SQL for your reports may vary depending on the type of DBMS you use. To view how the fact extension is an estimation of freight values for each item of an order, review the values of the first order with an extra metric that calculates the number of each item type in an order shown below.
Notice that the Freight metric averages the amount of freight per item in an order. The larger freight values occur because more than one of the item type was included in the order. This illustrates how fact extensions often provide an
210 Modifying the levels at which facts are reported: Level extensions
estimation of values at a different level rather than an exact calculation. If you want to provide exact values of data at a certain level, you most likely need to capture such data and store it in your data source.
To extend the entry level of the Freight fact to Customer, you can create a fact relation using the Order Unit Sales fact. The MicroStrategy Engine tries to join a table containing Freight to a table containing Order Unit Sales. The engine can make the following joins, depending on the join attributes specified: Table 1 and Table 2 on Distribution Center, and Order Table 1 and Table 4 on Distribution Center
211
Table 2 and Table 3 on Distribution Center Table 3 and Table 4 on Distribution Center
The joins described above demonstrate how the join attributes can be either Distribution Center and Order or just Distribution Center. You can define the fact relation in the Level Extension Wizard which you can access from the Fact Editor. Open the Order Unit Sales fact and extend it to either Distribution Center and Order or just Distribution Center. Next, select the Select the relationship table dynamically option and specify the tables to use for the extension. This option is set in the step immediately after To select the type of fact extension, page 208 in the procedure above. The tables and attributes you specify in the wizard determine the different types of joins that are created, as explained above. The SQL generated for a report containing Distribution Center, Customer, and Freight is shown below, if the only join attribute is Distribution Center. select a1.DIST_CENTER, a2.CUSTOMER, sum(a1.Freight) from TABLE3 a1, TABLE4 a2 where a1.DIST_CENTER = a2.DIST_CENTER group by a1.DIST_CENTER, a2.CUSTOMER The SQL statement above is for an Access database. The SQL for your reports may vary depending on the type of DBMS you use. As with table relations, you can specify the best fit as the join strategy so that the engine calculates the joins. In a best fit join, the set of join attributes must contain the entire key of the left-hand-side fact table (Table 3 in the example SQL above).
212 Modifying the levels at which facts are reported: Level extensions
allows a single fact value to relate to all elements of an unrelated attribute. This method can produce incorrect data because data can be repeated and counted twice in some cases. Cross products should only be used when no other way to extend the fact exists. When you specify a cross product join to relate a fact to an attribute, you are creating a Cartesian product of the lookup attribute. Since this method can be inefficient, MicroStrategy does not recommend using the cross product join. For example, in the following schema, Distribution Center does not relate to Dollar Sales:
Table 1 Table 2 Order Customer Dollar Sales
Distribution Center
To report Dollar Sales by Distribution Center, a cross product join must be used. You can define this cross product join in the Level Extension Wizard in the Fact Editor. Open the Dollar Sales fact and extend it to the Distribution Center attribute. Next, select the Perform the extension through a cross product option. This option is set in the step immediately after To select the type of fact extension, page 208 of the procedure above. For this example, you do not need to specify an allocation expression. Notice that no join attributes are specified. The MicroStrategy Engine always cross-joins the lookup tables of the attributes in the extension.
213
The SQL generated for a report containing Customer, Distribution Center, and Dollar Sales is: select a1.DIST_CENTER, a2.CUSTOMER, sum(a2.DOLLAR_SALES) from TABLE1 a1, TABLE2 a2 group by a1.DIST_CENTER The SQL statement above is for an Access database. The SQL for your reports may vary depending on the type of DBMS you use.
214 Modifying the levels at which facts are reported: Level extensions
employee to be listed with the same planned compensation value as the employees department, as shown below:
The analytical value of this fact degradation is not immediately recognizable. However, now that Planned Compensation is available at the Employee level, you can create more meaningful analysis with other fact data that is stored at the Employee level. For example, the Compensation Cost fact is stored at the Employee level. The metric Actual as % Planned Compensation has been created to calculate the actual compensation of an employee as a percentage of the planned compensation for the entire department of the employee. The metric definition is ([Compensation Cost]/[Planned Compensation]), which performs a division of metrics defined from the Compensation Cost and Planned Compensation facts, respectively. You can now view
215
what percentage of your planned compensation per department has been spent per employee, as shown below:
Without using a degradation of Planned Compensation to Employee, you could not include Department and Employee on a report with these metrics and return accurate values. The following procedure steps through how to create the fact degradation that has been created for the Planned Compensation fact of the Human Resources Analysis Module. The procedure also describes general principles of creating fact degradations which you can use to create fact degradations for the facts in your project.
To define a fact degradation
1 In Desktop, log in to the Human Resources Analysis Module. 2 Browse to the Facts / Compensation / Planning folder and double-click the Planned Compensation fact to edit it. The Fact Editor opens. 3 Click the Extensions tab. 4 Select Degradation to Employee and click Modify. The Level Extension Wizard opens. To create a new fact degradation you would click New. However, this example steps through how the
216 Modifying the levels at which facts are reported: Level extensions
Planned Compensation fact degradation Degradation to Employee was created. 5 Read the Welcome statement and click Next. The General Information page opens. 6 Enter a name and a description for your fact extension (already provided). Then select whether you want to: Lower the fact entry level: define a fact degradation Extend the fact entry level: define a fact extension on a table relation, dynamic fact relation, or a cross product join (see Defining a join on fact tables using table relations, page 206 and Defining a join on fact tables using fact relations, page 211) Disallow partially or completely the fact entry level: define a fact extension that does not allow a fact to be reported at a certain level (see Disallowing the reporting of a fact at a certain level, page 219)
For this example you are creating a fact degradation so select Lower the fact entry level, and click Next. The Extended Attributes page opens. 7 Select the attributes you want to degrade the fact to, allowing the fact to be reported at the new level. For this example Employee is already selected. Click Next. The Join Type page opens. To extend the fact so that it can be reported at any level in a hierarchy, choose the lowest level attribute in that hierarchy. 8 Select what attribute(s) to perform the join. For this example, the Department attribute is already selected. Click Next. The Join Attributes Direction page opens. 9 You can choose to join using the attribute, or join using the attribute and its children. For this example, the join is performed on the Department attribute and its children. Click Next. The Allocation page opens. 10 Enter an allocation expression that calculates the fact at the new level. For this example, you do not need to include an allocation expression. See Fact degradations
217
with allocation expressions, page 218 for an example of using an allocation expression for a fact degradation. 11 Click Finish to create the fact degradation.
218 Modifying the levels at which facts are reported: Level extensions
219
the extension conditions specified in some order and calculates the report based on the sorted order of extensions. This is not an expected design condition, although the engine returns a valid SQL. It is advisable to avoid fact definitions that contain contradictory extension definitions. The Disallow the fact entry level setting applies only to attributes that can be considered as extended attributes. For example, you create a report that contains the attributes Subcategory and Item and the Revenue metric, which is defined as sum of the Revenue fact. You now disallow an extension on the Revenue fact for the Item attribute and update the schema. If you re-execute the report, you can still see Revenue by Item. This implies that the fact extension has not been disallowed. This is because Revenue exists at the same level as Item in the MicroStrategy Tutorial project. So you encounter only normal joins and no extensions. There must be a valid reason to disallow reporting a fact at a certain level. In this case, disallowing the Revenue fact at the level it is stored at in the data warehouse does not make logical sense.
220 Modifying the levels at which facts are reported: Level extensions
7
7.
Introduction
Business data represented by facts can offer little insight without the presence of business concepts and context, which take the form of attributes in MicroStrategy. Attributes provide the business model with a context in which to report on and analyze facts. While knowing your companys total sales is useful, knowing where and when the sales took place provides the kind of analytical depth users require on a daily basis. For example, you have a report with the Month, Year, and Region attributes on the template, as well as a Revenue metric based on the Revenue fact. When executed, the report displays your companys revenue at the region, month, and year levels. Because of the attributes on the report, a substantial amount of information is available, including which regions produced the least revenue and which years saw the highest growth in revenue. If you remove the attributes from the report, you can only find out how much revenue the company generated in total.
221
Overview of attributes
Creating attributes is an important step in the initial project design effort, which comes after creating facts when using the Project Creation Assistant. New user and application requirements make attribute creation and modification an important part of the entire project life cycle.
In the data warehouse, attributes are normally identified by a unique ID column in a lookup table. In MicroStrategy reports, attributes are identified by the column headers of the reports. A report designer creates a report in part by determining these report column headers. Intelligence Server, using this report definition, instructs the engine how to build the SQL for that report. The expressions of attributes and facts in the report define the SELECT clause of the SQL command.
For example, consider the following: Select Store_ID, Date, sum(Sales) From Store_Fact Group By Store_ID, Date In the SQL above, sales information will be retrieved by store and date. The attributes and metrics in the report tell Intelligence Server where to look in the data warehouse for the information and how to create the SQL that will retrieve it. Because of this process, report analyzers do not have to know SQL to extract information from a data warehouse. The lowest level attribute you include in a report, such as Day, is the lowest level of detail reported. A high-level report, such as a report at the Year level, includes the Year attribute but lacks the detail of a similar report which includes the lower level attributes Month and Week. It is important to understand the data is still the same, it is just not aggregated. A discussion about metrics, filters, and reports is beyond the scope of this guide and is covered in the MicroStrategy Advanced Reporting Guide. Attributes are defined by these properties: Attribute form: contains an identifier or descriptor of an attribute. Attributes can have multiple attribute forms. For example, for the Customer attribute, Customer Email, Customer First Name, and Customer Last Name are examples of attribute forms. See Column data descriptions and identifiers: Attribute forms, page 243. Attribute expression: maps a MicroStrategy attribute form to one or more columns in the warehouse. See Attribute form expressions, page 247. Attribute relationship: allows interaction of data at different conceptual levels and shows how data is related within a project. See Attribute relationships, page 260.
Overview of attributes
223
The following diagram illustrates how the attribute properties listed above are related:
While creating attributes is a major step in the initial creation of a project, it is often necessary to modify and create attributes throughout the life cycle of a project. The procedures to perform these tasks are discussed in the first section (Creating attributes, page 224) of this chapter. The later sections discuss conceptual information on attributes, as well as highlight some advanced attribute design techniques and procedures.
Creating attributes
An attribute is primarily used to group and aggregate fact data to add business context to the fact data. The ability to report on and analyze data requires data to have a business
context; therefore, creating attributes is a major step in any project design effort. This section provides steps to create attributes at different phases of the project design process, using different techniques and MicroStrategy interfaces: Simultaneously creating multiple attributes, page 225: Provides steps to create multiple attributes as part of the initial project design effort or later in a projects life cycle with the Attribute Creation Wizard. Adding and modifying attributes, page 230: Provides steps to add and modify attributes for an existing project. This includes adding advanced features such as attribute forms to attributes that already exist or adding new attributes as your project evolves.
You can also create and modify attributes at any phase of the project design process using Architect. For information on creating and modifying attributes using Architect, see Adding and modifying simple and advanced attributes using Architect, page 236.
This procedure is part of an initial project creation effort using the Project Creation Assistant, which launches the Attribute Creation Wizard to complete the attribute creation tasks. For steps to access the Project Creation Wizard, see To create a new project using the Project Creation Assistant, page 84. You can also access the Attribute Creation Wizard at
Creating attributes
225
any time in the development of a project from the Schema menu in MicroStrategy Desktop. 1 In the Project Creation Assistant, click Create attributes. The Attribute Creation Wizard opens, as shown below.
These rules can make the process of choosing attribute columns and naming your attributes considerably easier, especially if you use consistent naming conventions and data types in your data warehouse. The Attribute Creation Wizard uses these rules below to help automate the attribute creation process. Change these rules if the naming or data type conventions in your warehouse do not conform to these defaults. 3 Click Define Rules to set some basic attribute creation rules. The Attribute Creation Rules page opens. 4 The Column data type area allows you to select the column data types to be available as possible attribute ID columns. Select the check boxes for the data types that should be included when the wizard searches the data warehouse for available attribute ID columns. 5 The Attribute name area allows you to determine how to create default attribute names. You can select the
appropriate check boxes to set the following default behaviors for creating attribute names: Replace underscores in the attribute name with spaces Remove the word ID from the name Capitalize the first letter
6 The Warehouse search area determines naming conventions to help locate your warehouse objects. The defaults are ID for identifier columns, DESC for description columns, and LOOKUP for lookup tables. 7 Click OK to accept your rule changes and return to the Attribute Creation Wizard.
ID column selection
An ID column is a column or group of columns that uniquely identifies each element of an attribute. 8 Click Next. The ID Column Selection page opens. When choosing the ID column for an attribute, make sure that all values in the column are unique and that it does not contain NULL values. You should never use a column that has NULL or repeated values as the ID column for an attribute. Doing so results in unexpected behavior and errors. Only those columns with data types that match those chosen in the rules you defined above appear on the ID Selection page. The columns that match the identifier naming convention that you set in the warehouse search rule above are automatically highlighted. 9 From the Available columns pane, select the columns to use for your attribute IDs and click > to add them to your project. Click >> to add all the listed columns. Note the following: You can rename any attribute name to make it more user-friendly by right-clicking the attribute and selecting Rename.
Creating attributes
227
To remove attribute ID columns from your project, select the attribute IDs in the Attributes pane and click < to move them to the Available columns pane. The Attribute Creation Wizard cannot handle columns that hold the same information but have different column names (that is, heterogeneous columns). For more information about mapping attributes to heterogeneous columns, see Joining dissimilar column names: Heterogeneous mappings, page 253.
Create compound attributes
A compound attribute is defined as an attribute with more than one column specified as the ID column. This implies that more than one ID column is needed to uniquely identify the elements of that attribute (see Attributes with multiple ID columns: Compound attributes, page 284). 10 To create a compound attribute, complete the following steps: Click Compound Attributes and then click Add. The New Compound Attribute dialog box opens. Type a name for the attribute. Select the columns that are required to uniquely identify the compound attribute and click OK. You are returned to the Attribute Creation Wizard.
Description columns provide the data which gives context and meaning to your attributes. 11 After adding all your attribute ID columns, click Next. The Description Column Selection page opens. 12 Select whether to use the ID or a different column for the description of the attribute. The column that meets the
description naming convention that you set in the warehouse search rule is automatically selected. Note the following: In general, you should use the default description column for each attribute. In some cases, however, it may make sense to use the ID column as the description column, such as Year. Other attribute forms need to be created through the Attribute Editor after you complete steps in the Project Creation Assistant. Refer to Adding attributes with the Attribute Editor, page 233, for more information about attribute forms.
Lookup table selection
Lookup tables are the physical representation of attributes; they provide the information for an attribute through data stored in their ID and description columns. 13 Click Next when you are finished selecting description columns for attributes. The Lookup Table Selection page opens. 14 Select the lookup table for each attribute. The table that follows the lookup naming convention that you set in the warehouse search rule is automatically selected. In general, you should choose the default lookup table for each attribute. 15 Click Next: If you have created compound attributes, the Compound Attribute Definition page opens. Specify the lookup table and description column for the compound attributes and click Next. The Relationship Definition page opens. If you have not created a compound attribute, the Relationship Definition page opens.
Relationship definition
For each attribute, you specify the children and the type of relationship: one-to-one, one-to-many, or many-to-many. When you design a logical data model for your project (see
2010 MicroStrategy, Inc. Creating attributes
229
Chapter 2, The Logical Data Model), the relationships between attributes should become apparent. Related attributes such as City, State, or Region are often grouped in a common hierarchy, like Location. In a logical data model, when attributes are in the same hierarchy they must be related to each other, whereas attributes in different hierarchies cannot be related. 16 For each attribute, define child attributes: In the Attributes pane, select an attribute and click Add. The Select Children Attributes dialog box opens. Select the child attributes from the list of available child attributes and click OK. You are returned to the Attribute Creation Wizard. In the Children of: attribute name pane, select the relationship type for the attribute to its child attribute. For more information on the different attribute relationship types, see Attribute relationships, page 260.
17 When you have defined children for all the attributes that need them, click Next. The Finish page opens. 18 Review the summary information in the Finish page and click Finish to create the attributes. After you have completed the steps of the Attribute Creation Wizard, the attributes are created. This completes the initial creation of a project with the Project Creation Assistant.
include lookup tables with information about different countries in its data warehouse. However, when the company opens its offices in Europe and Asia, it must add lookup tables that contain data about its new offices to its warehouse. It must then add these tables to its MicroStrategy project, and create the appropriate attributes so report users can analyze business data for their appropriate country. You can create attributes with either the Attribute Creation Wizard, which you use to create the first attributes for your project, or the Attribute Editor, which allows you to define attributes, attribute forms, and attribute form expressions. The Attribute Creation Wizard allows you to: Create simple attributes Create multiple attributes quickly Add a large number of attributes during project creation The Attribute Creation Wizard works well for building a large number of attributes initially, but you cannot use it to modify existing attributes or to define more advanced attributes. In general, you only use the Attribute Creation Wizard as part of the initial project creation to create most of the attributes for the project. For steps to use the Attribute Creation Wizard, see Simultaneously creating multiple attributes, page 225 and Adding attributes with the Attribute Creation Wizard, page 232. The Attribute Editor allows you to: Create simple and advanced attributes Edit existing attributes and configure additional schema-level settings You can use the Attribute Editor to edit existing attributes and create additional attribute forms, map heterogeneous column names, define advanced expressions, configure additional settings, and so on. The Attribute Editor allows you to modify one attribute at a time, which can be helpful when only a few facts in a project need to be modified. For steps to use the Attribute Editor, see Adding attributes
Creating attributes
231
with the Attribute Editor, page 233 and Modifying attributes, page 236. Architect allows you to: Create simple attributes Create multiple attributes quickly Add a large number of attributes during project creation Create simple and advanced attributes Edit existing attributes and configure additional schema-level settings With Architect, you can support all of the simple and advanced attribute features that are available in the Attribute Editor. Rather than focusing on one attribute at a time with the Attribute Editor, you can use Architect to create and modify multiple attributes for a project at once. For information on how to use Architect, see Adding and modifying simple and advanced attributes using Architect, page 236.
1 In MicroStrategy Desktop, log in to the project source that contains your project and expand your project. You must use a login that has Architect privileges. See the Permissions and Privileges appendix of the MicroStrategy System Administration Guide for more information. 2 From the Folder List, select the project to which to add new attributes. 3 From the Schema menu, choose Attribute Creation Wizard. The Attribute Creation Wizard opens. 4 To create attributes with the Attribute Creation Wizard, follow the steps outlined in Simultaneously creating multiple attributes, page 225.
1 In MicroStrategy Desktop, log in to the project source that contains your project and expand your project. 2 From the File menu, select New, and then Attribute. The Attribute Editor opens, with the Create New Form Expression dialog box displayed on top of it. 3 From the Source table drop-down list, select a table which contains the columns of data for the attribute. Its columns are listed in the Available Columns pane.
Creating attributes
233
4 Create a form expression for the ID form of the new attribute being created. To create a simple attribute form expression (Attribute form expressions, page 247), drag a column from the Available columns pane to the Form expression pane. To create a more advanced attribute form expression, use a combination of any of the following techniques: Enter constants in double quotes. Click f(x) in the Form expression toolbar to create a function using the Insert Function Wizard. Click any operator in the Form expression toolbar to insert it into the expression. 5 Click Validate to ensure that your expression is valid. 6 Under Mapping method, select Automatic or Manual: Automatic mapping means that all of the tables in the project with the columns used in the attribute form expression are selected as possible source tables for the attribute form. You can then clear any tables mapped automatically or select other tables. Manual mapping means that all of the tables in the project with the columns used in the attribute form expression are located but are not selected as possible source tables for the attribute form. You can then select which of those tables are used as source tables for the attribute form. Note the following: The mapping method defaults to Automatic for the first attribute or attribute form expression you create. The system maps the expression to each of the source tables. For subsequent attributes, the default is Manual. An expression that uses only a constant value cannot use the automatic mapping method. 7 Click OK. The Create New Attribute Form dialog box opens, from which you can create attribute forms for the
attribute (Column data descriptions and identifiers: Attribute forms, page 243). 8 From the Source tables pane, select a table and click Set as Lookup to set the lookup table for the attribute. A lookup table acts as the main table which holds the information for an attribute. If you chose manual mapping, select the check boxes of the tables to map to the attribute form. 9 In the Form general information area, type a name and description in the associated fields for the attribute form. 10 In the Category used drop-down list, do one of the following: Select a form category from the drop-down list. For a description of form categories, see Displaying forms: Attribute form properties, page 245. Click Modify to create a new form category. Using a column with a non-numeric data type as an ID column of an attribute can result in SQL generation issues. Therefore, if you select a column with a non-numeric data type and set it as an ID column, a warning message appears by default when you click OK in the Create New Attribute Form dialog box. 11 In the Form format area, select a display type and a default sorting option from the associated drop-down lists. Custom groups are sorted by the Default sort of the form that appears first in the Report display forms. For more information on custom groups, refer to the MicroStrategy Advanced Reporting Guide. 12 Click OK. The Attribute Editor opens. 13 From the File menu, select Save As. The Save dialog box opens. 14 Navigate to the folder in which to save the attribute. Enter a name for the derived fact. Click Save.
Creating attributes
235
15 From the Schema menu, select Update Schema to update the project schema. This ensures that your project is updated to recognize the new attribute definition.
Modifying attributes
After creating an attribute, you can modify the attribute at any time using the Attribute Editor. You cannot use the Attribute Creation Wizard to modify attributes.
To modify an existing attribute
1 In MicroStrategy Desktop, open the folder that contains the attribute to modify. 2 Double-click the attribute to edit. The Attribute Editor opens. You can then modify all the options available when creating and attribute in the Attribute Editor, which is described in the previous procedure To create an attribute using the Attribute Editor, page 233. You can learn how to create more advanced attributes in the various sections in this chapter.
the chapters and sections listed below for information on Architect and steps to create and modify attributes using Architect: Chapter 5, Creating a Project Using Architect Creating and modifying projects, page 102 Creating and modifying attributes, page 145
The following example displays the physical warehouse table that stores elements and data for the Customer attribute. Each attribute element is a row in an attribute lookup table in your data warehouse, as shown below:
237
The Customer attribute is a good example to understand the components of an attribute and the concept of an attribute element. With the Customer attribute, each attribute element is an individual customer. Each customer (attribute element) has its own set of information such as last name, first name, email address, and so on which are defined by the attribute forms (see Column data descriptions and identifiers: Attribute forms, page 243).
As shown above, an attribute element is a unique set of information defined by the attribute forms of an attribute. Attribute elements are identified by their browse forms, which should be forms that provide a general description of the attribute element. For example, in the image above, the First Name and Last Name forms are used to identify the attribute elements. Just as you would not refer to a customer by his or her street address, you would not want to use the Address form to identify the Customer attribute elements. For more information on selecting the attribute forms used to identify attribute elements, see Using attributes to browse and report on data, page 287. Attribute elements can be identified in logical data models. As shown below, the attribute Division has multiple attribute
In MicroStrategy reports, attribute elements are displayed depending on the location of the attribute they are associated with. For example, the report below (created from the Sales and Distribution Analysis Module) has two attributes, Sales Organization and Year. Sales Organization is on the rows of the report along with its attribute elements such as USA
239
Central. Year is on the columns of the report along with its attribute elements such as 2005.
The display of attributes and their attribute elements is also affected by the location of the metrics on the report. The report above uses the common practice of putting the metrics (Sales Orders Quantity (Base Units) and Cost Sales Orders) on the columns of the report.
This is the data that is shown to a user running the report with their regional settings defined as English. By supporting internationalized data, the same report can return the data shown below to a user with their regional settings defined as German.
The attribute element data is displayed in the German language. For example, the January, February, and March attribute elements are displayed as Januar, Februar, and Mrz. Data internationalization provides data from you data source translated in various languages for the attribute element data. To provide internationalized attribute names (such as Month of Year and Monat im Jahr in the reports above), descriptions, and other translated object information, you must use and configure metadata internationalization. For information on configuring metadata internationalization, see the System Administration Guide. Each attribute form can enable or disable the internationalization of its attribute element data. The procedure described below provides the steps to enable or disable internationalization for attribute forms. You can also use Architect to enable or disable the internationalization of attribute element data, as described in Supporting data internationalization for attribute elements, page 166.
241
Prerequisites The translated data has been stored in your data source, as described in Supporting data internationalization, page 61. The project has been enabled for data internationalization, as described in Enabling data internationalization for a project, page 90. An attribute has been created.
1 In Desktop, log in to a project. 2 Navigate to the Schema Objects folder, open the Attributes folder, and then open a folder that contains attributes to enable or disable data internationalization for. 3 Right-click an attribute and select Edit. The Attribute Editor opens. 4 In the Attribute forms pane, select an attribute form and click Modify. The Modify Attribute Form dialog box opens. 5 Select the Support multiple languages check box to enable data internationalization for the attribute form. You can clear the check box to disable internationalization for the attribute form. The ID form of an attribute does not have this option as these forms are used strictly for identification purposes. 6 Click OK to return to the Attribute Editor. 7 Click Save and Close to save your changes and return to Desktop.
Every attribute must have at least one form, and most have at least two: The ID form (required) A description form
Every attribute must have an ID form (identity form). ID forms serve to uniquely identify each attribute element from other elements for the same attribute. For example, the Customer attributes ID form is Customer_ID, which is a column of unique numeric values to identify each customer. To differentiate between two customers such as John Smith and Fred Black, each customer must have a different value for their identity column. In this case John Smith can have a value of 1 in the Customer_ID column and Fred Black can have a value of 2 in the Customer_ID column. Attributes also have description forms. The Customer attribute in the MicroStrategy Tutorial has various forms, including the Customer Name and the Address forms. These types of forms give context and information about the Customer attribute. Some attributes can have additional descriptive forms that do not serve as the primary description form. For the Customer
243
attribute, Email is included as an additional descriptive form, as shown in the following diagram:
In the data warehouse, a lookup table with three columns holds the following separate forms, described below:
Customer_ID: a unique, identifying number for each customer (ID form) Customer_Full_Name: the full name of each customer (Description form) EMAIL: the email address for the specific customer (Additional description form)
In this example, the LU_CUSTOMER table records all of the attribute form data for the Customer attribute. Attributes must contain at least one ID form, which uniquely identifies the attribute. The forms you create must have a reference to a lookup table and can include multiple
expressions. Each table must have an ID form; the ID forms are used to join tables. When creating an attribute form, you can choose a lookup table in the Attribute Editor from a list of tables existing in the project. In the warehouse, two columns with different names can represent the same information about an attribute. In such cases, you must map the appropriate columns to the same attribute to retrieve accurate and complete results when using an attribute on a report. Heterogeneous column names are discussed in Joining dissimilar column names: Heterogeneous mappings, page 253. For example, two tables exist, one with the forms Customer_ID, Name, and SSN. The second lookup table contains Customer _ID and Email. The attribute will have the Customer_ID, Name, SSN, and Email forms and the tables will join together through the ID columns because that is the column they have in common.
245
or most important description form can be helpful for project designers to quickly distinguish this attribute form from the other secondary forms. Format types control how the form is displayed and how filters are defined. For example, specifying a format type of Big Decimal allows users to preserve precision when qualifying on a form with more than 15 digits. Big Decimal is discussed in detail in Appendix C, Data Types. Report Sort: Defines how the attribute form is sorted by default when included in a report. From the drop-down list, you can choose from Ascending, Descending, or None. For information on how attribute forms are sorted when multiple attribute forms of a single attribute define a default sort order, see Default sorting of multiple attribute forms on reports below. Browse Sort: Defines how the attribute form is sorted by default when viewed in the Data Explorer. From the drop-down list, you can choose from Ascending, Descending, or None. The Data Explorer is discussed in Enabling hierarchy browsing in reports: Data Explorer, page 309. Supports Multiple Languages: Defines whether the attribute forms information can be displayed in multiple languages using data internationalization. For information on defining attribute forms to allow data to be displayed in multiple languages, see Supporting data internationalization for attribute elements, page 240.
For example, the Customer attribute in the MicroStrategy Tutorial project has the five attribute forms shown below:
Of these five attribute forms, only Last Name has a default report sort order defined. Modify the Address form so that it has a descending report sort order. If you include Customer on a report with both Last Name and Address, customers are sorted by their Last Name in ascending order. This is because Last Name was created first and therefore is considered for sorting before the Address form. If you remove the Last Name form from the report, customers are sorted by their address in descending order. This is the default functionality for how attributes are sorted by their attribute forms on reports. It is important to note that you can change how attribute forms are sorted from within a report. In a report you can use advanced sorting to define how attribute forms, metrics, and other report objects are sorted. Sorting defined for a report takes precedence over default sorting defined for attribute forms. For more information on advanced sorting, refer to the MicroStrategy Advanced Reporting Guide.
247
and CUST_LAST_NAME columns in the warehouse provide information about first and last names respectively. Although you can have multiple expressions in different tables, a form cannot have two different expressions in the same source table. You can create expressions using attribute columns, constants, and/or mathematical operators, for example, +, -, /, *. Only implicit attributes do not include a column in the expression, since they only use the constants you declare. You can also create a form expression using Apply functions. These functions are discussed in the Pass-through Expressions appendix in the MicroStrategy Advanced Reporting Guide. The types of attribute form expressions are: Simple expressions, page 248: Simple form expressions access data through columns in the data warehouse. Derived expressions, page 250: Derived form expressions perform some type of mathematical calculation on columns in the data warehouse to create an attribute form. Joining dissimilar column names: Heterogeneous mappings, page 253: Heterogeneous mappings allow you to use columns with different names in the data warehouse as the same attribute form. Implicit expressions, page 255: Implicit form expressions do not relate directly to data stored in the data warehouse. These form expressions create virtual data by combining or using columns to generate the data.
Simple expressions
A simple expression is based on a single warehouse column. The definition of the simple expression includes the tables in which the column is found. For example, Category is an attribute in the MicroStrategy Tutorial. It has two forms, ID and Description, both of which are defined by simple expressions. The expression for the ID
248 Column data descriptions and identifiers: Attribute forms
2010 MicroStrategy, Inc.
form is the CATEGORY_ID column and the expression for the description form is the CATEGORY_DESC column. Both of these columns reside in the table LU_CATEGORY.
1 In MicroStrategy Desktop, log in to the project source that contains the MicroStrategy Tutorial project and then log in to MicroStrategy Tutorial. 2 Navigate to the Schema Objects folder, open the Attributes folder, and then the Customers folder. 3 Double-click the Customer attribute. The Attribute Editor opens.
249
4 Click New. The Create New Attribute Form dialog box opens. 5 From the Source table drop-down list, select the LU_CUSTOMER table. This is the table that contains customers dates of birth. 6 Double-click the CUST_BIRTHDATE column to add it to the Form expression pane on the right. The mapping method is selected as Automatic by default. 7 Click OK. The Create New Attribute Form dialog box opens. 8 In the Form general information area, in the Name field, type Customer Birth Date. 9 From the Category used drop-down list, select DATE since Customer Birth Date is neither the ID form of Customer nor the primary description form. 10 Click OK. The new Customer Birth Date attribute form is added to the Attribute form pane in the Attribute Editor. 11 Because this is only an example, close the Attribute Editor without saving your changes.
Derived expressions
Derived expressions are created using a combination of warehouse columns, mathematical operators, functions, and constants. While simple expressions have their value determined by just one column in a warehouse table, derived expressions are defined using one or more columns as well as other operators and values. Any operation on a column (such as adding a constant, adding another column, or setting the expression to be an absolute value) creates a derived expression. For example, you can create a derived attribute to calculate age or anniversaries. By calculating the difference between the columns Date of Birth and Current Date, you can create an attribute to hold the age of a customer or an employee that has been derived from the two columns. By creating an attribute to calculate age in this manner, the attributes value
250 Column data descriptions and identifiers: Attribute forms
2010 MicroStrategy, Inc.
is automatically updated as the age changes. If you created an attribute for age in which you included a constant number, the attribute would need to be updated every time a customer or an employee has a birthday.
251
1 In MicroStrategy Desktop, log in to the project source that contains the MicroStrategy Tutorial project and then log in to MicroStrategy Tutorial. 2 Navigate to the Schema Objects folder, open the Attributes folder, and then the Customers folder. 3 Double-click the Customer attribute. The Attribute Editor opens. 4 Click New. The Create New Attribute Form dialog box opens. 5 From the Source table drop-down list, select the LU_CUSTOMER table. This is the table that contains customers first and last names. 6 Double-click the CUST_LAST_NAME column to add it to the Form expression pane on the right. 7 In the Form expression pane, place the cursor to the right of [CUST_LAST_NAME] and type + , +. 8 Double-click the CUST_FIRST_NAME column to add it to the Form expression pane on the right. Your expression should be defined as shown below.
9 Select Automatic as the mapping method. 10 Click OK. The Create New Attribute Form dialog box opens. 11 In the Form general information area, in the Name field, type Last Name, First Name.
12 From the Category used drop-down list, select None since Last Name, First Name is neither the ID form of Customer nor the primary description form. 13 Click OK. The new attribute form is added to the Attribute form pane in the Attribute Editor. 14 Because this is only an example, close the Attribute Editor without saving your changes.
253
the columns exist, you can select as many or as few as you want to be used as part of the attributes definition. In the Attribute Editor, you can view the chosen tables in the source Tables area to the right of the Form Expressions area. The data types of columns used in a heterogeneous mapping for a given attribute must be identical or similar enough for your particular RDBMS to join them properly. For example, most databases cannot join a data type of Text to a data type of Number. However, depending on your database platform, you might be able to join columns with data types of Number and Integer. You can also use Architect to create an attribute form with a heterogeneous column mapping, as described in Joining dissimilar column names: Heterogeneous mappings, page 157.
To create an attribute form with a heterogeneous column mapping
1 In MicroStrategy Desktop, log in to the project source that contains the MicroStrategy Tutorial project and then log in to MicroStrategy Tutorial. 2 Navigate to the Schema Objects folder, open the Attributes folder, and then the Time folder. 3 Double-click the Day attribute. The Attribute Editor opens. 4 Click New. The Create New Form Expression dialog box opens. 5 From the Source table drop-down list, select the LU_DAY table. 6 Double-click the DAY_DATE column to add it to the Form expression pane on the right. The mapping method is selected as Automatic by default.
7 Click OK. The Create New Attribute Form dialog box opens. 8 Click New. The Create New Form Expression dialog box opens. 9 From the Source table drop-down list, select the ORDER_DETAIL table. 10 Double-click the ORDER_DATE column to add it to the Form expression pane on the right. The mapping method is selected as Automatic by default. 11 Click OK. The Create New Attribute Form dialog box opens. Notice that there are now two expressions for the attribute form definition, both of which use different tables as the source of their information. You could continue this process to add as many heterogeneous columns as part of one attribute form as necessary. 12 In the Form general information area, in the Name field, type Date Example. 13 From the Category used drop-down list, select None since this is simply an example scenario. 14 Click OK. The new Date Example attribute form is added to the Attribute form pane in the Attribute Editor. 15 Because this is only an example, close the Attribute Editor without saving your changes.
Implicit expressions
While most attributes map directly to one or more physical columns in the warehouse, an implicit attribute is a virtual or constant attribute that does not physically exist in the warehouse. Such an attribute has an implicit expression, which is a constant value, although nothing is saved in an actual column. Implicit expressions are not defined by column names; they are defined by constants you specify. Any constant is acceptable, for example, RushOrder=Yes. Some attribute definitions can be implied by the existence of
2010 MicroStrategy, Inc. Column data descriptions and identifiers: Attribute forms
255
a row in a certain table, rather than being defined in terms of columns. Implicit attributes are useful in analyzing and retrieving relevant information. For example, the Rush Order attribute in MicroStrategy Tutorial is an example of an implicit attribute. Suppose you want a report to display which orders are rush orders so you can better keep track of your shipments. An implicit attribute such as Rush Order is useful for this purpose. The Rush Order attribute is defined by two expressions: the Rush_Order column in the Order_Fact table and the implicit expression Y, which stands for Yes. This implicit expression is used to keep track of which orders are rush orders. On a report with the Order and Rush Order attributes on the template, for each order that is a rush order, a Y is displayed in the Rush Order column. Implicit attributes are not commonly used, but are useful in special cases such as the scenario described above.
ID is stored in the database as DECIMAL(18, 0). Because this column stores high-precision values, you must modify the column alias for the attribute form and map it to a special data type, Big Decimal. By doing so, the precision can be preserved when performing filtering, drilling, or page-by on the Account attribute. Another example could be a case in which your warehouse does not have a lookup table for year information, but you would like to create a Year attribute. Many database platforms have functions that can extract parts of a date from a Date data type. For example, SQL Server has a Year function that extracts just the year from a date. In such a case, you can create a Year attribute using the following form expression: ApplySimple("Year(#0)",[Date_Id]) The ApplySimple expression above is syntactically correct for SQL Server. However, depending on your database or data source type, you may need to use a different syntax. The data type for this attribute is automatically set to a Date data type. This is because Date_ID is a Date data type. However, the result of the calculation is a year, such as 2002, and it is an integer. When a temporary SQL table is created, if you do not change the data type of the column alias, the system uses a Date data type and tries to insert integer data into this column. While this does not create a problem in all database platforms, some databases will return an error. To avoid the possibility of an error due to conflicting data types, modify the column alias for the attribute form and change the default Date data type to an Integer data type. In addition to specifying the data type to be used for an attribute form, the column alias also lets you specify the column alias name to be used in the SQL generated by MicroStrategy. When you create a form expression using a custom expression or multiple columns (as discussed in Attribute form expressions, page 247), the column alias for the attribute form defaults to CustCol (or CustCol_1, CustCol_2, and so on). The following piece of SQL shows, in bold, where the column alias name is used:
257
SELECT Year(a12.Date_Id) CustCol_1, sum(a11.Tot_Dollar_Sales) WJXBFS1 FROM YR_CATEGORY_SLS a11 cross join TRANS_DATE_LW_LY a12 GROUP BY Year(a12.Date_Id) While the column alias name does not affect the actual results or your report, you can change the column alias name to be more meaningful. The above example is a simple one, but this can be useful for troubleshooting the SQL for a particularly complex report. You can use the Attribute Editor to create column aliases. You can also use Architect to create column aliases, as described in Creating and modifying attribute data types: Column aliases, page 159. Prerequisites This procedure assumes you have already created an attribute with a valid attribute expression for which to create a new column alias.
1 In MicroStrategy Desktop, log in to the project source that contains the attribute to create a new column alias for. 2 Right-click the attribute and select Edit. The Attribute Editor opens. 3 Select an attribute form and click Modify. The Modify Attribute Form dialog box opens. 4 Select the Column Alias tab. 5 In the Column alias area, click Modify. The Column Editor - Column Selection dialog box opens. 6 Select New to create a new column alias. The Column Editor - Definition dialog box opens.
7 You can modify the following properties for the column alias: Column name: The name for the column alias which is used in any SQL statements which include the fact column. Data type: The data type for the fact. For a description of the different data types supported by MicroStrategy, see Appendix C, Data Types. Depending on the data type selected, you can specify the byte length, bit length, precision, scale, or time scale for your column alias. For a detailed description on each of these properties, see the MicroStrategy Desktop online help.
8 Click OK to save your changes and return to the Column Editor - Column Selection dialog box. 9 Click OK to save your changes and return to the Attribute Editor. 10 Select Save and Close to save your changes.
The decision to model data as an attribute form for a given attribute or as a separate attribute is usually determined
259
during the logical data modeling phase of project design. For more information on whether to model data as an attribute form or as a separate attribute, see Attribute forms, page 36.
Attribute relationships
After you have created attributes for your project, you can define attribute relationships to define how the engine generates SQL, how tables and columns are joined and used, and which tables are related to other tables. You link directly related attributes to each other by defining parent-child relationships, as explained in Attribute relationships, page 24. Attribute elements, or the actual data values for an attribute, dictate the relationships that you define between attributes. The parent-child relationships you create determine the system hierarchy within the project. The implications of whether attributes are related become clear when you begin building reports. You can run a report with two attributes that are relatedCountry and City, for examplewithout any problems. A report with two unrelated attributes, however, must include a metric based on a fact that is on or below the level of the two attributes, or else a Cartesian join occurs, which is generally undesirable. A Cartesian join, or cross join, is very database intensive as every row in one table is joined to every row in the other table. In MicroStrategy Desktop, you can define relationships for the attributes in your project. This step is covered in Simultaneously creating multiple attributes, page 225, as part of the initial project design effort and in Viewing and editing the parents and children of attributes, page 262, after a project has already been created. Attributes can be either related or unrelated to one another: Related: A parent-child relationship is defined between two or more related attributes. The relationship is defined through the attributes lookup table or a relationship table.
2010 MicroStrategy, Inc.
Four types of direct relationships can exist between related attributes, and these relationships are defined by the attribute elements that exist in the related attributes. Each type is described below: One-to-one: Each element in the parent attribute corresponds to one and only one element in the child attribute, and each child attribute corresponds to one and only one element in the parent attribute. A common example of a one-to-one relationship is citizen and taxpayer ID. A citizen can have only one taxpayer ID and a taxpayer ID can be assigned to only one citizen. One-to-many: Each element in the parent attribute corresponds to one or more elements in the child attribute, and each child attribute corresponds to one and only one element in the parent attribute. These are the most common types of attribute relationships. Year has a one-to-many relationship to quarter. One year has many quarters, but a specific quarter can be in one year only. This assumes that quarters are defined with an accompanying year such as Q4 2006, Q1 2007, and so on. Many-to-one: Each element in the parent attribute corresponds to one and only one element in the child attribute, and each child attribute corresponds to one or more elements in the parent attribute. Many-to-one relationships are the same type of relationship as a one-to-many, but it is defined from a different perspective. For example, year is described above as having a one-to-many relationship to quarter. This means that quarter has a many-to-one relationship to year. Many-to-many: Each element in the parent attribute can have multiple children and each child element in the child attribute can have multiple parents. In banking, customers and accounts are an example of a many-to-many relationship. One customer may have many accounts, and each account may be associated with many customers, such as in the case of a joint checking account. Attributes can also be related to other attributes through a chain of attribute relationships. Attributes of this type are
Attribute relationships
261
often in the same hierarchy. For example, consider the Geography hierarchy of the Customer Analysis Module, which contains the attributes Customer Region, Customer State, and Customer City:
In this scenario, Customer Region and Customer State are directly related to each other and Customer State and Customer City also have a direct relationship. While Customer City is not directly related to Customer Region, these two attributes are related through Customer State. This allows you to include Customer Region and Customer City on a report and view the different customer cities for each customer region. Unrelated: No parent-child relationship has been defined and the attributes are not related through a chain of attribute relationships. No relationship is present in the lookup tables or relationship tables for these attributes. Unrelated attributes can exist together in fact tables, giving context to the fact. For example, the Customer and Day attributes have no relationship to one another. A particular customer and a particular day only make sense together if a fact is associated with that combination. For example, a certain customer, Don Addison, spent $2,500 on January 5, 2003 on behalf of the health care company in which he works. In this case, care must be taken when using unrelated attributes on a single report. In general, however, these attributes are relatively straightforward to deal with from a project design perspective.
Parent-child relationships were designated when attributes were selected for the new project. However, you can continue to make changes to the relationships between attributes even after creating your project. For example, the Distribution Center attribute is the parent of the Call Center attribute. A one-to-one relationship exists between Distribution Center and Call Center. This means that only one call center exists in each distribution center. Country, in turn, is the parent of Distribution Center and multiple distribution centers exist in each country. So these two attributes have a one-to-many relationship. Assigning parent-child relationships to attributes allows you to connect attributes to one another in user hierarchies, as discussed in Creating Hierarchies to Organize and Browse Attributes, page 291. Also, when a report generates inaccurate SQL and results, viewing and changing parent-child relationships may be a necessary troubleshooting method. Follow the procedure below to view and edit the parents and children of the Distribution Center attribute. You can also use Architect to define relationships between attributes. Architect can provide a more intuitive and helpful workflow that allows you to view and modify multiple attributes as you define attribute relationships, as described in Defining attribute relationships, page 167.
To view and edit the parents and children of an attribute
1 In MicroStrategy Desktop, log in to the project source that contains the MicroStrategy Tutorial project and then log in to MicroStrategy Tutorial. 2 Navigate to the Schema Objects folder, open the Attributes folder, and then the Geography folder. 3 Double-click the Distribution Center attribute. The Attribute Editor opens. 4 Click the Children tab. The Call Center attribute is listed, along with the relationship type it shares with
Attribute relationships
263
Distribution Center, and the relationship table in which the relationship exists. Consider a scenario in which multiple call centers now exist in the same distribution center so they no longer have a one-to-one relationship; in this case, you must change the relationship type between Call Center and Distribution Center. 5 To change the relationship type, select One to Many from the Relationship type drop-down list. 6 You also want the relationship between the two attributes to be defined in the LU_Employee table instead of the LU_Call_Ctr table in which it is defined now. To change the relationship table, select the LU_Employee table from the Relationship table drop-down list. 7 Because this is only an example, close the Distribution Center attribute without saving your changes.
Many-to-many relationships
The presence of many-to-many relationships introduces complexity during the warehouse design process. With the presence of many-to-many relationships, you must make additional considerations to effectively plan your design. Below are some real-life examples of many-to-many relationships which must be carefully handled in the data model and schema: In a certain organization, each salesperson can work in more than one calling center. Likewise, each calling center has many salespeople. In a car manufacturing plant, many models of cars are produced, and each comes in several colors. That is, there are many colors for a single type of car, and many types of cars can be associated with the same color.
The following sections use the example of items and colors to demonstrate a many-to-many relationship and the options you have for dealing with them. One item can come in many colorsred hats, blue hats, green hatsand one color can be associated with many itemsred dress, red hat, red shoes, red socks. Potential problems with many-to-many relationships usually come in the following forms, both of which can be avoided by correctly modeling the relationship: Loss of analytical capability Multiple counting
Attribute relationships
265
Answering the first question requires a table that contains a list of all possible item/color combinations. Recall that one-to-many relationships are usually in the childs lookup table. In many-to-many relationships this is not feasible. Rather, a distinct relationship table needs to be present in your warehouse. The following diagram shows the lookup and relationship tables for item and color:
The Rel_Color_Item table provides a row for every possible item/color combination. Answering the second question requires a fact table that has sales information as well as color and item information. The following diagram shows the same scenario as before, but in addition it shows a simple fact table containing sales data keyed by item, color, and date.
The fact table in the above diagram alone is not sufficient to answer the first question. Only item/color
266 Attribute relationships
2010 MicroStrategy, Inc.
combinations that were actually soldand therefore have sales recordedcan be retrieved from this table. If you have item/color combinations that are available but that have never been sold, this fact table cannot provide a complete list of item/color combinations to answer question one. In summary, to prevent any loss of analytical flexibility when dealing with a many-to-many attribute relationship, the following requirements must be met: A distinct relationship table to identify all the possible combinations of attribute elements between attributes Both the attribute ID columns in the fact table You can implement the above points in several different ways, which are discussed in Working with many-to-many relationships, page 269.
Multiple counting
When dealing with many-to-many relationships, loss of analytical capability is only one challenge. Another equally significant issue is multiple counting. Multiple counting occurs when all of the following takes place: You attempt to aggregate data to the level of one of the attributes in the many-to-many relationship, or a higher level than one of the attributes in the many-to-many relationship. The relationship exists in a distinct relationship table. All of the attributes in the many-to-many relationship are not in the fact table.
Attribute relationships
267
Recall the example from above, but make the following change: remove color from the fact table.
Assume that there are three itemshats, dresses, and socksand that they come in three colorsred, blue, and greenwith the exception of socks, which come in only green and blue. The following diagram shows this data in the lookup tables as well as some simple sales data:
The risk of multiple counting occurs when you run a query requesting the sales by color, effectively aggregating to the item attribute level in the many-to-many relationship. This query would require both the fact tablewhich has the sales information by itemand the relationship tablesince color is not recorded in the fact table.
The difficulty lies in the fact that color is not in the fact table. There is no way to directly relate the sales of an item in the fact table to the color of that particular item. For example, instead of calculating the sales of red items, the query aggregates sales for all items that come in red according to the relationship table. The sum includes all hats and all dresses, including blue ones and green ones. This obviously leads to numbers that are higher than the true sales for red items. For example, using the given data, the following questions cannot all be answered accurately: What are the total sales for hats? The answer is $35, which can be calculated directly from the fact table. What are the total sales for red items? You cannot determine an accurate answer. The answer you get is $85, which is the total for all hats and dresses, since socks do not come in red. It is entirely possible that all the dresses sold are green; however, you cannot confirm this since color is not recorded in the fact table. What are the total sales for red dresses? Again, you cannot determine an accurate answer. If all the dresses sold are indeed green, the correct answer is $0, but the answer you will get based on the data in the fact table is $50. The following section describes several ways to prevent multiple counting when dealing with many-to-many relationships.
269
flexibility, and flexibility is always a trade-off with complexity. In all cases, the two fundamental components remain in place in one form or another: A relationship table to define the attribute relationship Both the attributes ID columns in the fact table MicroStrategy builds the rules that MicroStrategy SQL Engine uses to generate SQL when a report request is made. If you make both of the above physical implementations, the SQL Engine uses the related table when no metric is included on the report. When a metric is included, the fact table is used to answer the query. All of the following methods require additional data in the fact table. This means that you must capture the additional data in the source system. For example, you need to have data in the source system as to what the color is of each item sold. If this additional data was never captured in the source system, you cannot fully resolve the many-to-many relationship to calculate the amount of sales for items of a certain color. Method 1 This method is the most straightforward way to effectively manage many-to-many relationships. Method 1 requires you to create a separate relationship table (in this case, Rel_Color_Item) and add both attribute IDs to the fact table as shown in the following diagram.
Method 2 Method 2 eliminates the many-to-many relationship and the need for a distinct relationship table. Here the many-to-many relationship is converted into a compound attribute relationship. You treat one attribute as a child of the other and have a compound key for the lower level attribute. Also, you add both attribute IDs, in this case Item_ID and Color_ID, to the fact table as shown in the following diagram.
While this method eliminates the need for a separate relationship table, you lose the ability to view items independent of color, or vice versa. Method 3 Method 3 is the most versatile solution and has the following characteristics: Further simplifies the compound attribute relationship from Method 2 into a simple attribute relationship Provides the ability to view item and color together or independently Requires only one attribute column in the fact table for complete flexibility, rather than two
Here you must create a new attribute, lower in level than either Color or Item. This attribute is essentially a concatenation of Color and Item, which gives it a one-to-many relationship between itself and each of its
Attribute relationships
271
parent attributes. This is the SKU attribute, particularly common in retail data models or situations. Finally, rather than including Color and Item in the fact table, you only need to include this new child attribute SKU, as shown in the following diagram.
This method is actually quite similar to Method 1. The major difference is that the distinct relationship table from Method 1 has an additional column, SKU, which extends the relationship of each item/color combination into a single value. Consequently, you can use this single value in the fact table. The major disadvantage of Method 3 lies in creating the new attribute if your business model does not already use a similar structure, as well as possibly adding complexity to the ETL process.
like facts, they exist at the intersection of multiple attribute levels. Many source systems refer to these special attributes as flags. Therefore, if flags are referenced in your source system documentation, these are likely candidates for joint child relationships. Joint child relationships are really another type of many-to-many relationship where one attribute has a many-to-many relationship to two otherwise unrelated attributes. For example, consider the relationship between three attributes: Promotion, Item, and Quarter. In this case, Promotion has a many-to-many relationship to both Item and Quarter, as shown in the following diagram.
An example of a promotion might be a Red Sale where all red items are on sale. A business might run this promotion around Valentine's Day and again at Christmas time.
Attribute relationships
273
The second relates Promotion and Quarter as shown in the following diagram.
These two tables are sufficient to answer questions such as: What items have been in what promotions? What quarters have had what promotions?
However, these tables are not sufficient to answer the following more detailed and insightful questions: What items were in what promotions in a given quarter? In what quarters was a certain item involved in a certain type of promotion?
To answer these questions, you must combine the two relationship tables, creating one table to relate all three attributes. The relationship in the distinct relationship table must exist for a joint child relationship to be properly defined. However, it does not necessarily have to be in its own, distinct relationship table. Defining the relationship directly in the lookup table for the parent of the joint childin this case, Promotionwould be fine. Alternatively, you can build the relationship directly into the fact table. In these examples, It is important to notice the relationship between the three attributes. The Promotion attribute is related to a particular Item-Quarter pair, as opposed to it
being related to Item and Quarter separately. This is the essence of a joint child relationship and is shown in the following diagram.
Notice that a joint child relationship can be one-to-many or many-to-many. The issues with many-to-many relationshipsloss of analytical capability and multiple countingalso apply to many-to-many joint child relationships. If you have a joint child relationship in your data, it is important for you to define it in MicroStrategy so that you get the correct data for reports that use the parent attribute in a joint child attribute. This ensures that when you need to join the fact table to the parent attribute of a joint child relationshipfor example, to see sales by promotionthe join will always use both joint children rather than just one or the other.
275
following image, notice that the attributes Origin Airport and Destination Airport are defined using the same lookup table, LU_AIRPORT, and column, AIRPORT_ID.
Although it makes sense to see JFK as either an origin or destination airport on a report, it is understood that destination airport data differs from origin airport data. You need to support the logical concepts of an origin airport and a destination airport, but you do not want to create two separate lookup tables with identical data. Creating two separate lookup tables would create redundancy, and thus take up more storage space and be harder to maintain. When multiple attributes are defined using the same lookup table and column, the attributes are essentially playing different attribute roles. How an attribute plays multiple roles depends on the specific attribute. The Origin Airport and Destination Airport attributes share the same attribute forms, or various aspects about them, such as description, location, and so on. In the fact table, however, a separate column exists for each of their roles; the fact
276 Attributes that use the same lookup table: Attribute roles
If a report designer places both the Origin Airport and Destination Airport attributes on a report to obtain the number of flights that originated from MIA and arrived at LGA, an empty result set is returned. This occurs because the SQL statement tries to obtain the description of an airport that is both MIA and LGA at the same time (Airport_ID = "MIA" AND Airport_ID = "LGA"). If you identify that one of your attributes needs to play multiple roles, you must create an attribute in the logical model for each of the roles, as explained in Specifying attribute roles, page 278. This ensures that a report with attributes playing multiple roles returns correct data. In the following diagram, State is another example of an attribute that can have two roles since it relates to both the Vendor and Store attributes. In one case, it refers to the location of a vendor. In the other, it refers to the location of a
277
In an OLTP system, roles are most often implemented as a single table, as shown in the above diagram. In the data warehouse, a query involving both Vendor State and Store State needs to use the State table twice in the same query. For example, a report is created to display vendors from Arkansas who sold to New York stores. The results may be blank if the data warehouse structure was set up incorrectly. The SQL statement tries to obtain the description of a state that is both Arkansas and New York simultaneously, generating the empty result set.
278 Attributes that use the same lookup table: Attribute roles
Explicit table aliasing, where you create multiple logical tables pointing to the same physical table and define those two logical tables as the lookup tables for the two attributes. In a MicroStrategy project in which automatic attribute role recognition is enabled (meaning that the database instance-level VLDB property, Engine Attribute Role Options, is enabled), you can have a maximum of 99 attributes defined on the same column of the same lookup table. If you create more than this number of attributes, you encounter an error, and are unable to update the project schema or restart Intelligence Server.
Table aliasing provides advanced users with more control. If you are upgrading or have a very complex schema, it may be the better alternative. If you are new to MicroStrategy, however, it is easier to use automatic attribute role recognition. MicroStrategy recommends that you take advantage of automatic role recognition if you do not know the details of the modeling logic or the database. Automatic recognition does not work if the attributes are in the same hierarchy, meaning that a child attribute is shared. For example, in the State example provided above, the two State attributes do not have a common child attribute. In summary, if you identify that any one of your attributes needs to play multiple roles, an attribute must be created in the logical model for each of the roles. Remember this rule to help you identify attribute roles: If you want to see the same attribute multiple times on one report, as Ship Month and Order Month, for example, the attribute has multiple roles. In this example, Month is the attribute that has multiple roles. You can use either automatic attribute role recognition or explicit table aliasing to create the attribute roles.
279
lookup table. The resulting SQL code contains a self-join with the LU_State table. The logical model would look like the following:
Note that both roles for the State attribute are included in the logical model so that State can be considered from two different perspectives. Since the state in which a vendor resides and the state in which one of the stores is located are two different things, the logical model must reflect that. Automatic recognition allows these two attributes, Vendor State and Store State, to access the same lookup table, using different attribute names for the same expression. Automatic role recognition works only when the attributes use exactly the same expression, which in most cases simply represents a column or columns in a lookup table. Consider the following sample desired report:
Vendor_State_ID=15 (Arkansas)
Dollar Sales
In this case, the request is, Show me total sales by Store State for all my vendors in Arkansas (Store State ID = 15). The same lookup table, LU_State, can be used for both attributes, Store State and Vendor State, if attribute roles are used. The two attributes refer to the same columns of that table. To use automatic attribute role recognition, you must select the Engine Attribute Role Options, found in the database instance-level VLDB Properties under Query Optimization.
280 Attributes that use the same lookup table: Attribute roles
See the MicroStrategy Desktop online help or the MicroStrategy System Administration Guide for steps to set this VLDB property.
The difference between automatic recognition and explicit table aliasing is that when you use explicit table aliasing, you create separate lookup tables in the schema, but point them each to the same physical table. If you use explicit table aliasing for the Store attribute, one table (LU_STATE_STORE) contains the attribute Store State
281
while the other (LU_STATE_VENDOR) contains Vendor State, as shown in the following diagram.
Consider the following sample desired report that should provide data about the total sales by Store State for all vendors in Arkansas (Store State ID = 15):
Vendor_State_ID=15 (Arkansas)
Dollar Sales
When explicit table aliasing is used, the two lookup tables LU_STATE_STORE and LU_STATE_VENDOR are used. Since they are just different names for the same physical table, the report accesses the same physical table, LU_STATE, for both state names, as shown by this sample SQL: SELECT a12.State_Desc as State_Desc SELECT a13.State_Desc as State_Desc FROM LU_STATE a12 LU_STATE a13 When you create a table alias, the selected table is copied, allowing you to rename a copy of the same table. When you are ready to create new attributesas in the example discussed aboveyou can map the appropriate table to each attribute. In the case above, you would select the
282 Attributes that use the same lookup table: Attribute roles
LU_STATE_STORE table for the Store State attribute and LU_STATE_VENDOR for Vendor State. Table aliases are one kind of logical table. For information about logical tables, refer to Appendix B, Logical Tables. You can also use Architect to create attribute roles with explicit table aliasing, as described in Specifying attribute roles: Attributes that use the same lookup, page 164.
To create attribute roles with explicit table aliasing
This procedure provides steps to re-create the example of explicit table aliasing described in this section. The LU_STATE table is not included in the MicroStrategy Tutorial project. However, you can use the same high-level procedure and concepts as guidelines to create attribute roles in your project setup. 1 In MicroStrategy Desktop, log in to the project to create attribute roles with explicit table aliasing. 2 Navigate to the Schema Objects folder, and then select the Tables folder. 3 Right-click the LU_STATE table and select Create Table Alias. An LU_STATE(1) table is created. 4 Right-click LU_STATE(1), select Rename, and rename the table as LU_STATE_STORE. 5 Right-click the LU_STATE table and select Create Table Alias. An LU_STATE(1) table is created. 6 Right-click LU_STATE(1), select Rename, and rename the table as LU_STATE_VENDOR.
Create the attributes
7 Select the Attributes folder. 8 From the File menu, select New, and then Attribute. The Create New Form Expression dialog box opens.
283
9 From the Source table drop-down list, select LU_STATE_STORE. 10 In the Available columns pane, double-click STATE_ID, which identifies the attribute role. 11 Select Manual mapping and click OK. The Create New Attribute Form dialog box opens. 12 From the Source table drop-down list, select the same LU_STATE_STORE table. 13 Click OK. The Attribute Editor opens. 14 Click New to map any other columns to attribute forms for the State Store attribute. You must make sure to map any State Store attribute forms to columns from the LU_STATE_STORE table. 15 Save the State Store attribute once you are finished mapping attribute forms to columns of the LU_STATE_STORE table. 16 Create a Vendor State attribute with the same sub-procedure (Create the attributes, page 283) used to create State Store above, except you must use the LU_STATE_VENDOR table instead of the LU_STATE_STORE table.
For example, a retail project has two attributes, Class and Item. Class is the parent of Item and has a one-to-many relationship with it. The values in the Item_ID column do not uniquely identify an item. The item shirt has an Item_ID of 1. However, there are different shirts, depending on the classmens, womens, and childrens. Therefore, to uniquely identify a mans shirt, Item_ID and Class_ID must be grouped together, creating a compound attribute. All of the ID forms of the compound attribute should be within the same lookup table.
285
1 In MicroStrategy Desktop, log in to the project source that contains the MicroStrategy Tutorial project and then log into MicroStrategy Tutorial. 2 Navigate to the My Personal Objects folder, and open the My Objects folder. 3 From the File menu, select New, and then Attribute. The Attribute Editor opens, with the Create New Form Expression dialog box displayed on top of it. 4 From the Source table drop-down list, select the LU_DIST_CTR table. This is the table in which the two ID columns of Distribution Center reside. 5 Double-click the COUNTRY_ID column to add it to the Form expression pane on the right. 6 Select Automatic mapping and click OK. The Create New Attribute Form dialog box opens. 7 In the Form general information area, in the Name field, type Country ID. 8 Keep all other defaults, and click OK. 9 In the Attribute Editor, click New to create the other attribute ID form. This attribute form maps to the distribution center ID column necessary to complete the definition of the Distribution Center attribute. 10 Double-click the DIST_CTR_ID column to add it to the Form expression pane on the right. 11 Select Automatic mapping and click OK. The Create New Attribute Form dialog box opens. 12 In the Form general information area, in the Name field, type Distribution Center ID.
13 In the Form category section, from the Category used drop-down list, select ID. Click OK. You must designate this attribute form as an ID column so that it can be combined with the Country_ID form to create one unique identifier ID for the Distribution Center attribute.
Create a form group
14 A dialog box notifies you that another form (in this case, COUNTRY_ID) is already using the ID form category and that you must create a form group to combine the two ID columns. Click Yes. The Create New Attribute Form dialog box opens. 15 In the Name field, type Distribution Center and click OK. The Attribute Editor opens, with the form group you created in the Attribute forms pane. 16 Because this is only an example, close the Distribution Center attribute without saving your changes. If you create a compound attribute, you must update the schema to see your changes in the project. Close all editors. Then, from the Schema menu, select Update Schema.
287
forms are the attribute forms that appear as a user browses through the element list of an attribute in the Data Explorer in a project. Therefore, browse forms identify attribute elements. This separation allows for greater attribute display flexibility depending on the application. The browse forms of the attribute are also used to display the attribute elements in the prompt details auto text code of a Report Services document. For information on Report Services documents, see the MicroStrategy Document Creation Guide. When creating attributes, all forms are included as report display forms and browse forms by default. The only exception is if you create multiple attribute forms, the first form you create is not included as a report display or browse form. An attributes report display forms determine which attribute forms are displayed by default when the report is executed. By selecting different forms for the attribute, you select a different set of values for display. For example, a report includes Region as an attribute. If ID is selected as the attribute form, the display could be a number such as four. If Description is selected as the attribute form, the display could be a name, such as Northwest. If a report lists the cities in which you have stores, then you might choose to display the Long Description form, such as Chicago, instead of the URL attribute form, that is, www.chicago.com. You can also select which attribute forms are retrieved with the report results but not displayed on the grid. These browse forms are found in the Report Objects pane. In Grid view, you can add the attribute forms in Report Objects to the report without re-executing the report. For example you can include a cities URL attribute form as a browse attribute form so that your users can choose to display the form on a report. To modify the attribute forms displayed, you can: Right-click an attribute on a report or template and select the desired attribute forms From the Data menu, select Attribute Display to open the Attribute Display dialog box
For steps to display attribute forms on a report or template, see the online help and the section below.
1 In the MicroStrategy Tutorial, navigate to the Schema Objects folder, open the Attributes folder, and then the Geography folder. 2 Double-click the Distribution Center attribute. The Attribute Editor opens.
289
3 Click the Display tab. On the right, in the Report display forms pane, the description form of the Distribution Center is set as the only display form. This means that, when the Distribution Center attribute is used on a report, the actual names of the distribution centers are displayed. The ID 2 form in the Available forms pane represents the distribution centers identification numbers. 4 You can set the ID 2 form to be displayed in the following ways: To set the ID 2 form as a form that is displayed on a report by default: Select ID 2 from the Available forms pane and click the top > button to add the form to the Report display forms pane on the right. To set the ID 2 form so it is displayed in the Data Explorer when a user browses the Distribution Center attribute: Select ID 2 from the Available forms pane and click the bottom > button to add the form to the Browse forms pane on the right. The Data Explorer makes hierarchies available for users to facilitate placing objects on reports. The Data Explorer is discussed in Enabling hierarchy browsing in reports: Data Explorer, page 309. 5 You can also define the default sort order for attributes on reports and the Data Explorer. For information on attribute form sorting options, see Displaying forms: Attribute form properties, page 245. 6 Because this is only an example, close the Attribute Editor without saving your changes. You can also determine how attributes are displayed while users are editing and viewing reports. See the MicroStrategy Basic Reporting Guide for details.
8
8.
Introduction
Hierarchies are groupings of attributes that can be displayed, either ordered or unordered, to reflect the relationships that exist between the attributes in a project. In Chapter 2, The Logical Data Model, you learned how to use hierarchies to group related attributes in practical business areas. For example, you can include a Time hierarchy in your model that consists of Day, Week, Month, and Year attributes. This chapter discusses hierarchies as they exist in the MicroStrategy environment and provides information on the two different types of hierarchies in MicroStrategy. These types of hierarchies include the system hierarchy and the user hierarchy. The system hierarchy is automatically created when you create a project and is maintained by the relationships that exist among the projects schema objects.
291
The user hierarchy is a hierarchy which you create specifically for your report designers.
This chapter explores how to create and configure user hierarchies in MicroStrategy and provides additional information about hierarchy functionality in MicroStrategy Desktop.
1 In MicroStrategy Desktop, log into the project source that contains your project and open the project. 2 In the Folder List, navigate to and open the Schema Objects folder. 3 Open the Hierarchies folder, and then the Data Explorer folder. 4 From the File menu, select New, and then Hierarchy. The Hierarchy Editor opens, followed immediately by the Select Attributes dialog box. 5 In the Available objects pane, select the attributes to use in the hierarchy and click the arrow to add them to the Selected objects pane. Click OK to close the Select Attributes dialog box. The attributes you selected appear in the Hierarchy Viewer. 6 The arrows that connect certain attributes denote a relationship between the connected attributes. You can use these relationships as the browsing or drilling relationships for your hierarchy, or you can create your own. To create a browsing or drilling relationship, select in the middle of an attribute that is to be enabled to browse to and/or drill down to another attribute. Drag from the middle of the attribute to the related attribute. A browsing and/or drilling relationship is created between the two attributes. 7 To use the hierarchy as a drill hierarchy, select the Use as a drill hierarchy check box at the bottom of the Hierarchy Editor. If you clear this check box, the hierarchy is only used for browsing. A drill hierarchy can be used for browsing as well as drilling. Drill hierarchies are discussed in Drilling using hierarchies, page 310. 8 Each attribute in a user hierarchy has properties that affect how that attribute is displayed and accessed in a
2010 MicroStrategy, Inc. Creating user hierarchies
293
hierarchy. You can right-click an attribute and configure the properties listed below: Define Browse Attributes: Defines the attributes to which users can browse to and/or drill to from the selected attribute. These relationships can also be defined by dragging-and-dropping from one attribute to another as described earlier in this procedure. Define Attribute Filters: Specifies whether the data retrieved and displayed should be complete or filtered by any specific criteria. A filter on a hierarchy acts like a filter in a report. Only data satisfying the filter criteria is displayed (see Filtering attributes in a hierarchy, page 304). Set As Entry Point: Specifies whether the user can begin browsing in this hierarchy using this attribute (see Entry point, page 305). Element Display: Determines the elements a user can see. The element display may be Locked, Unlocked, or Limited (see Controlling the display of attribute elements, page 300).
9 Click Save and Close. The Save As dialog box opens. 10 Type a name for the hierarchy. Then navigate to the location in which you want to save the hierarchy. You can save user hierarchies in any folder. However, to make the user hierarchy available for element browsing in the Data Explorer, you must place it in the Data Explorer sub-folder within the Hierarchies folder. This is discussed in Enabling hierarchy browsing in reports: Data Explorer, page 309. 11 From the Schema menu, select Update Schema.
hierarchies, and other project objects together as you design your project. With Architect, you can support all of the features that are available in the Hierarchy Editor. Rather than focusing on one hierarchy at a time with the Hierarchy Editor, you can use Architect to create and modify multiple hierarchies for a project at one time. Review the chapters and sections listed below for information on Architect and steps to create and modify user hierarchies using Architect: Chapter 5, Creating a Project Using Architect Creating and modifying projects, page 102 Creating and modifying user hierarchies, page 176
Types of hierarchies
The two types of hierarchies that exist in MicroStrategy include: System hierarchy: The system hierarchy is created according to the relationships defined between the attributes in your project. You do not need to create the system hierarchy; it is automatically created in Desktop when you create a project. Although the system hierarchy specifies an ordered set of all attributes in the project, it does not define ordering or grouping among attributes. The ordering and grouping of attributes, among other configurations, is defined in user hierarchies. User hierarchy: User hierarchies are groups of attributes and their relationships to each other, arranged in ways that make sense to a business organization. They are user-defined and do not need to follow the logical data model. As the structure of your business intelligence system evolves, you can modify the design of a user hierarchy to include additional attributes or limit user access to certain attributes. This type of hierarchy is created to provide flexibility in element browsing and
Types of hierarchies
295
report drilling. Steps to create user hierarchies are discussed in: Creating user hierarchies, page 292, which describes creating user hierarchies with the Hierarchy Editor. Creating and modifying user hierarchies, page 176, which describes creating user hierarchies using Architect.
Hierarchy organization
The best design for a user hierarchy is to organize or group attributes into logical business areas. This allows users to more easily locate attributes in a project and navigate from one attribute to another. For example, you can place related attributes into hierarchies by their level. The example below demonstrates the Location and Customer hierarchies. Within the Location hierarchy, State, City, and Store are organized according to their relationships to each
Hierarchy organization
297
other. The Customer hierarchy also groups together the attributes Company, Contact, and Customer.
When creating user hierarchies, keep in mind that hierarchies do not have to be separate from one another or necessarily follow the dimensional structure of your logical data model.
Hierarchy structure
While both a system hierarchy and user hierarchy allow you to navigate attributes in your project, only the user hierarchy allows you to logically define and order groups of attributes. The rest of this chapter discusses user hierarchies and how to create and configure them in your project. When you group attributes together into user hierarchies, you are developing a working design of the display and browse functions of the attributes. In the example below, there are two instances of the Region hierarchy. One hierarchy demonstrates Region having multiple States and the States having multiple Stores. This hierarchy allows you to create drilling and browsing options to the lower levels to view Region, State, and Store on a report. However, if you only include Store in the Region
hierarchy, as in the second example, then the only options for drilling or browsing are the Region and Store levels.
299
(see Controlling the display of attribute elements, page 300). Attribute Filters: Specifies whether the data retrieved and displayed should be complete or filtered by any specific criteria. A filter on a hierarchy acts like a filter in a report. Only data satisfying the filter criteria is displayed (see Filtering attributes in a hierarchy, page 304). Entry Point/Not an Entry Point: Specifies whether the user can begin browsing in this hierarchy using this attribute (see Entry point, page 305). Browse Attributes: Shows the attributes to which users can browse from a given attribute. Represented by lines that connect one attribute to others (see Hierarchy browsing, page 307).
The following sections explain these properties and how to use the Hierarchy Editor to configure each.
element lists that can consume system resources. When you set the element display to locked, a padlock icon appears next to the attribute name. For example, the attribute Order is locked in the Data Explorer sample shown below.
While the user can view the attribute elements of Customer Region and Customer City, he or she cannot view information about each customers order. The Order attribute may be locked in order to prevent unauthorized users from accessing sensitive information about customer orders. Prerequisites A hierarchy has been created.
1 In MicroStrategy Desktop, open a hierarchy using either the Hierarchy Editor or Architect, as described below: Locate a hierarchy in the Folder List, right-click the hierarchy, and select Edit. The Hierarchy Editor opens. From the Schema menu, select Architect. MicroStrategy Architect opens. From the Hierarchy View, in the Hierarchies drop-down list, select a hierarchy. 2 Lock or unlock an attribute using the options listed below: To lock an attribute, right-click an attribute, point to Element Display, and then select Locked. A padlock
301
icon appears next to the locked attribute, and users can no longer view elements of this attribute. To unlock a locked attribute, right-click an attribute, point to Element Display, and then select Unlocked. The padlock icon is removed from the attribute, and users can now view the elements of this attribute.
3 In the Hierarchy Editor or Architect, click Save and Close to save your changes and return to Desktop. 4 From the Schema menu, select Update Schema. You can also lock and unlock attributes when you edit them in the Display tab of the Attribute Editor. However, this locks and unlocks the attributes within the system hierarchy, not any user hierarchies that contain the attributes. For example, if the attribute Year is locked in the Attribute Editor, no elements for Year display in the Data Explorer when Year is expanded.
been set. The following graphic displays this view in the Data Explorer.
1 In MicroStrategy Desktop, open a hierarchy using either the Hierarchy Editor or Architect, as described below: Locate a hierarchy in the Folder List, right-click the hierarchy, and select Edit. The Hierarchy Editor opens. From the Schema menu, select Architect. MicroStrategy Architect opens. From the Hierarchy View, in the Hierarchies drop-down list, select a hierarchy. 2 Right-click the attribute to limit, point to Element Display, and then select Limit. The Limit dialog box opens. 3 Type the number of elements to display at one time and click OK. 4 In the Hierarchy Editor or Architect, click Save and Close to save your changes and return to Desktop. 5 From the Schema menu, select Update Schema.
303
1 In MicroStrategy Desktop, open a hierarchy using either the Hierarchy Editor or Architect, as described below: Locate a hierarchy in the Folder List, right-click the hierarchy, and select Edit. The Hierarchy Editor opens. From the Schema menu, select Architect. MicroStrategy Architect opens. From the Hierarchy View, in the Hierarchies drop-down list, select a hierarchy. 2 Right-click the attribute to filter and select Define Attribute Filters. 3 If a tip about filtering opens, click OK. The Select Objects dialog box opens. 4 In the Available objects pane, select the filters to apply and click > to add them to the Selected objects pane. 5 Click OK to close the Select Objects dialog box. The attribute to which you applied the filter appears in the hierarchy with a filter icon. 6 In the Hierarchy Editor or Architect, click Save and Close to save your changes and return to Desktop.
Entry point
An entry point is a shortcut to an attribute in the Data Explorer. Creating an entry point grants users faster access to the attribute without having to browse through multiple
305
attributes to reach different levels in a hierarchy. This is especially useful when accessing frequently-used attributes. When you create a user hierarchy, the hierarchy, the attributes, and their elements appear in the Data Explorer. When you set an attribute to be an entry point, you are creating a shorter route to access that attribute. For example, a typical hierarchy is Time. When you click on Time, elements for each Year, such as 2007, 2006, and 2005, open. When you click on 2006, an element for each Quarter, such as Q1, Q2, Q3, and Q4, opens. If you are seeking Week 24, you need to open several levels of attributes to reach the correct data level, which is Week. If you set the attribute Week as an entry point, the attribute Week appears in the Data Explorer at the same level as Year. If an attribute is not set to be an entry point, it appears in its normal position within the hierarchy structure. If you set a locked attribute as an entry point, it still appears in the hierarchy but with a padlock icon. You can see the locked attribute, but are unable to access elements or attributes below that level. Prerequisites A hierarchy has been created.
1 In MicroStrategy Desktop, open a hierarchy using either the Hierarchy Editor or Architect, as described below: Locate a hierarchy in the Folder List, right-click the hierarchy, and select Edit. The Hierarchy Editor opens. From the Schema menu, select Architect. MicroStrategy Architect opens. From the Hierarchy View, in the Hierarchies drop-down list, select a hierarchy.
2 Right-click the attribute to set as an entry point, and select Set As Entry Point. The attribute is marked with a green check mark to denote that it is an entry point. To remove an entry point from an attribute, right-click an attribute and select Remove Entry Point. 3 In the Hierarchy Editor or Architect, click Save and Close to save your changes and return to Desktop. 4 From the Schema menu, select Update Schema.
Hierarchy browsing
Once you choose which attributes to place in a hierarchy, you can define the relationships between them. These relationships determine how users can browse the attributes from the Hierarchies folder. For example, if Catalog, Category, Subcategory, and Item are the attributes that comprise the user hierarchy Catalog Items, the hierarchy resembles the example below, showing the parent/child relationships between the attributes. For example, in the hierarchy below, Category is a parent attribute of Category and Category is the child attribute of Category.
A user hierarchy does not need to have these direct relationships defined. It can simply be a collection of attributes.
2010 MicroStrategy, Inc. Configuring hierarchy display options
307
Attributes in a hierarchy can have both browsing and drilling relationships between them. Browse attributes are attributes you specify a user can directly browse to from a given attribute in the user hierarchy. When you apply browse attributes to attributes in a hierarchy, you are specifying what levels of detail are visible when browsing the Data Explorer. Including hierarchies in the Data Explorer makes the hierarchies available for reports and to users in the project. For more information on including hierarchies in the Data Explorer, see Enabling hierarchy browsing in reports: Data Explorer, page 309. For each attribute in a hierarchy, you can assign one or more browse attributes to it. Using the example above, some of these attributes have been assigned a browse attribute. Specifically:
Hierarchy Attribute Catalog Category Subcategory Item Browse Attribute(s) Category, Subcategory Subcategory Catalog, Item
The addition of these browse attributes allows users to see the Subcategory elements directly from the Catalog attribute, without having to first browse down through the Category attributes to get to Subcategory. The ability to browse more
In the Data Explorer, the hierarchy described above resembles the example below.
Users can now view the subcategories in the catalog without first having to browse through the categories.
309
Explorer. Moving hierarchies to and from this folder also allows you to keep some hierarchies visible to users while hiding others. The Data Explorer is a tool in the Object Browser that holds the system hierarchy and the user hierarchies. When you create a new project, the system hierarchy for that project is automatically placed in the Data Explorer. You can save user hierarchies in any folder. However, to make a user hierarchy available for browsing in the Data Explorer you must place it in the Data Explorer foldera subfolder of the Hierarchies folder, which is located in the Schema Objects folder.
following hierarchy, Subcategory is a browse attribute of Catalog, which means that you can access the elements of Subcategory without having to necessarily access the elements of Catalog in Data Explorer. If you enable drilling in this hierarchy, you can drill from Catalog down to Subcategoryand any other browse attributes of Catalogon a report.
A drill hierarchy can be used for browsing as well as drilling. However, the way in which you browse attributes may not be the same way in which you drill on attributes in reports. If your drilling and browsing paths between attributes are different, you should create separate drilling and browsing hierarchies. Prerequisites A hierarchy has been created.
1 In MicroStrategy Desktop, open a hierarchy using either the Hierarchy Editor or Architect, as described below: Locate a hierarchy in the Folder List, right-click the hierarchy, and select Edit. The Hierarchy Editor opens.
311
From the Schema menu, select Architect. MicroStrategy Architect opens. From the Hierarchy View, in the Hierarchies drop-down list, select a hierarchy.
2 To define a user hierarchy as a drill hierarchy: With the Hierarchy Editor, select the Use as a drill hierarchy check box located at the bottom of the Hierarchy Editor. With Architect, right-click within the Hierarchy View and select Use As a drill hierarchy.
3 In the Hierarchy Editor or Architect, click Save and Close to save your changes and return to Desktop. 4 From the Schema menu, select Update Schema. After a user hierarchy is enabled for drilling, the hierarchy contributes to the drilling path of any attributes in it. Additional information on drilling is available in the MicroStrategy Advanced Reporting Guide.
to view either the system hierarchy or any of your user hierarchies. When you view the system hierarchy, you can see the actual relationships between attributes, as defined by the system when the project was created. When you view a user hierarchy, you do not see true attribute relationships, but rather the structure of the user hierarchy as defined by a project designer, to facilitate user browsing and report development.
The Hierarchy Viewer gives you flexibility over how much of a given hierarchy you choose to view at once. You can see all of the entry points into a hierarchy at once, or you may select only one at a time. For details on entry points, see Entry point, page 305. The Hierarchy Viewer also gives you direct access to any of the attributes in the hierarchy you choose to view. When you access a hierarchys attributes directly, you can define them as entry points. See Entry point, page 305 for more details on creating entry points.
To view the system hierarchy in the Hierarchy Viewer
1 In MicroStrategy Desktop, from the Schema menu, select Graphical View. 2 Select Hierarchies.
To view a user hierarchy in the Hierarchy Viewer
1 In the Hierarchy Viewer, from the Hierarchy menu, select the hierarchy to view. 2 Attributes that have a green check mark next to them are entry points. See Entry point, page 305 for more details on creating entry points.
313
1 In the Hierarchy Viewer, right-click the attribute to edit. 2 Select Edit. In the Hierarchy Viewer, the Aerial perspective provides an overview of the hierarchies in your project. Its decreased scale allows you to navigate through the entire project.
To access Aerial perspective mode in the Hierarchy Viewer
1 In the Hierarchy Viewer, from the View menu, select Aerial perspective. An aerial view of the hierarchy you are currently viewing is displayed. The green squares indicate attributes that are entry points. 2 The hierarchy in the Hierarchy Viewer shifts according to where you navigate in the aerial view. Click a section of the aerial view display to shift your view of a hierarchy to that particular section.
You can also view all of this information using Architect, which is described in Chapter 5, Creating a Project Using Architect.
To view your projects tables in the Table Viewer
1 In MicroStrategy Desktop, from the Schema menu, select Graphical View. 2 Select Tables.
To view more or less information about each table in the project
1 Open the Table Viewer, as described above. 2 In the Table Viewer, select Options. 3 From the Options menu, select or clear the options for any of the following, depending on what you want to see in the Table Viewer: Show joins Use circular joins Show relationships Show relationship types Show columns
315
9
9.
Introduction
Once your MicroStrategy project is set up and populated with schema objects, you are ready to start thinking about ways to better maintain the project and optimize it for both the short and long term. This chapter introduces you to maintenance and optimization concepts such as tuning the interaction between your data warehouse and your project, creating aggregate tables, and using partition mapping, and explains how to use these methods to enhance your project. You can find this information in the sections listed below: Updating your MicroStrategy project schema, page 318As you continue to enhance the design and functionality of your project, you will need to make various schema changes. To see any enhancements and changes to your project schema, you must update your project schema. Data warehouse and project interaction: Warehouse Catalog, page 320As your data warehouse changes to
317
meet new data logging requirements, your project must reflect these changes. This can include adding new tables to your project or removing tables that are no longer used. You can also tune the interaction between your data warehouse and your MicroStrategy project to bring your data into MicroStrategy in a way that meets your requirements. Accessing multiple data sources in a project, page 345 With the MultiSource Option feature of Intelligence Server, you can connect a project to multiple relational data sources. This allows you to integrate all your information from various databases and other relational data sources into a single MicroStrategy project for reporting and analysis purpose. Improving database insert performance: parameterized queries, page 355 MicroStrategys support for parameterized queries can improve performance in scenarios that require the insert of information into a database. Using summary tables to store data: Aggregate tables, page 358Aggregate tables store data at higher levels than the data was originally collected in the data warehouse. These summary tables provide quicker access to frequently-used data, reduce input/output and other resource requirements, and minimize the amount of data that must be aggregated and sorted at run time. Dividing tables to increase performance: Partition mapping, page 366Partition mapping involves the division of large logical tables into smaller physical tables. Partitions improve query performance by minimizing the number of tables and records within a table that must be read to satisfy queries issued against the warehouse.
Although the concepts are related, the project schema is not the same as the physical warehouse schema. Rather, the project schema refers to an internal map that MicroStrategy uses to keep track of attribute relationships, fact levels, table sizes, and so on within the project. Whenever you make any changes to a schema object you must indicate to MicroStrategy that new schema object definitions have been included and that these definitions need to be loaded into memory. You can do any of the following to update your project schema: Stop and restart MicroStrategy Intelligence Server, if in server-connected (3-tier) mode. Disconnect and reconnect to the project or the project source, if in direct (2-tier) mode. Manually update the schema. Manually updating the schema allows you to determine which specific elements of the schema are updated.
To manually update the schema
1 In MicroStrategy Desktop, from the Schema menu, select Update Schema. 2 In the Schema Update dialog box, select or clear the following check boxes: Update schema logical information: Use this option if you added, modified, or deleted a schema object. Recalculate table keys and fact entry levels: Use this option if you changed the key structure of a table or if you changed the level at which a fact is stored. Recalculate table logical sizes: Use this option to use MicroStrategy Desktops algorithm to recalculate
319
logical table sizes and override any modifications that you have made to logical table sizes. Logical table sizes are a significant part of how the MicroStrategy SQL Engine determines the tables to use in a query. Recalculate project client object cache size: Use this option to update the object cache size for the project.
3 Click Update. You can also update the schema with the last saved settings by clicking the Update Schema icon in the toolbar.
This section covers the following topics: Before you begin using the Warehouse Catalog?, page 321 Accessing the Warehouse Catalog, page 322 Adding and removing tables for a project, page 322 Managing warehouse and project tables, page 323 Modifying data warehouse connection and operation defaults, page 330 Customizing catalog SQL statements, page 338 Troubleshooting table and column messages, page 344 Note the following: You can also add tables to a project using MicroStrategy Query Builder. For more information on Query Builder, see the MicroStrategy Advanced Reporting Guide. You can connect to MDX Cube sources such as SAP BI, Hyperion Essbase, and Microsoft Analysis Services instead of a relational database. In this case, the MDX Cube Catalog handles tasks similar to the Warehouse Catalog. For more information, refer to the MicroStrategy MDX Cube Reporting Guide.
321
1 On the Windows Start menu, point to Programs, then to MicroStrategy, then Desktop, and then select Desktop. 2 Log in to the project source that contains your project in MicroStrategy Desktop, and expand your project. You must use a login that has Architect privileges. For more information about privileges see the Permissions and Privileges appendix of the MicroStrategy System Administration Guide. 3 Select a project and then from the Schema menu, select Warehouse Catalog. The Warehouse Catalog opens after it retrieves the table information from the warehouse database.
1 Access the Warehouse Catalog for your project as described in To access the Warehouse Catalog, page 322. Log in to the project source that contains your project in MicroStrategy Desktop, and expand your project. 2 The left side of the Warehouse Catalog lists all available tables and the number of rows each table contains. The list on the right shows all the tables already being used in the project: To add tables: From the left side, select the tables you want to add to the Warehouse Catalog, and click > to add the selected tables. Click >> to add all the listed tables. To remove tables: From the left side, select the tables you want to add to the Warehouse Catalog, and click > to add the selected tables. Click >> to add all the listed tables. If you have a license for the MultiSource Option, you can add tables from multiple data sources into your project. For information on adding tables from multiple data sources into your project with the Warehouse Catalog, see Accessing multiple data sources in a project, page 345.
3 In the toolbar, click Save and Close to save your changes to the Warehouse Catalog. The table definitions are written to the metadata. This process can take some time to complete. 4 Update the project schema from the Schema menu, by selecting Update Schema.
323
project. To access the Warehouse Catalog for a project, see Accessing the Warehouse Catalog, page 322. As you make changes to the tables in the warehouse, you need to periodically load the updates into the Warehouse Catalog. You can update it by selecting Read the Warehouse Catalog from the Actions menu. The Warehouse Catalog has the following sections: Select current database instance: From the drop-down list, select the database instance for the data source to view tables for. This option is available as part of MicroStrategy MultiSource Option, which allows you to access multiple data sources in a project, as described in Accessing multiple data sources in a project, page 345. Tables available in the database instance: Displays tables that are located in the data source for the selected database instance, but have not been included in the project. You can add tables to the project by double-clicking the tables or by selecting the tables and then clicking >. Tables being used in the project: Displays tables that have been selected to be part of the project. You can remove tables from the project by double-clicking the tables or by selecting the tables and then clicking <. You can add or remove all the tables from one section to the other by clicking << and >> buttons. Warehouse Catalog has the following menu options.
Menu File Save Exit Tools View Partitions Displays the list of tables referred to by the selected partition mapping table in the Table Partitions dialog box. This option is enabled when a partition mapping table is selected. Displays the structure of a table selected in the Warehouse Catalog. Saves the current settings and status of the Warehouse Catalog. Exits the Warehouse Catalog. Description
Table Structure
Menu Calculate Table Row Count Table Prefix Table Database Instances
Description Calculates the number of rows in the selected tables. Allows you to add or remove a table prefix for the selected table. This option allows you to support one of the following: MicroStrategy allows you to specify a secondary database instance for a table, which is used to support database gateways. For information on supporting database gateways, see Specifying a secondary database to support database gateways, page 329. If you have a license for the MultiSource Option, you can add tables from multiple data sources into your project. For information on adding tables from multiple data sources into your project with the Warehouse Catalog, see Accessing multiple data sources in a project, page 345. Allows you to import the prefixes from the warehouse table name space. Allows you to specify various settings for the Warehouse Catalog such as changing the database instance, changing or assigning default table prefixes and structures, automatic mapping, row calculation, and so on.
Actions Read the Warehouse Catalog Help Allows you to update and reflect the changes done to tables in the warehouse. Displays MicroStrategy online help options
Some of these options are also available through toolbar buttons and through right-click menus for quick access.
325
When the data type of one or more columns is modified, you get a warning message of this change, which provides the following options: Click OK to apply the change to this column in all the tables it appears. Click Cancel to undo all data type changes. This action results in no changes being applied to any tables or columns. The warning message appears only if you have selected the Display a warning if the columns data types are modified when updating the table structure option in the Warehouse Catalog Options dialog box. This option is selected by default.
1 Access the Warehouse Catalog for your project (see Accessing the Warehouse Catalog, page 322). The Warehouse Catalog opens. 2 In the Tables being used in the project list, right-click the table that has changed and select Update Structure. If the data type of one or more columns is modified, you receive a message warning of this change. Verify the changes from the information dialog box that opens and click OK to apply the change in this column to all the tables in which it appears.
3 Click Save and Close to close the Warehouse Catalog dialog box. If no object definitions have changed, the warehouse structure gets updated completely with the Update Structure command. For example, this would apply if you rename a column in the table and the column is not being used in any fact expression. If any of the object definitions have changed, the table structure is only partially updated with the Update Structure command. Then, you have to manually update the schema objects that depend on the outdated structure. For example, if you rename a column in a table, you have to manually update the facts that use this column. The procedure for manually updating the fact is as follows: a Right-click the fact and select Edit. The Fact Editor opens. b Select the fact expression and click Modify. The Modify Fact Expression dialog box opens. c From the list of source tables select the source table from which the fact has been created. Edit the fact expression and click OK. You are returned to the Fact Editor.
d Click Save and Close to save the changes and close the Fact Editor. e f From the Schema menu, select Update Schema. The Schema Update dialog box opens. Click Update.
g Repeat the first two steps of this procedure to open the Warehouse Catalog and update the table structure. h Click Save and Close to save the changes and close the Warehouse Catalog dialog box.
327
Removing tables from the Warehouse Catalog that have been removed from their data source
When tables that are included in a project are removed from the data source that they were available in, you can use the Warehouse Catalog to remove these tables from the list of tables included in the project. This allows you to view an accurate list of tables that are included in the project from the selected data source. The steps below show you how to perform this task using the Warehouse Catalog. To remove these tables using MicroStrategy Architect, see Removing tables from a project that have been removed from a data source, page 124. If tables that were not included in a project are removed from the data source, these tables are automatically removed from the display of available tables in the Warehouse Catalog.
To remove the display of project tables that have been removed from the data source
1 In MicroStrategy Desktop, log in to a project. 2 From the Schema menu, select Warehouse Catalog. The Warehouse Catalog opens. 3 From the Warehouse Catalog toolbar, click Check for deleted catalog tables. The Deleted Catalog Tables dialog box opens.
4 Select the Delete check box for a table to remove it from the Tables being used in the project pane. 5 After you have selected all the tables to delete, click OK to return to the Warehouse Catalog. 6 From the Action menu, select Read the Warehouse Catalog. All tables that were selected to be deleted in the Deleted Catalog Tables dialog box are removed from the Tables being used in the project pane. 7 Click Save and Close to save your changes and close the Warehouse Catalog.
329
1 Access the Warehouse Catalog for your project (see Accessing the Warehouse Catalog, page 322). The Warehouse Catalog opens. 2 Right-click a table being used in the project, (in the pane on the right side) and select Table Database Instances. The Available Database Instances dialog box opens. 3 In the Primary Database Instance drop-down list, select the primary database instance for the table. 4 Select one or more Secondary Database Instances. You cannot select the primary database instance as a secondary database instance. 5 Click OK to accept your changes and return to the Warehouse Catalog. 6 From the toolbar, select Save and Close to save your changes and close the Warehouse Catalog.
331
columns for the selected tables. When connected to a Microsoft Access data source, the Settings option is disabled. The default catalog SQL retrieves a DISTINCT list of tables and columns from all users. You could restrict the information returned, for example, by specifying certain conditions and table owners (see Customizing catalog SQL statements, page 338). You can also select the following check boxes: Read the table Primary and Foreign Keys: Select this option to display, in MicroStrategy, which columns are defined as primary keys or foreign keys in the data source. Primary keys and foreign keys can help facilitate joining tables to create Query Builder reports, as described in the Advanced Reporting Guide. Displaying primary key or foreign key information in MicroStrategy can also help users designing a project to determine which columns of data may be suitable to serve as the identification columns of attributes. Count the number of rows for all tables when reading the database catalog: Select this option if you want to control whether or not the Warehouse Catalog should get the number of rows each table has when loading from the data warehouse. This option is helpful when you want to identify fact tables and aggregation tables. If performance is more important than obtaining the row count, do not select this option as it will have a negative effect on performance. By default this option is selected when you open the Warehouse Catalog for the first time. Ignore current table name space when reading from the database catalog and update using new table name space: This option allows you to switch between warehouses found in different database name spaces. For more information, see Ignoring table name spaces when migrating tables, page 337 of this appendix. By default this option is selected. Display a warning if the column data types are modified when updating the table structure: Select this option if you want to be warned when the data type for a column stored in the project is different from the one read from the data warehouse. The check
for the data type change is only performed when updating a tables structure. By default this option is selected. Automatically update information for all Partition Mapping tables when reading the database catalog: Select this option to read the latest information for the partition mapping tables (PMTs) currently present in the project. This setting should be cleared when the number of PMTs in the project is so large that reading their structure is causing performance problems when opening the Warehouse Catalog. By default this option is selected. Column Merging Options: When you add a new table to your data warehouse, it may redefine the data type for a column included in the project. For example, your project includes a table named Table1 that has column C1 of data type char(1). Then a new table named Table2 is added to the project, but it has column C1 set to data type char(4). This example is used to illustrate the options described below. When you update the table structure, the column data types are modified to maintain a consistent schema in one of three ways, depending on the option you select. The options below do not handle the merge if the data type has changed to an incompatible data type. For example, a column is changed from data type char to data type integer. If the data type has changed to an incompatible data type, a warning is displayed and you are asked if you want to use the new data type. Use most recent data type: This option updates the column data type to use the most recent column definition. In the example above, the column data type for C1 would be changed to char(4) since Table2 was added after Table1. Use maximum denominator data type: This option updates the column data type to use the data type with the largest precision or scale. In the example above, the column data type for C1 would be changed to char(4), as defined in Table2. This is because char(4) has a higher precision than char(1) defined in Table1. If the data type has been
333
changed to a different compatible data type, the data type with the largest precision or scale is used, as illustrated in the image below.
Do not merge: This option renames the column in the newly added table, which allows the columns to have different data types. From the example above, column C1 uses the char(1) data type for Table1. Column C1 in Table2 is defined as a separate copy of C1 and uses the char(4) data type. This option can cause unwanted schema changes and should be used only when necessary. Read Mode: The Warehouse Catalog can be automatically read upon opening the Warehouse Catalog, or restricted to only be read when a read is manually requested: Automatic: This option sets the Warehouse Catalog tables to be read as soon as the catalog browser is loaded. Manual: This option sets the Warehouse Catalog tables to be read only when the read catalog action is selected.
335
Table Name Spaces: You can show or hide the name space for each table, using the check box: Display the name space for each table (if applicable): You can show or hide the owner or table name space where the table is located in the warehouse. By default, this option is selected and table name spaces are shown.
Table Logical Sizes: You can select whether the Warehouse Catalog calculates logical sizes for new tables using one of the following options: Calculate the logical table sizes automatically: Logical sizes are automatically calculated for tables you add to the project. Do not calculate table logical sizes: Logical sizes are not calculated for the tables you add to the project.
337
under the Catalog - Read Settings options subcategory. If you select this option, the Warehouse Catalog ignores the current table name space when it reads the catalog information. Thus, the Warehouse Catalog recognizes the two tables as the same table and saves the new table name space information. This setting allows you to migrate much more easily between warehouses. If the check box is cleared, the Warehouse Catalog defaults to identifying the table by both table name space and table name.
The two retrieval options use different catalog SQL, but both can be customized in the Warehouse Catalog Options dialog box. In the following sections, the name Catalog Table SQL refers to the catalog SQL to retrieve the tables in the warehouse; that is, the first SQL used in a two-pass catalog retrieval. The name Full Catalog SQL refers to the SQL used to read all the tables and columns in one pass. To customize a catalog SQL, you must understand several important concepts and procedures: The table name space, page 339 SQL placeholder strings and incomplete catalog SQL, page 340 Structure of Catalog Table SQL, page 340 Structure of Full Catalog SQL, page 341 Modifying catalog SQL, page 341 Default catalog SQL, page 343
339
Full Catalog SQL must return its rows ordered first by NAME_SPACE, if available, and then by TAB_NAME. The following example is the default Full Catalog SQL for Microsoft SQL Server 7.0: SELECT U.name NAME_SPACE, T.name TAB_NAME, C.name COL_NAME, C.type DATA_TYPE, C.length DATA_LEN, C.prec DATA_PREC, C.scale DATA_SCALE FROM sysobjects T, syscolumns C, sysusers WHERE T.id = C.id and T.type in ('U', 'V') AND T.uid = U.uid ORDER BY 1, 2
341
1 Access the Warehouse Catalog for your project (see Accessing the Warehouse Catalog, page 322). The Warehouse Catalog opens. 2 From the Tools menu, select Options. The Warehouse Catalog Options dialog box opens. 3 Expand the Catalog Category, and select Read Settings. The Catalog - Read Settings options are displayed. 4 Click the Settings button, the catalog SQL options are displayed as shown below. The catalog SQL settings are unavailable if your project is connected to a Microsoft Access database.
The top pane controls the Catalog Table SQL and the bottom pane controls the Full Catalog SQL.
1 Access the catalog SQL options for your project (see Modifying catalog SQL, page 341). A dialog box for the catalog SQL options is displayed. The top pane controls the Catalog Table SQL, which retrieves a list of available tables in the Warehouse Catalog. The bottom pane controls the Full Catalog SQL, which retrieves column information for the selected tables. Before performing the next step, cut and paste the SQL statements in the two panes into any text editor. This allows you to save any modifications you have made previously to the catalog SQL statements, and then compare them to the default statements you are about to generate. 2 Generate and view the default catalog SQL for your database platform. Any text in the panes is overwritten with the default catalog SQL statements: To generate and view the default Catalog Table SQL for your database platform, click the upper-most Use Default button. To generate and view the default Full Catalog SQL for your database platform, click the bottom-most Use Default button.
You can use the default catalog SQL statements or compare and combine them with your own customized catalog SQL statements.
343
Tables missing
This happens when one or more tables already in the project are removed from the data warehouse. Two cases can be seen: When the Warehouse Catalog is starting and retrieving the table information from the data warehouse and it detects that one or more tables already in the project are missing, it displays an error message which gives you the following options: Leave the Table in the project: This leaves everything as is in the project metadata. However the definition in the project may be inconsistent with the real physical structure in the warehouse. This can result in SQL errors when running reports that need data from a missing table. Remove the table from the project. In this case, the Warehouse Catalog does not check for any dependencies until you save the changes. If there are any dependencies, they are presented to you, and you have the option to proceed or cancel the operation. When the Warehouse Catalog tries to update the structure of a table that is missing in the warehouse, a message is shown which explains that the table structure update cannot proceed because the table was not found in the warehouse. In this case, no changes occur and the original table structure remains intact.
Columns missing
Missing columns are detected when Update Structure is performed. If this happens, the Warehouse Catalog checks for the following: Column is not mapped to any schema object: If this is the case, then no error message is shown. Column is mapped to a schema object: If this is the case, then a message is displayed that gives details on objects, which are mapped to the missing column and the update structure operation is canceled. You are asked to remove the mapping before continuing with the update structure and original table structure is restored.
345
For example, a sales manager wants to include forecast data available in a spreadsheet stored on a sales representatives local machine. By connecting to the spreadsheet as a relational data source, this forecast data can be viewed along with actual sales data from the centralized database. MultiSource Option also allows you to use Freeform SQL, Query Builder, and MDX cube reports, that access secondary data sources, as filters on standard reports. For information on Freeform SQL and Query Builder reports, see the Advanced Reporting Guide. For information on MDX cube reports, see the MDX Cube Reporting Guide. If you have a license for MultiSource Option, you can access multiple data sources in a project as described below: Connecting data sources to a project, page 346 Adding data into a project, page 348
Database instances have been created for the data sources to include in a project. A license for MultiSource Option is required to connect multiple data sources to a project.
1 In Desktop, log in to a project. 2 Right-click the project and select Project Configuration. The Project Configuration Editor opens. 3 From the Categories list, expand Database Instances, and then select SQL Data Warehouses. 4 In the Database Instance pane, select the check box next to the database instances for the data sources to include in a project. Selecting a check box for a database instance also makes its data source available for use with Query Builder and Freeform SQL. The availability of multiple data sources through Query Builder or Freeform SQL does not require a MultiSource Option license. However, only one data source can be used at a time in a Query Builder or Freeform SQL report. For information on Query Builder and Freeform SQL, see the Advanced Reporting Guide. 5 In the drop-down list near the top, select a database instance to act as the primary database instance. The primary database instance acts as the main source of data for a project and is used as the default database instance for tables added to the project. Non-database related VLDB property settings are also inherited from the primary database instance. 6 Click OK to save your changes and close the Project Configuration Editor. 7 If the data source you use with MultiSource Option supports parameterized queries, you can enable the use of parameterized queries to improve the performance of MultiSource Option. For information on enabling the use
347
of parameterized queries, see Improving database insert performance: parameterized queries, page 355. The data sources you included in the project can now be accessed from the Warehouse Catalog and Architect to import tables into the project, as described in Adding data into a project below.
In Architect, you can use the Warehouse Tables pane shown below to switch between the data sources you are importing tables for.
If the tables you import from various sources all use different table names, the tables are imported exactly as they are when only a single data source is used. You can also import tables with the same name from different data sources, and is described in Supporting duplicate tables in multiple data sources below.
349
For example, you have two data sources. One data source stores historical data for your company. The other data source stores forecast data for the same business sectors. Each data source includes duplicate copies of tables that store attribute information, which describe the context of data. The data sources differ in the availability of historical data versus forecast data, which is integrated into your MicroStrategy project through the use of facts and metrics. In this scenario, including each copy of the tables that include attribute information from both data sources allows some queries to be processed within a single data source. By including these duplicate copies, users that only need to view historical data can have their query resolved within a single data source. Similarly, users that only need to view forecast data can have their query resolved completely within the other data source. This reduces the time and system resources required for these types of queries since working within a single data source is more efficient than querying across multiple data sources. Including both historical and forecast data on the same report from these different data sources is also possible in this scenario through the use of MultiSource Option. However, since the historical and forecast data are only available in separate data sources, this query must include both data sources. To import multiple copies of the same table from different data sources into a project, the requirements listed below must be met: The table name and column names must be exactly the same. One of the copies of the table must act as the primary table used in the project. All of the columns in this table must also be present in the other copies of the table from other data sources. The other copies of the table that are used as secondary tables can include additional columns of information. However, these additional columns are not included in the project when the table is added. When you import multiple copies of a table from multiple data sources, import the table that is to act as the primary table first. Once you import the primary table, you can
begin importing secondary tables from the other data sources. If you do not import the primary table first, you may have to remove some tables and then add them back into the project after the primary table is imported. This workflow may be required to update existing projects that did not previously use MultiSource Option. The data types of matching columns must be compatible. Compatibility of column data types is described below: A Decimal data type with a scale of zero is compatible with the Integer data type. A Numeric data type with a scale of zero is compatible with the Integer data type. A Decimal data type is compatible with a Numeric data type. Double, Float, and Real data types are all compatible with each other. A Date data type is compatible with a Timestamp data type. A Time data type is compatible with a Timestamp data type. A Char data type is compatible with a VarChar data type. Any other data types are only compatible with an identical data type. Be aware that a Date data type is not compatible with a Time data type, and NVarChar and NChar data types are not compatible with VarChar and Char data types. The procedures below describe how to import multiple copies of the same table into MicroStrategy using the Warehouse Catalog or Architect: Importing tables from multiple data sources in a project using the Warehouse Catalog, page 352 Importing tables from multiple data sources in a project using Architect, page 353
351
Importing tables from multiple data sources in a project using the Warehouse Catalog
Prerequisites A license for MultiSource Option is required to connect multiple data sources to a project.
To import tables from multiple data sources in a project using the Warehouse Catalog
1 In Desktop, log in to a project. 2 From the Schema menu, select Warehouse Catalog. The Warehouse Catalog opens. 3 From the Select current database instance drop-down list, select the database instance for one of the data sources the table resides in. The first data source you use to import a table should be the one you plan to use as the primary data source for the table. 4 In the Tables available in the database pane, select the table to add to the project and click the > button. The first copy of the table is added to the project and is displayed in the Tables being Used in the Project pane.
To add copies of a table from other database instances
5 From the Select current database instance drop-down list, select the database instance for a different data source that also includes the table. 6 In the Tables available in the database pane, select the table to add to the project and click the > button. If all of the required conditions to import multiple copies of the table (listed in Supporting duplicate tables in multiple data sources, page 349) are met, a Warehouse Catalog Browser dialog box opens. To include a copy of the table in the project, select Indicate that TABLE_NAME is also available from the current DB instance, and click OK. The copy of the table is added to the project and is displayed in the Tables being Used in the Project pane.
352 Accessing multiple data sources in a project
2010 MicroStrategy, Inc.
Review any messages displayed when attempting to import a copy of a table from a different data source.
To add additional tables and configure the tables included in the project
7 To add tables from additional data sources, repeat the steps in To add copies of a table from other database instances above. 8 In the Tables being used in the project pane, right-click the table and select Table Database Instances. The Available Database Instances dialog box opens. 9 From the Primary Database Instance drop-down list, select a database instance for the data source that stores the primary table for the project. All of the columns in this primary table must also be present in the other copies of the table from other data sources. Any additional columns available in other copies of the table that are used as secondary tables are not included in the MicroStrategy project. 10 The Secondary Database Instances pane lists the other data sources that the table is available from for the project. You can clear the check box next to a data source to remove that copy of the table from the project. 11 Click OK. You are returned to the Warehouse Catalog. 12 Click Save and Close to save your changes and close the Warehouse Catalog.
353
1 In Desktop, log in to a project. 2 From the Schema menu, select Architect. MicroStrategy Architect opens. 3 From the Project Tables View, in the Warehouse Tables pane, expand the database instance for one of the data sources the table resides in. The first data source you use to import a table should be the one you plan to use as the primary data source for the table. 4 From the Warehouse Tables pane, right-click the table to add to the project and select Add Table to Project. The first copy of the table is added to the project and is displayed in the Project Tables View of Architect.
To add copies of a table from other database instances
5 From the Warehouse Tables pane, expand the database instance for a different data source that also includes the table. 6 From the Warehouse Tables pane, right-click the table to add to the project and select Add Table to Project. If all of the required conditions to import multiple copies of the table (listed in Supporting duplicate tables in multiple data sources, page 349) are met, an Options dialog box opens. To include a copy of the table in the project, select Indicate that TABLE_NAME is also available from the current DB instance, and click OK. The copy of the table is added to the project and is displayed in the Project Tables View of Architect. Review any messages displayed when attempting to import a copy of a table from a different data source.
To add additional tables and configure the tables included in the project
7 To add tables from additional data sources, repeat the steps in To add copies of a table from other database instances above. 8 From the Project Tables View, select the table. Information on the table is displayed in the Properties pane. 9 From the Properties pane, select the Primary DB Instance option, and then click ... (Browse). The Available Database Instances dialog box opens. 10 From the Primary Database Instance drop-down list, select a database instance for the data source that stores the primary table for the project. All of the columns in this primary table must also be present in the other copies of the table from other data sources. Any additional columns available in other copies of the table that are used as secondary tables are not included in the MicroStrategy project. 11 The Secondary Database Instances pane lists the other data sources that the table is available from for the project. You can clear the check box next to a data source to remove that copy of the table from the project. 12 Click OK. You are returned to Architect. 13 Click Save and Close to save your changes and close the Warehouse Catalog.
355
of information into a database. The scenarios that can benefit from the use of parameterized queries include: Reports that combine data from multiple data sources using MicroStrategy MultiSource Option. For information on MultiSource Option, see Accessing multiple data sources in a project, page 345. MicroStrategy data marts that are stored in a database other than the database used for the main data warehouse. For information on creating and using data marts, refer to the Advanced Reporting Guide. Metrics that use functions that are evaluated by the Analytical Engine. For information on functions, refer to the Functions Reference. Custom groups that use banding qualifications that are evaluated as normal calculations. For information on custom groups, refer to the Advanced Reporting Guide.
Parameterized queries are SQL queries that can use placeholders for data. Using placeholders allows these queries to be re-used. A common application of this re-usability is to combine multiple inserts of data into a database as a single query. The following is an example of a parameterized query: INSERT INTO DMTABLE (Customer_ID, Customer_Name) VALUES (?, ?) Combining multiple INSERT statements into a single query can improve the performance of inserting data into the database. The steps below show you how to enable the use of parameterized queries in MicroStrategy. Prerequisites Parameterized queries are only supported by certain databases. Refer to your third-party database documentation to ensure that your database can support parameterized queries. A database instance has been created. This database instance must connect to the database to enable support for parameterized queries.
1 In MicroStrategy Desktop, log in to a project source with a user account that has administrative privileges. 2 From the Folder List, expand Administration, then expand Configuration Managers, and then select Database Instances. Database instances for the project source are displayed. 3 Right-click a database instance and select Edit. The Database Instances Editor opens. 4 To the right of the Database connection area, click Modify. The Database Connections dialog box opens. 5 On the Advanced tab, select the Use parameterized queries check box. 6 If you are enabling parameterized queries for one of the databases listed below, you must also include the following parameters: To enable parameterized queries for Oracle 10g, Oracle 10gR2, Oracle 11g, Oracle 9i, Sybase Adaptive Server 12.x, or Sybase ASE 15.x, type the following parameter in the Additional connection string parameters field: EnableDescribeParam=1 To enable parameterized queries for Teradata 12.0 or Teradata V2R6.2, type the following parameter in the Additional connection string parameters field: EnableExtendedStmtInfo=Yes 7 Click OK to accept your changes and close the Database Connections dialog box. 8 Click OK to close the Database Instances Editor.
357
Aggregate tables are advantageous because they: Reduce input/output, CPU, RAM, and swapping requirements Eliminate the need to perform dynamic calculations Decrease the number of physical disk reads and the number of records that must be read to satisfy a query Minimize the amount of data that must be aggregated and sorted at run time Move time-intensive calculations with complicated logic or significant computations into a batch routine from dynamic SQL executed at report run time
In summary, the MicroStrategy SQL Engine, in combination with aggregate tables and caching, can produce results at about the same speed as MOLAP. This combined solution allows questions to be answered on the fly and is also scalable for large databases.
359
values from the fact table are selected, sorted, and added to produce the monthly totals, as shown below.
Aggregation can also be completed before reports are executed; the results of the aggregation are stored in an aggregate table. This process is called pre-aggregation. You can build these pre-aggregatedor aggregatetables as part of the ETL process. If sales data is frequently requested at the month level, as in the previous example, an aggregate table with the sales data rolled up to the month level is useful. Pre-aggregation eliminates the reading, sorting, and calculation of data from many database rows in a large,
If the daily sales fact table is the lowest-level fact table and contains atomic-level data, it is referred to as a base table. In these terms, an aggregate table is any fact table whose data is derived by aggregating data from an existing base table.
Degree of aggregation
While MOLAP can provide fast performance when it answers a question, it requires a completely aggregated schema to answer most questions. That is, every possible combination of aggregate associations must be generated when the multidimensional cube is built. This ensures that all possible questions can be answered. This scenario becomes very difficult to maintain as the number of attributes and the amount of data increase, and therefore is not very scalable.
361
In a ROLAP environment, the degree of aggregation can be as dense or as sparse as is appropriate for your users. A densely aggregated warehouse has a large number of aggregate tables while a sparsely aggregated warehouse has fewer. Sparse aggregation refers to the fact that a given project only requires as many aggregate fact tables as is useful to its users. ROLAP, therefore, provides much greater flexibility than MOLAP. Only the aggregate combinations that you determine are beneficial must be created. That is, if the aggregate table is useful in answering frequently-asked queries, its presence provides a response as fast as a MOLAP system can provide. However, if a certain aggregate combination is rarely or never used, the space in the RDBMS does not need to be consumed and the resources to build that table during the batch process do not need to be used. Not every attribute level or hierarchy intersection is suitable for pre-aggregation. Build aggregate tables only if they can benefit users, since the creation and maintenance of aggregate tables requires additional work by the database administrator. Also, do not waste database space for tables that will not be used. Consider the following factors when deciding whether to create aggregate tables: The frequency of queries at that levelDetermining the frequency of queries at a specific level, page 362 The relationship between the parent and childConsidering any related parent-child relationships, page 363 The compression ratioCompression ratio, page 364
However, usefulness is not always easy to quantify. For example, consider the following hierarchy:
A summary of data at the department level seems to be a good candidate for an aggregate table. However, if users frequently want to exclude inactive items, the query must use item-level data and summarize the department data dynamically. Therefore, the department aggregate tables would not be used in this situation. Once your warehouse is in production, trace the usage of any aggregate tables to determine how frequently they are used in a day-to-day business environment. If any table is not used, eliminate it from the warehouse. MicroStrategy Enterprise Manager allows you to easily track table usage. For more information on Enterprise Manager, see the MicroStrategy System Administration Guide.
Dynamic relationships
When the relationship between parent and child elements change, the relationship is called dynamic. These changes often occur because of organizational restructuring;
363
geographical realignment; or the addition, reclassification, or discontinuation of items or services. For example, a store can decide to reclassify the department to which items belong. Aggregate tables that contain dynamic relationships must be recalculated every time a change is made. If the tables are large, this process can take time, consume resources, and complicate the batch process. Frequent changes can mean aggregate tables are not optimal for this situation. Consider the frequency of the changes, the table size, and the impact on the batch process, and then balance the disadvantages against the advantages of having an aggregate table. Also, rolling up an entire hierarchy can avoid many problems with relationship changes. For example, a table contains one value for the sum of all stores. It is not affected by a reorganization within the geography hierarchy.
Static relationships
When elements rarely or never change relationships, they are a part of static relationships. In these cases, maintaining aggregate tables is very easy. For example, time hierarchies are seldom dynamicdays do not migrate into different weeks, and fiscal weeks do not move into different months.
Compression ratio
The process of data aggregation applies an aggregate function, such as sum or average, to a set of child records to produce a single parent record. The average number of child records combined to calculate one parent record is called the compression ratio. One measure of effectiveness of an aggregate table can be estimated from this number, since it represents the decrease in records that must be read to respond to a query at that level. Recall that some of the reasons to build aggregate tables include the reduction of disk I/O and the number of records that must be dynamically sorted and aggregated. Therefore, pre-aggregating data is effective only if the compression ratio is significant. For example, if the compression ratio is 3:2, the aggregate table requires 2/3 of the base tables storage space
364 Using summary tables to store data: Aggregate tables
2010 MicroStrategy, Inc.
but yields only a 1/3 reduction in the number of records. In contrast, if the compression ratio is 4:1, the aggregate table reduces the number of records by 3/4 and uses only 1/4 of the storage space. When the number of elements differs significantly between two attributes in the same hierarchy, the compression ratio suggests that an aggregate table can provide more efficient queries. Also, for smaller base tables, the resource demands placed on the database server by dynamic aggregations decrease and therefore so does the effectiveness of pre-aggregation. To determine when pre-aggregation is worthwhile for your system, you must balance the importance of speed of query response time and the availability of disk space and resources to maintain the schema. For more information on ratios, refer to Cardinalities and ratios, page 35.
1 Using the Warehouse Catalog, add the table to the project. For steps to add tables using the Warehouse Catalog, see Adding and removing tables for a project, page 322. 2 Use the new table in the desired fact expressions and attribute form expressions. If your aggregate table structure is consistent with your base fact table structure, Architect automatically adds it to the definitions of your existing attributes and facts. In other words, Architect is aggregate-aware. How does Architect know to use the aggregate table rather than the base fact table, when either could provide the answer to a query? The answer is logical table size.
365
improve query performance by minimizing the number of tables and records within a table that must be read to satisfy queries issued against the warehouse. By distributing usage across multiple tables, partitions improve the speed and efficiency of database queries. Time is the most common category for partitioning databases. Partitioning by time limits growth of the database tables and increases stability.
Server-level partitioning
The database server, rather than MicroStrategy, manages the partitioned tables in RDBMS server-level partitioning. The original fact table is not physically broken into smaller tables. Instead, the database server logically partitions the table according to parameters specified by the database administrator. You do not need to take any action in MicroStrategy to support the partitioning. Since only the logical table is displayed to the end user, the partitioning is transparent to MicroStrategy. In contrast, in application-level partitioning the relational database is unaware of the partitioned tables. Refer to your database documentation for details on server partitioning for your particular platform.
Application-level partitioning
In application-level partitioning the application, rather than the RDBMS server, manages the partition tables. A partition base table (PBT) is a warehouse table that contains one part
367
of a larger set of data. Partition tables are usually divided along logical lines, such as time or geography. MicroStrategy supports two types of partitioning: Metadata partition mapping, page 368stores the mapping information in the project metadata Warehouse partition mapping, page 370uses a specialized warehouse table to determine which table to access
therefore require additional long-term maintenance and organization because the data contained in them is stored at various levels throughout the partition. MicroStrategy stores one PBT level for each partition. If all the PBTs within a partition are not stored at the same level, the highest PBT level is used as the PBT level of the partition. For instance, if all the sales data in the previous example is stored in one partition, you cannot access current sales at the day level. This is because the PBT level for the partition is month, which is higher than day. If you save current data in a partition at the daily level and the historical data in another partition at the month level, you are able to fully access the data. In contrast, homogenous partitions must have the same amount of data stored at the same PBT level. The logical structure of the PBTs must be the same, that is, they must have the same facts and attributes defined. To continue with the previous examples, each table must store one year of data at the month level. Homogeneous partitions work well for frequently-accessed data such as information about the previous year. When you define the particular PBT to which an attribute is linked in MicroStrategy, you do not need to specify whether or not the PBT is homogeneous or heterogeneous. MicroStrategy makes the distinction automatically depending, in part, on how the data is stored in the PBT.
Data slices
After PBTs are created, you define a data slice. The data slice acts as a filter that describes what portions of data are placed in the partition table. Based on this data slice, the MicroStrategy engine knows which table to get data from when generating the SQL. A data slice holds the parameters that a partition is based upon, for example, Month=January. Instead of retrieving data for all months, the server knows to access a particular table that contains the data for January only. By creating a data slice with the partition, you can retrieve specific data quickly without time-consuming joins and searches.
369
It is important to create a reasonable and valid data slice because MicroStrategy cannot verify its accuracy or relevance. The data slice must make sense for the data. A poorly crafted data slice can lead to errors from generating incorrect SQL and retrieving the wrong data. Data slicing displays and can be modified only for the metadata partitioning. Each partition mapping table must include at least one data slice. In a heterogeneous mapping, data slices can exist at different levels and can be composed of different keys.
Attribute qualifications
To create data slices, you use attribute qualifications. Attribute qualifications are types of filters that are applied to attribute forms. These qualifications allow you to limit the type and amount of data that is returned for a report. For example, if you create a report that contains the attribute Country but you want to return only the data for France, you can create a qualification on the attribute Country and select France as the element that appears on the report. For steps to create a data slice, refer to the MicroStrategy Desktop online help.
partitioning table are shown below for months. Note how the data exists at equal levels, for example, different months of the same year.
The original fact table, which contains all of the data, is not brought into the project. Rather, the database administrator creates multiple smaller physical tables in the data warehouse. Each table contains a subset of the data in the original fact table. The database administrator is responsible for keeping the partitions consistent and up-to-date. He or she must also create and maintain a partition mapping table (PMT), which is used to identify and keep track of the partitioned base tables as part of a logical whole. After the PMT is created, when you run a report in Desktop or Web that requires information from one of the PBTs, the Query Engine first runs a pre-query to the PMT to determine which PBT to access to bring the data back for the report. The pre-query requests the PBT names associated with the attribute IDs from the filtering criteria. When it finds the name of the PBT, it calls the SQL Engine to write the appropriate SQL for the warehouse. When using warehouse partition mapping, it is usually not necessary to bring in the individual PBT tables into the project. Doing so can cause errors if such tables are mistakenly mapped directly to schema objects. You should only include the PMT table in the project. With this strategy you can map all related schema objects to
371
the PMT, which then accesses the correct PBT in the warehouse. Note the following: There are no data slices in a warehouse partition. MicroStrategy supports warehouse partitions on both upgraded and newly created projects. These are added using the Warehouse Catalog Browser. For steps to add warehouse partitions, refer to the MicroStrategy Desktop online help.
10
10.
Introduction
Suppose you want to compare how much revenue your company grew last year to how much it grew this year. This type of analysis, called a TY/LY comparison (This Year versus Last Year), is a commonly used form of time-series analysis and is relevant to many different industries, including retail, banking, and telecommunications. Transformationsschema objects you can create using attributes in your projectare one of the many MicroStrategy techniques used to perform time-series analysis. To calculate a variance or a growth percentage such as last years revenue versus this years revenue, it is very convenient to use a transformation. Transformations are often the most generic approach and can be reused and applied to other time-series analyses. To use a transformation, a report designer creates a metric and applies the transformation to it. Transformation-style analysis can also be supported using the Lag and Lead functions provided with MicroStrategy. These functions can be used to define metrics that compare
2010 MicroStrategy, Inc.
373
10
values from different time periods without the use of transformations. For information on using these functions to support transformation-style analysis, see the Functions Reference. This chapter discusses the different types of transformations and how to create them. It is assumed that you have some understanding of what metrics are, as transformation metrics are discussed in this chapter. For information on metrics and using transformations in metrics and reports, see the Metrics chapter of the MicroStrategy Advanced Reporting Guide.
Creating transformations
A transformation is a schema object that typically maps a specified time period to another time period, applying an offset value, such as current month minus one month. Usually defined by a project designer, transformations are used in the definition of a metric to alter the behavior of that metric. Such a metric is referred to as a transformation metric. For example, time-related transformations are commonly used in metrics to compare values at different times, such as this year versus last year or current date versus month-to-date. Any transformation can be included as part of the definition of a metric and multiple transformations can be applied to the same metric. Transformation metrics are beyond the scope of this guide; for information about transformation metrics, refer to the MicroStrategy Advanced Reporting Guide. Recall the example used in the introduction, the TY/LY comparison. To calculate this years revenue, you can use the Revenue metric in conjunction with a filter for this year. Similarly, to calculate last year's revenue, you can use the Revenue metric in conjunction with a filter for last year. However, a more flexible alternative is to use a previously created Last Year transformation in the definition of a new metric, last years revenue. With a single filter, on 2003 for example, the two metrics Revenue and Last Year Revenue give you results for 2003 and 2002, respectively.
10
Since a transformation represents a rule, it can describe the effect of that rule for different levels. For instance, the Last Year transformation intuitively describes how a specific year relates to the year before. It can in addition express how each month of a year corresponds to a month of the prior year. In the same way, the transformation can describe how each day of a year maps to a day of the year before. This information defines the transformation and abstracts all cases into a generic concept. That is, you can use a single metric with a last year transformation regardless of the time attribute contained on the report. While transformations are most often used for discovering and analyzing time-based trends in your data, not all transformations have to be time-based. An example of a non-time-based transformation is This Catalog/Last Catalog, which might use Catalog_ID-1 to perform the transformation.
Creating transformations
375
10
transformation or precalculating the data and storing it in a column in a table. A table-based transformation is required when a many-to-many transformation is performed. An example is a year-to-date calculation. A significant advantage to the dynamic calculation of an expression-based transformation is that the database administrator does not have to create and maintain a transformation table. The drawback is that the system must perform the calculation every time. A single transformation can use a combination of table-based and expression-based transformations. For example, you can create a last year transformation based on Year and Month. The ID of the Year attribute is in the format YYYY, so the transformation can use the expression Year_ID - 1. The ID for the Month attribute is in the format MonthName, so you cannot easily use a mathematical expression. You must use a table instead. The following sections walk you through creating both a table-based transformation and an expression-based one.
10
transformation is used in the report displayed below, which compares revenue for this year and last year.
Creating the transformation metric and the report are discussed in the Transformation metrics section in the Metrics chapter of the MicroStrategy Advanced Reporting Guide.
To create a last year transformation based on a table
1 Log in to the project source that contains your project in MicroStrategy Desktop and expand your project. 2 From the File menu, point to New, and select Transformation. The Transformation Editor opens with the Select a Member Attribute dialog box displayed. 3 Double-click Time to open the folder, then double-click Year. The Year - Define a new member attribute expression dialog box opens. 4 Select the LU_Year table from the Table drop-down list. The table's columns appear in the Available columns list. Notice that this table contains a previous year column, which maps this year to last year. 5 Double-click the PREV_YEAR_ID column to place it in the expression box. 6 Click OK.
Creating transformations
377
10
7 Click Save and Close on the toolbar. Name the transformation Last Year (Table). You have now created the transformation. A report designer can now use the transformation in a revenue metric to calculate last years revenue, then create a report using that transformation metric to obtain last years revenue.
Note the following: Creating the transformation metric and the report are discussed in the Transformation metrics section in the Metrics chapter of the MicroStrategy Advanced Reporting Guide. The performance of reports that use expression-based transformations can be improved in certain scenarios using the
10
Transformation Optimization VLDB property. For information on this VLDB property and how it can improve report performance, see the System Administration Guide.
To create a last year transformation based on an expression
1 In MicroStrategy Desktop, from the File menu, point to New, and select Transformation. The Transformation Editor opens with the Select a Member Attribute dialog box displayed. 2 Double-click Time to open the folder, then double-click Year. The Year - Define a new member attribute expression dialog box opens. 3 Select the LU_Year table from the Table drop-down list. The table's columns appear in the Available columns list. 4 Double-click the YEAR_ID column to place it in the expression box. 5 Type -1 in the expression box. The transformation will subtract 1 from the Year ID to calculate last years ID. 6 Click Validate. The message Valid expression appears with a green check mark. 7 Click OK. 8 Click Save and Close on the toolbar. Name the transformation Last Year (Expression). You have now created the last year transformation. A report designer can now use the transformation in a revenue metric to calculate last years revenue, then add it to the report created in the previous example.
Transformation components
All transformations have the following components:
Transformation components
379
10
Member attributes: This component contains the attributes to which the transformation applies, that is, the different levels to which the rule applies. For example, in the Last Year transformation in the MicroStrategy Tutorial, the member attributes are Year, Quarter, Month, and Day.
Member tables: These tables store the data for the member attributes. For an expression-based transformation, each member expression is based on a specific table, generally the lookup table corresponding to the attribute being transformed. For a table-based transformation, this is the transformation table defining the relationship. For example, in the Last Year transformation, the member tables are LU_YEAR, LU_QUARTER, LU_MONTH, and LU_DAY, for the member attributes Year, Quarter, Month, and Day, respectively.
Member expressions: Each member attribute has a corresponding expression. For an expression-based transformation, this is a mathematical expression. In the most generic case, this expression uses constants, arithmetic operators, mathematical functions, and columns from the warehouse, typically the attribute ID column. For example, you can create a Last Year transformation using Year_ID-1 as the expression. However, many cases can exist where the data is not conducive to such calculation. For instance, if you store Month as 200001 (January 2000), you cannot subtract one and receive December 1999 as the result. For a table-based transformation, this is simply a column from a specific warehouse table specifically populated with data supporting the transformation. The rule is then not encapsulated in an expression but directly in the data of the column. Since the data defines the rule, this approach provides considerable flexibility in the transformation definition. It is particularly effective when no straightforward formula
10
can express the rule. In fact, in the case of a many-to-many transformation, a separate table is required. For example, in the Last Year transformation, the member expressions are LY_DAY_DATE, LY_MONTH_ID, LY_QUARTER_ID, and PREV_YEAR_ID. These are all columns from the lookup tables set in the Member tables field. Mapping type: This component determines how the transformation is created based on the nature of the data. The mapping can be one of the following: One-to-one: A typical one-to-one relationship is last year to this year. One day or month this year maps exactly to one day or month from last year. Many-to-many: A typical many-to-many relationship is year-to-date. For one date, many other dates are included in the year-to-date calculation. Many-to-many transformations can lead to double-counting scenarios. For example, consider YearToDate defined as a many-to-many transformation and Revenue (YTD) as a transformation metric. Suppose this metric is used on a report that does not include the Day attribute, which is the member attribute on the template. In the report, a range of dates is specified in the filter. In this instance, the Revenue (YTD) metric will double count.
381
10
the transformation metric Last Years Revenue. Each quarter is displayed, with the previous years revenue, as shown below:
When a joint child attributean attribute that exists at the intersection of other indirectly related attributesis added, a conflict arises. For more information about joint child attributes, see Joint child relationships, page 272. For example, the joint child attribute Promotion is added to the previous report. The joint child attribute cannot be transformed because not all of its joint childrenQuarter and Itemare time-related. The report displays the quarter, the promotion associated with a given quarter, and the revenue data from the date-promotion combination, minus one year. A sample report is shown below:
The displayed attributes should still be current, displaying transformed data. However, since the joint child attribute Promotion essentially exists in both the time dimension and a non-time dimension, it is not intuitive how the transformation should be performed. Notice that the Valentines Day promotion existed in 2003 but not in 2002. While you may want to see it listed for 2002,
10
remember that only the metric values are transformed, not the attributes. That is, since the Valentines Day promotion was not run in 2002, the Valentines Day-Q1 2002 combination cannot be displayed on the report. In summary, the Valentines Day promotion is not listed for Q1 2002 despite the existence of the last year transformation. This is the case because, again, transformations transform metric values such as Revenue, but not attributes such as Promotion.
383
10
A
A.
MICROSTRATEGY TUTORIAL
Introduction
This appendix provides information on the MicroStrategy Tutorial, including the data model and physical warehouse schema.
385
MicroStrategy Tutorial
The theme of the MicroStrategy Tutorial project is a retail store for the time 2006 to 2008 that sells electronics, books, movies and music. The key features of the MicroStrategy Tutorial project include the following: Hierarchies, including Customer, Geography, Products, and Time. Each hierarchy can be viewed graphically through MicroStrategy Desktop and MicroStrategy Web. Numerous customers and purchased items. Reporting areas: Customer Analysis, Enterprise Performance Management, Human Resources Analysis, Inventory and Supply Chain Analysis, Sales and Profitability Analysis, and Supplier Analysis. Options to create reports from MicroStrategy Desktop and MicroStrategy Web focusing on a particular analysis area, such as Customer, Inventory, Time, Products, Category, Employee, or Call Center.
MicroStrategy Tutorial
Report Services document of this type is a visually intuitive display of data that summarizes key business indicators for a quick status check. Dashboards usually provide interactive features that let users change how they view the dashboards data. For information on creating and using dashboards, scorecards, and other Reporting Services documents, see the Report Services Document Creation Guide. Enterprise Reporting Documents: This folder contains examples of different types of standard enterprise reporting documents, such as scorecards and dashboards, managed metrics reports, production and operational reports, invoices and statements, and business reports. They are a sample of the types of reporting documents that can be built using MicroStrategy Report Services. MicroStrategy Platform Capabilities: This folder contains examples of many of the sophisticated capabilities within the MicroStrategy platform. Evaluators of the software, as well as customers, can use the examples to get a better feel for many of the platforms capabilities. Customers can use the examples to guide the development of there own MicroStrategy applications. The subfolders under these folders are named according to the capabilities that their reports exemplify. For instance, the Graph Styles folder contains examples of most of the graph types that can be created in MicroStrategy, and the MicroStrategy Data Mining Services folder contains examples of Linear Regression models and other data mining models built within MicroStrategy. Subject Areas: This folder contains reports that are categorized further by topic. Topics covered include Customer Analysis, Enterprise Performance Management, Human Resource Analysis, Inventory and Supply Chain Analysis, Sales and Profitability Analysis, and Supplier Analysis. Customer Analysis: Reports analyzing the customer base, studying areas such as Customer Income, Customer Counts, Revenue per Customer, and Revenue Growth. Enterprise Performance Management: Reports containing information on revenue amounts, trends
2010 MicroStrategy, Inc. What is the MicroStrategy Tutorial?
387
MicroStrategy Tutorial
and forecasts, profits, profit margins, and profit forecasts. These reports make it easy for an executive at any level of the company to understand how the company is performing as a whole or at the region, category, and subcategory levels. Human Resource Analysis: Reports containing information on employees, including headcount, birthdays, length of employment, and the top five employees by revenue. These reports are based on employees, time, geography, and sales. The Human Resources Analysis reports provide insight into human capital so that managers can boost the efficiency and effectiveness of their employees. Human Resource Representatives can highlight under-performing employees and misallocated headcount. Managers at all levels can focus on the performance of their employees, drill down to an individual employee detail level, view trends, and extract intelligence not otherwise evident. Inventory and Supply Chain Analysis: Reports containing information based on supplier, product, cost, revenue and profit, such as Inventory and Unit Sales, or Inventory Received from Suppliers by Quarter. The Inventory reports track inventory information within the company and through to suppliers. Essentially, these reports show how many units of an item are on hand, how many are expected from a particular supplier, and how many units have been sold. Inventory reports are used to ensure that the supply chain is as efficient as possible. Using these reports, employees can analyze trends and details, quickly adjust inventory and distribution, and understand underlying supply chain costs and inefficiencies. Sales and Profitability Analysis: Reports analyzing revenue and profit from multiple perspectives. Examples include Sales by Region, Revenue over Time, and Brand Performance by Region. The Product Sales reports allow managers and analysts to monitor and analyze sales trends, track corporate revenue goals, compare store-to-store performance, and respond more quickly and accurately to feedback from the marketplace. In turn, executives can analyze sales
MicroStrategy Tutorial
trends and details, quickly adjust pricing and promotions, identify product affinities and key profit centers, and understand costs and revenue trends. Supplier Analysis: Reports containing supplier, sales, profit, and revenue information, such as Brand Sales by Supplier, Supplier Sell-Through Percentage, and Units Sold and Profit by Supplier. The Supplier reports allow managers and analysts to monitor and analyze vendor performance so that they can quickly identify performance problems. These reports track brands and items sold that came from a particular vendor. They also correlate profit and revenue information with particular suppliers so that relationships with key vendors can be strengthened.
389
MicroStrategy Tutorial
attribute
one-to-many relationship
Geography hierarchy
The Geography hierarchy contains attributes such as Country and Region, as well as Distribution Center, Call Center, and employee-specific attributes. It is easy to understand why Country and Region are in the Geography hierarchy, but what about Distribution Center, Call Center, and the employee-related attributes? The data used in MicroStrategy Tutorial is based upon a fictitious company that sells electronics, movies, music, and books. The company does not have physical stores, but instead does its business from catalog and Web sales. Customers review the products in a printed or online catalog and call in their order over the phone. The order is then processed by an employee located at one of the call centers. The order is then fulfilled by a distribution center that holds the correct item and sends it through one of the shippers.
MicroStrategy Tutorial
The attributes listed in the table above are some of the most commonly used attributes that are included in the logical definition of the Geography hierarchy. Refer to the following
391
MicroStrategy Tutorial
image for a complete understanding of the logical relationships of all attributes for the Geography hierarchy.
Products hierarchy
The products hierarchy contains attributes such as Category, Brand, Catalog, and Supplier. The Products hierarchy contains the following attributes.
Attribute Brand Catalog Category Discontinued Code Description The manufacturer or artist for a particular product. The medium used to sell products. Products are organized into categories at the highest level. 0 = discontinued product, 1 = non-discontinued product. Example Ayn Rand, 3Com, Sony. Spring 2006, Fall 2007. Electronics, Music. 0, 1.
MicroStrategy Tutorial
Description The individual product sold. Used to further differentiate a subset of products within a category. The distributor for a set of brands. The time period in months during which a manufacturer repairs a broken item (specific to Narrowcast Server).
Example The Great Gatsby, Sony Discman. Business, Cameras, Drama. McGraw Hill, Disney Studios. 3, 5.
The attributes listed in the table above are some of the most commonly used attributes that are included in the logical definition of the Products hierarchy. Refer to the following image for a complete understanding of the logical relationships of all attributes for the Products hierarchy.
Customers hierarchy
The Customers hierarchy contains customer demographic and purchase information, such as Customer Age, Income Bracket, Payment Method, and Ship Date.
393
MicroStrategy Tutorial
The attributes listed in the table above are some of the most commonly used attributes that are included in the logical definition of the Products hierarchy. Refer to the following
MicroStrategy Tutorial
image for a complete understanding of the logical relationships of all attributes for the Products hierarchy.
Time hierarchy
The Time hierarchy contains time-specific attributes such as Year, Quarter, Month, and Day.
395
MicroStrategy Tutorial
Refer to the following image for a complete understanding of the logical relationships of all attributes for the Time hierarchy.
MicroStrategy Tutorial
1 If you are not already using the MicroStrategy Tutorial, log in to the project source containing the MicroStrategy Tutorial and expand the MicroStrategy Tutorial project. You must log in as a user with administrative privileges. 2 Right-click the MicroStrategy Tutorial project and select Architect. MicroStrategy Architect opens. 3 From the Hierarchy View, in the Hierarchies drop-down list, select System Hierarchy. The system hierarchy is displayed. A projects system hierarchy defines the relationships between all the attributes in a project. Attribute relationships determine how the engine generates SQL, how tables and columns are joined and used, and which tables are related to other tables. For information on defining attribute relationships using Architect, see Defining attribute relationships, page 167. 4 From the hierarchies drop-down list you can select a different hierarchy such as Customers, Geography, Products, and Time. These are user hierarchies that define browsing and drilling functionality between attributes. For information on creating user hierarchies using Architect, see Creating and modifying user hierarchies, page 176. 5 To save the layout display of a hierarchy, from the File menu, select Export Image. Type a name and select an image type to save the image as, and click Save.
397
MicroStrategy Tutorial
a lookup table A database table used to uniquely identify attribute elements. They typically consist of descriptions of dimensions. Lookup tables are usually joined to fact tables to group the numeric facts in the fact table by dimensional attributes in the lookup tables.
MicroStrategy Tutorial
Symbol REL_
Definition While lookup tables store information about one or more attributes, relationship tables store information about the relationship between two attributes. Relationship tables contain the ID columns of two or more attributes, thus defining associations between them. A database table used to store sales data (revenue, profit, cost, and so on) at different logical levels. These tables include a combination of attribute and fact definitions. For example, the YR_CATEGORY_SLS table includes the attributes Year and Category, along with facts such as Revenue, Cost, Profit, and so on. Storing these facts in this table makes their data available at the Year and Category level.
_SLS
Many tables include a combination of attributes and facts. Some of the basic facts from which metrics in the MicroStrategy Tutorial were created from are listed below.
Fact Description
Begin on hand The number of individual items available at the beginning of each month. Cost Discount End on hand Freight Profit Revenue Rush Charge Unit Cost Unit Price Unit Profit Units Received Units Sold The total amount charged by the supplier to the company. A monetary reduction made from a regular price. The number of individual items remaining at the close of each month. The compensation paid for the transportation of goods. The excess of the selling price of goods over their cost. The total income produced by a given source accounting for all product sales deducting discounts. The amount of money charged to expedite delivery service. The amount of money charged by the supplier to the company per individual item purchased. The amount of money charged by the company to the customer per individual item sold. Unit price - unit cost. The number of individual items acquired from a supplier. The number of individual items bought by customers.
The steps below show you how to explore the MicroStrategy Tutorial schema using Architect.
399
MicroStrategy Tutorial
1 If you are not already using the MicroStrategy Tutorial, log in to the project source containing the MicroStrategy Tutorial and expand the MicroStrategy Tutorial project. You must log in as a user with administrative privileges. 2 Right-click the MicroStrategy Tutorial project and select Architect. MicroStrategy Architect opens. 3 Select the Project Tables View. All the tables included in the MicroStrategy Tutorial project are displayed. 4 To view the physical columns for each table: a From the Options menu, select Settings. The MicroStrategy Architect Settings dialog box opens. b On the Display settings tab, select Display table physical view. c Click OK to return to Architect. Tables are displayed to show the columns within each table, including the column name and data type. 5 To view the physical columns for each table, along with the MicroStrategy schema object they define: a From the Options menu, select Settings. The MicroStrategy Architect Settings dialog box opens. b On the Display settings tab, select Display table logical view. c Click Advanced Options.
d Select all the check boxes for the Display table logical view option. For a description of each option, see Displaying columns and attribute forms in tables, page 107. e Click OK.
MicroStrategy Tutorial
Click OK to return to Architect. Tables are displayed to show the schema objects and the columns used to define the schema objects.
6 To view attribute relationships in the Project Tables View, from the View menu, select Show relationships. 7 From the Properties pane, you can use the Attribute, Facts, and Tables tabs to browse the various tables and schema objects for the Tutorial project. 8 To organize tables for further insight into the Tutorial project, you can create layers. For information on creating layers using Architect, see Organizing project tables: Layers, page 132. 9 To save the layout display of the Tutorial project schema, from the File menu, select Export Image. Type a name and select an image type to save the image as, and click Save.
401
MicroStrategy Tutorial
B
B.
LOGICAL TABLES
Introduction
Logical tables represent tables in the data warehouse. There are three types of logical tables in the MicroStrategy environment: logical tables, table aliases, and logical views. While logical tables are set up in a project by using the Warehouse Catalog, logical views are created using the Table Editor. Different from the logical tables, which point to physical tables in the data warehouse, logical views are defined using SQL queries against the data warehouse. This chapter introduces you to the different types of logical tables, with a focus on how you can use the logical view feature to take advantage of the enhanced schema support in MicroStrategy.
Logical tables
Logical tables are MicroStrategy objects that form the foundation of a schema. While physical tables in a data
2010 MicroStrategy, Inc. Logical tables
403
Logical Tables
warehouse consist of columns, logical tables in the MicroStrategy schema consist of attributes and facts. These attributes and facts are part of the report definition that the MicroStrategy Engine refers to when a report is executed. There are three types of logical tables: 1 Logical table: is a logical representation of a table that the Engine uses to generate SQL. A logical table is created for each physical table that is imported into a project, using the Warehouse Catalog. This type of logical table maps directly to physical tables in the data warehouse. These physical tables are referenced in the SQL that is generated for the report. 2 Table alias: is an additional logical table that points directly to an existing physical table. A table alias is created outside of the Warehouse Catalog. A table alias can have a different name from the physical table. One physical table can have more than one table aliases. Table aliasing is used to create attribute roles (see Attributes that use the same lookup table: Attribute roles, page 275). 3 Logical view: is a logical table that points to a SQL statement instead of directly to a physical table. It does not point directly to a physical table and is defined using a SQL query against the warehouse. Once created, the logical view can be used in the same way as the Type 1 logical table, based on which attributes, facts, and other schema objects can be defined. The logical view is also referenced in the SQL that is generated for the report; the whole SQL query is displayed in the place of physical tables as for Type 1 logical tables. Logical views are created using the Table Editor. If your project supports data internationalization, you cannot use logical views as lookup tables for attributes that use translated data. For information on supporting data internationalization, see Supporting data internationalization, page 61. In the MicroStrategy Tutorial, logical tables and all the other schema objects are stored in the Schema Objects folder. Using the Logical Table Editor, you can define your logical
Logical Tables
view using the SQL statement as well as view the content of all the logical tables and their associated warehouse tables.
405
Logical Tables
Logical views are created from scratch, instead of being imported from a data warehouse or duplicated from existing logical tables.
However, once logical views are created, they can be used in the same way as the regular logical tables (brought into the project using the Warehouse Catalog). This means that you can use the logical views to build attributes and facts and that you can also create table aliases for the logical views. The biggest benefit of using logical views is that you can model a MicroStrategy schema that cannot be supported with only the physical database structures in the warehouse. There are many common modeling scenarios that are easier to manage with the use of logical views, such as the following: Slowly-changing dimensions Attribute form expressions from multiple tables Consolidated dimension tables Recursive hierarchies
For common usage examples, please refer to Logical view examples, page 410. Whenever you create or add logical tables, table aliases, or logical views to the project, you need to update the schema. The Update Schema option can be accessed from the Schema menu.
Logical Tables
As illustrated in the following image, Object Browser lists all tables and columns that have been imported into the project. Any physical table in the project database instance can be used in the SELECT statement. The SQL statement panel is where you type in your SQL query, while the Mapping panel is where you map for the columns returned by the SQL query.
Creating a Logical View involves a few simple steps that require you to provide your own SQL statement and map the columns in the statement to the correct data types (see the following information). For detailed instructions, please refer to the online help (search for Creating logical views).
To create a logical table in the Table Editor
1 From the File menu, select New and then Logical Table. The Table Editor is displayed with the Physical View tab selected by default.
407
Logical Tables
2 In the SQL Statement panel, type your SQL statement. You can drag and drop columns from the Object Browser to insert into the statement. It is recommended that you use derived tables to define logical views because the logical view SQL syntax becomes nested inside SQL statements generated by the Engine. Although common table expressions (CTEs) are also supported for some databases, these expressions cannot be nested in the SQL because this would result in invalid SQL syntax. Please check your database for best usage. 3 Click Add to map columns returned by the SQL statement. 4 Type in the column name under Column Object. This creates a new column. Alternatively, you can also drag and drop columns from the Object Browser to the Column Object cell. By doing this, you map an existing column to the logical view. The names of the columns must match exactly the column aliases defined in the SQL statement. However, the order of the columns does not have to match the order in which the column aliases appear in the SQL statement. 5 Select a Data Type for the column by using the drop-down list. If you used an existing column in the mapping in Step 5, you inherited the data type of that column. Keep in mind that if you change the data type, the change will affect all the tables with that column. 6 Modify the Precision and Scale of the column, if applicable. 7 Save and close the logical table. 8 From the Schema menu, select Update Schema to ensure that the new logical table is loaded into the project.
Logical Tables
409
Logical Tables
The following is an example lookup table for Store, Market, and Region. Lookup_store
Store_ID Store_Name Market_ID Market_Name Region_ID Region_Name Level
In this table, Market and Region are not the keys. Therefore, if the requested fact table is at the Market or Region level, a direct join between the fact table and the above lookup table may result in double-counting. To avoid that, you can use the Logical View feature to define another logical table Lookup_Market as follows:
410 Logical view examples
2010 MicroStrategy, Inc.
Logical Tables
Select Market_ID, Market_Name,Region_ID From Lookup_store Where level=1 Then use this table as the lookup table for Market. When it is joined with a Market-level fact table (Market_Sales), the following report SQL is generated: Select a11.Market_ID,a11.Market_Desc, SUM(a12.Sales) From (select Market_ID, Market_Name,Region_ID from Lookup_Store where level=1) a11, Market_Sales a12 Where a11.Market_ID = a12.Market_ID Group by a11.Market_ID, a11.Market_Name
F_Table2
Order_Date Order_ID Fact2
411
Logical Tables
Using the Logical View feature, you can use the following SQL query to create a logical table to calculate the Date difference and then define the attribute on that new column: Select Ship_Date-Order_Date Cycle_time, F_table1.Order_ID, Fact1,Fact2 From F_table1, F_table2 Where F_table1.Order_ID=F_table2.Order_ID The new logical table (logical view) looks like the following table, and a new attribute can be defined on the Cycle_Time column. Logical view
Cycle_Time Order_ID Fact1 Fact2
Logical Tables
The techniques described here provide the flexibility to perform either type of analysis. They also provide you an easy way to specify which type of analysis you would like to perform.
413
Logical Tables
Sales_Rep_ID 3 4 1 3
District_ID 38 38 39 39
When using this type of dimensional lookup table, the fact table must include a date field, such as a transaction date. FACT_TABLE
Sales_Rep_ID 1 2 3 1 2 3 2 3 4 Trans_Dt 9/1/2003 9/10/2003 9/15/2003 3/1/2004 3/10/2004 3/15/2004 9/5/2004 9/15/2004 9/20/2004 Sales 100 200 150 200 250 300 125 275 150
1 Create a logical view to represent just the current District-Sales Rep relationships. LVW_CURRENT_ORG select Sales_Rep_ID, District_ID from LU_SALES_REP where End_Dt = '12/31/2099'
Logical Tables
2 Create another logical view that performs the as-was join between the lookup table and fact table, resulting in a fact view at the District level. The resulting view is an as-was or historical view, which captures the Sales Rep-District relationships that existed at the time the transactions occurred. LVW_HIST_DISTRICT_SALES select District_ID, Trans_Dt, sum(sales) sales from LU_SALES_REP L join FACT_TABLE F on(L.Sales_Rep_ID = F.Sales_Rep_ID) where F.Trans_Dt between L.Eff_Dt and L.End_Dt group by District_ID, Trans_Dt 3 Create a table alias LU_CURRENT_DISTRICT for LU_DISTRICT. 4 Define the following attributes: Sales Rep: @ID = sales_rep_id; @Desc = sales_rep_name Tables: LU_SALES_REP (lookup), LVW_CURRENT_ORG, FACT_TABLE Current District: @ID = district_id; @Desc = district_name Tables: LU_CURRENT_DISTRICT (lookup), LVW_CURRENT_ORG Child: Sales Rep Historical District: @ID = district_id; @Desc = district_name Tables: LU_DISTRICT (lookup), LU_SALES_REP, LVW_HIST_DISTRICT_SALES Child: Sales Rep
2010 MicroStrategy, Inc.
Date:
Logical view examples
415
Logical Tables
@ID = date_id, trans_dt Tables: LU_TIME (lookup) , FACT_TABLE, LVW_HIST_DISTRICT_SALES Month: @ID = MONTH_ID Tables: LU_TIME (lookup) 5 Define the Sales fact: Expression: sales Tables: FACT_TABLE, LVW_HIST_DISTRICT_SALES
The result of this is a logical schema that looks like the following:
LU_CURRENT_DISTRICT LU_CURRENT_ORG LU_SALES_REP FACT_TABLE
Current District
Date
LVW_HISTORICAL_ DISTRICT_SALES
Month
As-was analysis
Specify the as-was analysis by using the Historical District attribute on reports: Report definition: Historical District, Month, Sales
Logical Tables
Resulting SQL
Select a11.District_ID District_ID, max(a13.District_Name) District_Name, a12.Month_ID Month_ID, sum(a11.SALES) WJXBFS1 From (select District_ID, Trans_dt,sum(sales) sales from LU_SALES_REP L join FACT_TABLE F on (L.Sales_rep_ID = F.Sales_rep_ID) where F.trans_dt between L.EFF_DT and L.END_DT group by District_ID, Trans_dt) a11 join LU_TIME a12 on (a11.Trans_dt = a12.Date_ID) join LU_DISTRICT a13 on (a11.District_ID =a13.District_ID) group by a11.Distrcit_ID, a12.Month_ID Report results
As-is analysis
Specify the as-is analysis by using the Current District attribute on reports: Report definition: Current District, Month, Sales Resulting SQL
select a12.District_ID District_ID, max (a14.District_Name) District_Name, a13.Month_ID Month_ID, sum(a11.SALES) WJXBFS1 from FACT_TABLE a11
417
Logical Tables
join (select Sales_rep_ID, District_ID from LU_SALES_REP where END_DT = '12/31/2099')a12 on (a11.Sales_Rep_ID = a12.Sales_Rep_ID) join LU_TIME a13 on (a11.Trans_dt = a13.Date_ID) join LU_DISTRICT a14 on (a12.District_ID = a14.District_ID) group by a12.District_ID, a13.Month_ID Report result
Logical Tables
When using this type of dimensional lookup table, the fact table must also include the surrogate key. A transaction date field may or may not exist. FACT_TABLE
Sale-Rep_CD 1 2 3 5 2 3 2 6 4 Sale 100 200 150 200 250 300 125 275 150
419
Logical Tables
Tables: LU_SALES_REP (lookup), LVW_CURRENT_ORG Child: Sales Rep Surrogate Current District: @ID = district_id; @Desc = district_name Tables: LU_CURRENT_DISTRICT (lookup), LVW_CURRENT_ORG Child: Sales Rep Historical District: @ID = district_id; @Desc = district_name Tables: LU_DISTRICT (lookup), LU_SALES_REP Child: Sales Rep Date: @ID = date_id, trans_dt Tables: LU_TIME (lookup), FACT_TABLE Month: @ID = MONTH_ID Tables: LU_TIME (lookup) Child: Date 4 Define the Sales fact: Expression: sales Tables: FACT_TABLE, LVW_HIST_DISTRICT_SALES
Logical Tables
Current District
Date Month
LVW_HISTORICAL_ DISTRICT_SALES
Historical District
As-was analysis
Specify the as-was analysis by using the Historical District attribute on reports: Report definition: Historical District, Month, Sales Resulting SQL
select a12.District_ID District_ID, max(a14.Distrcit_Name) Distrcit_Name, a13.Month_ID Month_ID, sum(a11.SALES) WJXBFS1 from FACT_TABLE a11 join LU_SALES_REP a12 on (a11.Sales_Rep_CD = a12.Sales_Rep_CD) join LU_TIME a13 on (a11.Trans_dt = a13.Date_ID) join LU_DISTRICT a14 on (a12.District_ID = a14.District_ID) group by a12.District_ID, a13.Month_ID
421
Logical Tables
Report results
As-is analysis
Specify the as-is analysis by using the Current District attribute on reports: Report definition: Current District, Month, Sales Resulting SQL:
select a13.District_ID District_ID, max(a15.Distrcit_Name) District_Name, a14.Month_ID Month_ID, sum(a11.SALES) WJXBFS1 from FACT_TABLE a11 join LU_SALES_REP a12 on (a11.Sales_Rep_CD = a12.Sales_Rep_CD) join (select Sales_rep_ID, District_ID from LU_SALES_REP where current_flag = 1) a13 on (a12.Sales_Rep_ID = a13.Sales_Rep_ID) join LU_TIME a14 on (a11.Trans_dt = a14.Date_ID) join LU_DISTRICT a15 on (a13.District_ID = a15.District_ID) group by a13.District_ID, a14.Month_ID
Logical Tables
Report result
423
Logical Tables
Given this structure, you could model an attribute hierarchy as follows: Business Unit -< Department -< Employee Hire Date -< Employee Emergency Contact -< Employee
In addition, the relationship between Employees and Emergency Contacts is such that each employee may have up to one contact, which means not all employees have contacts on record. One of the reports you probably would like to create may look like the following:
Employee Gonzalez, James Dawson, John Larkins, Abraham Walker, George ... Department Marketing Finance R&D Finance ... Dawson, Jane Taylor, Mary Walker, Martha ... 555-1212 555-3456 555-9876 ... Emergency Contact Phone Number
NULLS are displayed for employees who do not have emergency contacts.
Logical Tables
However, if you model the attributes as described below, you would not get the desired output: Employee: @ID = EMP_ID, @[First Name] = FIRST_NAME, @[Last Name] = LAST_NAME Tables: EMPLOYEE (lookup), EMERGENCY_CONTACT Department: @ID = DEPT_ID Tables: DEPARTMENT (lookup), EMPLOYEE Child: Employee Hire Date: @ID = HIRE_DATE Tables: EMPLOYEE (lookup) Child: Employee Emergency Contact: @ID = CONTACT_PHONE_NUMBER, @[First Name] = CONTACT_FIRST_NAME, @[Last Name] = CONTACT_LAST_NAME Tables: EMERGENCY_CONTACT (lookup) Child: Employee Using the above model, the SQL generated would join the EMPLOYEE table to the EMERGENCY_CONTACT table, and only those employees who have emergency contacts would appear in the final result. In order to see all employees, you can perform an outer join using a logical view, described as follows.
425
Logical Tables
Make sure to include all columns from the original child table (for example, EMPLOYEE). The new logical table LVW_EMERGENCY_CONTACT can then be used to define attributes as follows: Employee: @ID = EMP_ID, @[First Name] = FIRST_NAME, @[Last Name] = LAST_NAME Tables: EMPLOYEE (lookup), LVW_EMERGENCY_CONTACT
Logical Tables
Department: @ID = DEPT_ID Tables: DEPARTMENT (lookup), EMPLOYEE, LVW_EMERGENCY_CONTACT Child: Employee
Hire Date: @ID = HIRE_DATE Tables: EMPLOYEE (lookup), LVW_EMERGENCY_CONTACT Child: Employee
Emergency Contact: @ID = CONTACT_PHONE_NUMBER, @[First Name] = CONTACT_FIRST_NAME, @[Last Name] = CONTACT_LAST_NAME Tables: EMERGENCY_CONTACT (lookup), LVW_EMERGENCY_CONTACT Child: Employee The Employee attribute is not represented in the original EMERGENCY_CONTACT table and all attributes represented in the EMPLOYEE table are also represented in the LVW_EMERGENCY_CONTACT table.
Now if we run a report with Employee and Emergency Contact attributes, the EMPLOYEE table will be outer joined to the EMERGENCY_CONTACT table, and NULLs will be returned for any employees who do not have emergency contacts. Also note that if we run a report that includes only the Employee attribute, it will be executed against the EMPLOYEE table; the EMERGENCY_CONTACT table will be joined only when necessary. This technique is applicable any time that the lookup tables should always be outer joined. The technique does not work when the lookup tables should sometimes be outer joined and sometimes be inner joined.
427
Logical Tables
C
C.
DATA TYPES
Introduction
To generate SQL or retrieve data from data sources, MicroStrategy must be aware of the data types that exist in your database. As each RDBMS supports a different set of data types, MicroStrategy generalizes them into a set of MicroStrategy-specific data types.
429
Data Types
This database data type to MicroStrategy data type mapping is necessary, in part, because each database names data types in different ways. Data types that may be conceptually the same can have different names. Therefore, MicroStrategy must map every column brought into the project schema to an internal data type. Suppose you add a table to the Warehouse Catalog. In your relational database, a column within that table has a data type of SMALLINT. MicroStrategy maps this column to a MicroStrategy-specific data type, for example, INTEGER. This allows MicroStrategy to maintain a consistent SQL generation process. The MicroStrategy data type stores data values internally and in the metadata repository and is later used during SQL generation when defining intermediate tables, and data mart tables, and generating the correct syntax for literals. The data type is also used whenever multi-pass SQL is used, as with custom groups. For more information about data marts and custom groups, see the MicroStrategy Advanced Reporting Guide. The table below lists the supported data types for supported databases as well as the MicroStrategy data type that is used to define the data in MicroStrategy. For information on MicroStrategy data types, see MicroStrategy data types, page 449.The databases that are listed in this table include: Access, page 432 Composite, page 433 DB2, page 434 Generic, page 435 HP Neoview, page 436 Informix, page 437 MetaMatrix, page 438 MySQL, page 439 Netezza, page 440 Oracle, page 441
Data Types
PostgreSQL, page 442 Red Brick, page 443 SQL Server, page 444 Sybase, page 445 Sybase IQ, page 446 Tandem, page 447 Teradata, page 448
Data Types
Database Access
Supported database data types BINARY BOOLEAN BYTE CURRENCY DATE DATETIME DOUBLE FLOAT INT INTEGER INTEGER2 INTEGER4 LONG LONG BINARY LONGTEXT MEMO NUMBER NUMERIC REAL SHORT SINGLE SMALLINT TEXT TIME TIMESTAMP
MicroStrategy data type Binary Integer Integer Numeric Timestamp Timestamp Double Double Integer Integer Integer Integer Integer LongVarBin LongVarChar LongVarChar Double Double Real Integer Real Integer Char Time Timestamp
Data Types
Database Composite
Supported database data types BIT BIT VARYING CHAR CHAR VARYING (added from DTMAPPING.PDS) CHARACTER (added from DTMAPPING.PDS) CHARACTER VARYING (added from DTMAPPING.PDS) DATE DECIMAL DOUBLE PRECISION (added from DTMAPPING.PDS) FLOAT INT (added from DTMAPPING.PDS) INTEGER NUMERIC REAL SMALLINT (added from DTMAPPING.PDS) TIME TIMESTAMP VARBIT (added from DTMAPPING.PDS) VARCHAR
MicroStrategy data type Binary VarBin Char VarChar Char VarChar Date Decimal Float Float Integer Integer Numeric Real Integer Time Timestamp VarBin VarChar
Data Types
Database DB2
Supported database data types BIGINT BLOB CHAR CHARACTER CLOB DATE DEC DECIMAL DOUBLE DOUBLE PRECISION FLOAT GRAPHIC INT INTEGER LABEL LONG LONG VARCHAR LONGVAR NUM NUMERIC RAW REAL SMALLINT TIME TIMESTAMP TIMESTMP VARCHAR VARGRAPHIC
MicroStrategy data type Big Decimal LongVarBin Char Char LongVarChar Date Numeric Numeric Double Double Double NChar Integer Integer VarChar VarChar VarChar VarChar Numeric Numeric VarBin Real Integer Time Timestamp Timestamp VarChar NVarChar
Data Types
Database Generic
Supported database data types BIT BIT VARYING CHAR CHAR VARYING CHARACTER CHARACTER VARYING DATE DECIMAL DOUBLE PRECISION FLOAT INT INTEGER NUMERIC REAL SMALLINT VARBIT VARCHAR
MicroStrategy data type Binary VarBin Char VarChar Char VarChar Date Decimal Float Float Integer Integer Numeric Real Integer VarBin VarChar
Data Types
Database HP Neoview
Supported database data types BIGINT (added from DTMAPPING.PDS) BINARY (added from DTMAPPING.PDS) BIT BIT VARYING CHAR DATE DECIMAL (added from DTMAPPING.PDS) DOUBLE (added from DTMAPPING.PDS) FLOAT INTEGER LONGVARCHAR (added from DTMAPPING.PDS) NCHAR NCHAR VARYING NLONGVARCHAR (added from DTMAPPING.PDS) NUMERIC REAL SMALLINT (added from DTMAPPING.PDS) TIME TIMESTAMP TINYINT (added from DTMAPPING.PDS) VARBINARY (added from DTMAPPING.PDS) LONGVARBINARY (added from DTMAPPING.PDS) VARCHAR
MicroStrategy data type Big Decimal Binary Integer ??? not in DTMAPPING.PDS Char Date Decimal Double Float Integer LongVarChar NChar NVarChar LongVarChar Numeric Real Integer Time Timestamp Integer LongVarBin LongVarBin VarChar
Data Types
Database Informix
Supported database data types BOOLEAN BYTE CHAR CHARACTER DATE DATETIME DATETIME HOUR TO SECOND (not in DTMAPPING.PDS) DATETIME YEAR TO SECOND (not in DTMAPPING.PDS) DEC DECIMAL DOUBLE PRECISION FLOAT INT INT8 (Changed from DTMAPPING.PDS) INTEGER LVARCHAR MONEY NCHAR NUMERIC NVARCHAR REAL SERIAL SERIAL8 SMALLFLOAT SMALLINT TEXT VARCHAR
MicroStrategy data type Char LongVarBin Char Char Date Timestamp Timestamp Timestamp Decimal Decimal Double Double Integer Big Decimal Integer LongVarChar Numeric NChar Decimal NVarChar Real Integer Integer Real Integer LongVarChar VarChar
Data Types
Database MetaMatrix
Supported database data types BIGDECIMAL BIGINTEGER BLOB BOOLEAN BYTE CHAR CLOB DATE DOUBLE (added from DTMAPPING.PDS) FLOAT INTEGER LONG SHORT STRING TIME TIMESTAMP
MicroStrategy data type Numeric Integer VarBin Binary Integer Char VarChar Date Double Float Integer Integer Integer VarChar Time Timestamp
Data Types
Database MySQL
Supported database data types BIGINT BINARY BIT BLOB CHAR DATE DATETIME DECIMAL DOUBLE ENUM FLOAT INT LONGBLOB LONGTEXT MEDIUMBLOB MEDIUMINT MEDIUMTEXT NCHAR NVARCHAR SET SMALLINT TEXT TIME TIMESTAMP TINYBLOB TINYINT TINYTEXT VARBINARY VARCHAR YEAR
MicroStrategy data type Integer Binary Unsigned LongVarBin Char Date Timestamp Decimal Double Char Float Integer LongVarBin LongVarChar LongVarBin Integer LongVarChar NChar NVarChar Char Integer LongVarChar Time Timestamp LongVarBin Integer LongVarChar VarBin VarChar Integer
Data Types
Database Netezza
Supported database data types BIGINT BIT BIT VARYING BYTEINT CHAR CHAR VARYING CHARACTER CHARACTER VARYING DATE DATETIME DEC DECIMAL DOUBLE DOUBLE PRECISION FLOAT FLOAT4 FLOAT8 INT INT1 INT2 INT4 INT8 INTEGER NCHAR NUMERIC NVARCHAR REAL SMALLINT TIME TIMESTAMP VARCHAR
MicroStrategy data type Big Decimal Binary VarBin Integer Char VarChar Char VarChar Date Timestamp Numeric Numeric Float Float Float Float Float Integer Integer Integer Integer Big Decimal Integer NChar Numeric NVarChar Real Integer Time TimeStamp VarChar
Data Types
Database Oracle
Supported database data types BLOB CHAR CLOB DATE DECIMAL FLOAT INTEGER LONG LONG RAW LONG VARCHAR NCHAR NUMBER NVARCHAR RAW REAL SMALLINT TIMESTAMP(6) VARCHAR VARCHAR2
MicroStrategy data type LongVarBin Char LongVarChar Timestamp Numeric Float Numeric LongVarChar LongVarBin LongVarChar NChar Numeric NVarChar VarBin Float Numeric Timestamp VarChar VarChar
Data Types
Database PostgreSQL
Supported database data types BOOL BIT CHAR DATE DECIMAL FLOAT4 FLOAT8 INT2 INT4 INT8 NUMERIC TEXT TIME TIMESTAMP VARBIT VARCHAR
MicroStrategy data type Integer Binary Char Date Decimal Real Double Integer Integer Integer Decimal LongVarChar Time Timestamp VarBin VarChar
Data Types
Supported database data types CHAR CHAR VARYING CHARACTER CHARACTER VARYING DATE DEC DECIMAL DOUBLE DOUBLE PRECISION FLOAT INT INTEGER NUM NUMERIC REAL SERIAL SMALLINT TIME TIMESTAMP TINYINT VARCHAR
MicroStrategy data type Char VarChar Char VarChar Date Numeric Numeric Double Double Double Integer Integer Numeric Numeric Real Integer Integer Time Timestamp Integer VarChar
Data Types
Supported database data types BIGINT BINARY BIT CHAR CHARACTER DATETIME DEC DECIMAL DOUBLE DOUBLE PRECISION FLOAT IMAGE INT INTEGER MONEY NCHAR NUMERIC NVARCHAR REAL SMALLDATETIME SMALLINT SMALLMONEY TEXT TIMESTAMP TINYINT VARBINARY VARCHAR
MicroStrategy data type Numeric VarBin Binary VarChar VarChar Timestamp Numeric Numeric Float Float Float LongVarBin Integer Integer Numeric NChar Numeric NVarChar Float Timestamp Integer Numeric LongVarChar VarBin Unsigned VarBin VarChar
Data Types
Database Sybase
Supported database data types BINARY BIT CHAR DATETIME DECIMAL FLOAT IMAGE INT INTEGER LONG VARCHAR MONEY REAL SMALL DATETIME SMALLINT SMALLMONEY TEXT TINYINT UNICHAR UNIVARCHAR VARBINARY VARCHAR
MicroStrategy data type Binary Binary Char Timestamp Numeric Float LongVarBin Integer Integer LongVarChar Numeric Real Timestamp Integer Numeric LongVarChar Unsigned NChar NVarChar VarBin VarChar
Data Types
Database Sybase IQ
Supported database data types BIGINT BINARY BIT CHAR DATE DATETIME DECIMAL DOUBLE FLOAT INT INTEGER LONG BINARY LONG VARCHAR MONEY NUMERIC REAL SMALLDATETIME SMALLINT SMALLMONEY TIME TIMESTAMP TINYINT UNSIGNED BIGINT UNSIGNED INT UNSIGNED SMALLINT VARBINARY VARCHAR
MicroStrategy data type Big Decimal Binary Binary Char Date Timestamp Numeric Double Float Integer Integer LongVarBin LongVarChar Numeric Numeric Real Timestamp Integer Numeric Time Timestamp Unsigned Unsigned Unsigned Unsigned VarBin VarChar
Data Types
Database Tandem
Supported database data types BIGINT BIT CHAR DATE DATETIME DECIMAL DOUBLE PRECISION FLOAT INT INTEGER MONEY NUMERIC REAL SMALLDATETIME SMALLINT SMALLMONEY TEXT TIMESTAMP TINYINT VARBYTE VARCHAR
MicroStrategy data type Big Decimal Integer Char Date Timestamp Decimal Double Double Integer Integer Double Decimal Float Timestamp Integer Double Char Timestamp Integer ??? VarChar
Data Types
Database Teradata
Supported database data types BLOB BYTE BYTEINT BYTEINTEGER BYTES CHAR CHARACTER CHARACTERS CHARS CLOB DATE DEC DECIMAL DOUBLE PRECISION FLOAT INT INTEGER LONG VARCHAR NCHAR NVARCHAR NUMERIC REAL SMALLINT TIME TIMESTAMP VARBYTE VARCHAR
MicroStrategy data type LongVarBin Binary Integer Integer Binary Char Char Char Char LongVarChar Date Decimal Decimal Double Double Integer Integer VarChar NChar NVarChar Decimal Double Integer Time Timestamp VarBin VarChar
Data Types
449
Data Types
Description Combinations of calendar date and time of day. Similar to ANSI TIMESTAMP.
Unsigned VarBin
Unsigned integer values. Variable-length bit strings. Similar to ANSI BIT VARYING.
VarChar
If the Warehouse Catalog displays a column with data type as Unknown, it implies that the data type in the database has not mapped to one of the MicroStrategy data types.
Format types
Attribute forms are also associated with a MicroStrategy format type, which specifies how attribute form values should be displayed on MicroStrategy interfaces. You specify the format type of an attribute form in the Form Format: Type drop-down menu in the Attribute Editor. The attribute form format types are described in the following table.
Format Type Big Decimal Description Information is stored and displayed in the Big Decimal form, which represents high-precision fixed point numbers. For more information about Big Decimal, see Big Decimal, page 452. Information from binary data types is stored and displayed as a string of characters. For more information on support of binary data types, see Appendix C, MicroStrategy support for binary data types. Information is stored and displayed as dates in a sequential form to perform calculations on the dates. It represents dates in the MM/DD/YYYY format. Information is stored and displayed both as date and time in the format specific to the data. The date follows the MM/DD/YYYY format and time follows the HH:MM:SS format. Information is stored and displayed in the form of an e-mail address.
Binary
Data Types
Description Information is stored and displayed as an HTML tag. Information is stored and displayed in a number format. stored and displayed the form of an image file, such as bitmap, JPG, or GIF. Information is stored and displayed in a text format. Information is stored and displayed as time in the HH:MM:SS format. This displays only the time and not the date. Information is stored and displayed as either an absolute or a relative Universal Resource Locator.
451
Data Types
The following chart is intended to guide you in assigning format types that are compatible with the data type you have assigned to a column. Different format types are compatible with different data types given the specific data in your column. Therefore, some of the data type-format type combinations below may not work with your specific data.
Data Type Big Decimal Binary Char Date Decimal Double Float Integer LongVarBin LongVarChar Numeric Real Time Timestamp Unsigned Varbin Varchar Compatible Format Types Big Decimal Number, Text, Picture Text, URL, E-mail, HTML Tag Date, Datetime Number Number Number Number Picture, Text depending on data Picture, Text Number Number Time, Datetime Datetime, Date or Time depending on data Number Picture, Text Text, URL, E-mail, HTML Tag, Picture
Big Decimal
Big Decimal is a MicroStrategy-specific data type that allows users to support high-precision attribute ID values that have more than 15 digits of precision, such as BIGINT and
Data Types
DECIMAL (precision, scale) data types. Examples of such attribute ID values are account numbers, credit card numbers, and long integers.
Big Decimal
453
Data Types
Metric: Although it is possible to define Big Decimal as the data type for metric values, consider the following drawbacks: Precision is lost when any Analytical Engine calculation is performed, the metric is used in a data field in a document, the metric is subtotaled, or metric values are displayed in Graph view. Number formatting strings are not supported on the Web. Some number formatting strings are not supported in MicroStrategy Desktop. When qualifying on a Big Decimal metric, you must explicitly identify high-precision constants by enclosing the value within hash (#) symbols. For example, #1234567890123456#.
Note that the Warehouse Catalog does not automatically map DECIMAL(p, s) or NUMERIC(p, s) columns to the Big Decimal MicroStrategy data type even when the precision is greater than 15. This is because Big Decimal should only be used when the column is used as an attribute ID form.
Data Types
To determine how and when to use binary data types in MicroStrategy, the following MicroStrategy features are supported for binary data types: MicroStrategy supports the following features for attributes that have an ID form mapped to a binary data type: Element list qualifications. Drilling. Element browsing. Page-by. Sorting. Exporting, which exports the binary data as a string of characters. MicroStrategy supports the following features for any attributes that have non-ID attribute forms that are mapped to a binary data type: Inclusion in data marts (SQL Server only) Attribute form qualifications, excluding qualifications that use operators to compare characters such as Like or Contains.
455
Data Types
GLOSSARY
aggregate function A numeric function that acts on a column of data and produces a single result. Examples include SUM, COUNT, MAX, MIN, and AVG. aggregate table A fact table that stores data that has been aggregated along one or more dimensions. See pre-aggregation. application-level In application-level partitioning, the application rather than partition the database server manages the partition tables. MicroStrategy supports two methods of application-level partitioning: metadata partition mapping and warehouse partition mapping. Compare database-level partition. application object An object used to provide analysis of and insight into relevant data. The definition of application objects such as reports, documents, filters, templates, custom groups, metrics, and prompts are derived from schema objects. All of these objects can be built and manipulated in MicroStrategy Desktop. Reports and documents can also be created and manipulated in MicroStrategy Web.
457
Glossary
attribute A data level defined by the system architect and associated with one or more columns in a data warehouse lookup table. Attributes include data classifications like Region, Order, Customer, Age, Item, City, and Year. They provide a means for aggregating and filtering at a given level. See also: attribute element attribute form child attribute constant attribute derived attribute parent attribute
attribute element A unique set of information for an attribute, defined by the attribute forms. For example, New York and Dallas are elements of the attribute City; January, February, and March are elements of the attribute Month. attribute form One of several columns associated with an attribute that are different aspects of the same thing. ID, Name, Last Name, Long Description, and Abbreviation could be forms of the attribute Customer. Every attribute supports its own collection of forms. attribute form A mapping to the columns in the warehouse that are used to expression represent a specific attribute form in SQL. attribute relationship See relationship. attribute role A database column that is used to define more than one attribute. For example, Billing City and Shipping City are two attributes that have the same table and columns defined as a lookup table.
Glossary
axis A vector along which data is displayed. There are three axesRow, Column, and Page. When a user defines a template for a report, he places template unitsattributes, dimensions, metrics, consolidations, and custom groupsalong each axis. See also: column row
base fact column A fact column represented by a single column in a fact table. browse attribute An attribute a user can directly browse to from a given attribute in a user hierarchy. business intelligence A system that facilitates the analysis of volumes of complex (BI) system data by providing the ability to view data from multiple perspectives. cache A special data store holding recently accessed information for quick future access. This is normally done for frequently requested reports, whose execution is faster because they need not run against the database. Results from the data warehouse are stored separately and can be used by new job requests that require the same data. In the MicroStrategy environment, when a user runs a report for the first time, the job is submitted to the database for processing. However, if the results of that report are cached, the results can be returned immediately without having to wait for the database to process the job the next time the report is run. cardinality The number of unique elements for an attribute.
Glossary: axis
459
Glossary
child attribute The lower-level attribute in an attribute relationship. See also: parent attribute relationship
column 1) A one-dimensional vertical array of values in a table. 2) The set of fields of a given name and data type in all the rows of a given table. 3) MicroStrategy object in the schema layer that can represent one or more physical table columns or no columns. See also: axis row
column alias In a fact definition, the specific name of the column to be used in temporary tables and SQL statements. Column aliases also include the data type to be used for the fact and allow you to modify the names of existing metrics for use in data mart reports without affecting the original metric. compound attribute An attribute that has more than one key (ID) form. compound key In a relational database, a primary key consisting of more than one database column. compression ratio The average number of child records combined to calculate one parent record. For example, the compression of ratio between monthly data and yearly data is 12:1. This is used to determine where aggregate tables would have the greatest impact. The larger the compression ratio between two attributes, the more you stand to gain by creating an aggregate table that pre-calculates the higher-level data.
Glossary
conditionality Conditionality of a metric enables you to associate an existing filter object with the metric so that only data that meets the filter conditions is included in the calculation. configuration object A MicroStrategy object appearing in the system layer and usable across multiple projects. Configuration objects include these object types: users, database instances, database login IDs, schedules. constant attribute See implicit attribute. Data Explorer A portion of the interface used to browse through data contained in the warehouse. Users can navigate through hierarchies of attributes that are defined by the administrator to find the data they need. data source A data source is any file, system, or storage location which stores data that is to be used in MicroStrategy for query, reporting, and analysis. A data warehouse can be thought of as one type of data source, which refers more specifically to using a database as your data source. Other data sources include text files, Excel files, and MDX Cube sources such as SAP BW, Microsoft Analysis Services 2000 and 2005, and Hyperion Essbase. See also: data warehouse MDX Cube source
data warehouse 1) A database, typically very large, containing the historical data of an enterprise. Used for decision support or business intelligence, it organizes data and allows coordinated updates and loads. 2) A copy of transaction data specifically structured for query, reporting, and analysis. See also data source.
Glossary: conditionality
461
Glossary
database instance 1. A MicroStrategy object created in MicroStrategy Desktop that represents a connection to the warehouse. A database instance specifies warehouse connection information, such as the data warehouse DSN, Login ID and password, and other data warehouse specific information. 2. Database server software running on a particular machine. Although it is technically possible to have more than one instance running on a machine, there is usually only one instance per machine. degradation A type of fact extension in which values at one level of aggregation are reported at a second, lower attribute level. Compare allocation. description column Optional columns that contain text descriptions of attribute elements. derived attribute An attribute calculated from a mathematical operation on columns in a warehouse table. For example, Age might be calculated from this expression: Current DateBirth Date Compare implicit attribute. derived fact column A fact column created through a mathematical combination of other existing fact columns. derived metric A metric based on data already available in a report. It is calculated by Intelligence Server, not in the database. Use a derived metric to perform column math, that is, calculations on other metrics, on report data after it has been returned from the database. drill A method of obtaining supplementary information after a report has been executed. The new data is retrieved by
Glossary
re-querying the Intelligent Cube or database at a different attribute or fact level. See also: page-by pivot sort subtotal surf
dynamic relationship When the relationship between elements of parent and child attributes changes. These changes often occur because of organizational restructuring; geographical realignment; or the addition, reclassification, or discontinuation of items or services. For example, a store may decide to reclassify the department to which items belong. element browsing Navigating through hierarchies of attribute elements. For example, viewing the list of months in a year. entity relationship A diagram that provides a graphical representation of the diagram (ERD) physical structure of the data in the source system, which lets you easily recognize tables and columns and the data stored in those columns. entry level The lowest level set of attributes at which a fact is available for analysis. entry point In a user hierarchy, a shortcut to an attribute in the Data Explorer which is helpful in allowing users to more easily access frequently-used attributes in the Data Explorer. extraction, 1) The process used to populate a data warehouse from transformation, and disparate existing database systems. loading (ETL) 2) Third-party software used to facilitate such a process.
463
Glossary
fact 1) A measurement value, often numeric and typically aggregatable, stored in a data warehouse. 2) A schema object representing a column in a data warehouse table and containing basic or aggregated numbersusually prices, or sales in dollars, or inventory quantities in counts. See also metric. fact column A column in a database table that contains fact data. fact expression A mapping of facts to physical columns in the warehouse. Fact expressions can be as simple as a fact column name from the warehouse or as sophisticated as a formula containing fact columns and numeric constants. Facts can have multiple fact expressions. fact table A database table containing numeric data that can be aggregated along one or more dimensions. Fact tables can contain atomic or summarized data. filter A MicroStrategy object that specifies the conditions that the data must meet to be included in the report results. Using a filter on a report narrows the data to consider only the information that is relevant to answer your business question, since a report queries the database against all the data stored in the data warehouse. A filter is composed of at least one qualification, which is the actual condition that must be met for the data to be included on a report. Multiple qualifications in a single filter are combined using logical operators. Examples include "Region = Northeast" or "Revenue > $1 million". A filter is normally implemented in the SQL WHERE clause. form group a grouping of attribute forms to create a compound attribute. A form group must be created to create a compound key,
Glossary
which identifies that an attribute form requires more than one ID column to uniquely identify its elements. See also compound key. heterogeneous column Columns in different tables in a database that store the same naming data but have different names. For example, one column named Customer in one table and one named Customer Name in a different table, both containing customer names. hierarchy A set of attributes defining a meaningful path for element browsing or drilling. The order of the attributes is typicallythough not alwaysdefined such that a higher attribute has a one-to-many relationship with its child attributes. highly denormalized Schema type where not only are higher-level attribute ID schema columns present within all related tables, but the description columns are present as well. highly normalized Schema type where lookup tables contain unique schema developer-designed attribute keys. homogeneous column Columns in different tables of a database that contain the naming same data and have the same column name. ID column A column that contains attribute element identification codes. All attributes must have an ID column. implicit attribute An attribute that does not physically exist in the database because it is created at the application level. Such an attribute has its expression defined as a constant value, though nothing is saved in a column. For example, you may wish to create columns in the database with a value of 1 for every row to get around COUNT limitations. You do not have to actually create the column, though, because in the Attribute Editor, you can just enter a 1 in the expression to create a count. Implicit attributes are useful in analyzing and retrieving information. When analyzing data, you can use constant
465
Glossary
attributes to create a COUNT to keep track of the number of rows returned. You can use constant attributes when building metrics, where you can sum the column holding the constant to create a COUNT. Any constant is acceptable. Compare derived attribute. joint children Joint child relationships are another type of many-to-many relationship where one attribute has a many-to-many relationship to two otherwise unrelated attributes. These relationships can be modeled and conceptualized like traditional attributes, but like facts, they exist at the intersection of multiple attribute levels.For example, consider the relationship between three attributes: promotion, item, and quarter. In this case, promotion has a many-to-many relationship to both item and quarter. An example of a promotion might be a Red Sale where all red items are on sale. A business might run this promotion around Valentine's Day (Q1) and again at Christmas time (Q4). layer A grouping of tables that can be created in Architect. Layers can help organize MicroStrategy projects that require a large number of tables. locked hierarchy A hierarchy that has at least one attribute that may not be browsed by end users. Hierarchies are usually locked if there are so many attribute elements that element browsing is not usable. logical data model A graphical representation of data that is arranged logically for the general user, as opposed to the physical data model or warehouse schema, which arranges data for efficient database use. lookup table A database table used to uniquely identify attribute elements. They typically consist of descriptions of dimensions. Lookup tables are usually joined to fact tables to group the numeric facts in the fact table by dimensional attributes in the lookup tables.
Glossary
managed object A schema object unrelated to the project schema, which is created by the system and stored in a separate system folder. Managed objects are used to map data to attributes, metrics, hierarchies and other schema objects for Freeform SQL, Query Builder, and MDX Cube reports. many-to-many An attribute relationship in which multiple elements of a parent attribute can relate to multiple elements of a child attribute, and vice versa. See also: one-to-one one-to-many many-to-one relationship
many-to-one An attribute relationship in which (1) multiple elements of a parent attribute relate to only one element of a child attribute, and (2) every element of the child attribute can relate to multiple elements of the parent. See also: one-to-one one-to-many many-to-many relationship
MDX cube A MDX cube is a collection or set of data retrieved from an MDX cube source, which is imported into MicroStrategy and mapped to various objects to allow query, reporting, and analysis on the data. See also MDX cube source.
467
Glossary
MDX cube source When integrated with MicroStrategy, the third-party tools SAP BW, Microsoft Analysis Services, and Hyperion Essbase are referred to as MDX cube sources. You can import and map data from these different MDX cube sources in MicroStrategy to query, report on, and analyze data with MicroStrategy. MicroStrategy can integrate with MDX cube source data as well as access data from a relational database concurrently. See also: MDX cube data source
metadata A repository whose data associates the tables and columns of a data warehouse with user-defined attributes and facts to enable the mapping of the business view, terms, and needs to the underlying database structure. Metadata can reside on the same server as the data warehouse or on a different database server. It can even be held in a different RDBMS. See also metadata shell. metadata shell A set of blank tables that are created when you initially implement a MicroStrategy business intelligence environment. See also metadata. metric 1) A business calculation defined by an expression built with functions, facts, attributes, or other metrics. For example: sum(dollar_sales) or [Sales] - [Cost] 2) The MicroStrategy object that contains the metric definition. See also fact. moderately normalized Schema type having the same basic structure as the highly schema normalized schema, but here the higher-level attribute ID columns are present within all related tables.
468 Glossary: MDX cube source
2010 MicroStrategy, Inc.
Glossary
MOLAP Multidimensional online analytical processing. multithreaded Characteristic of a process that supports the simultaneous execution of multiple threads. The startup code initiates the primary thread of a process by passing the main function address to the operating system. When the primary thread terminates, the process terminates. narrowcast application In a business intelligence environment, an application that allows for the distribution of personalized business information to subscribed users. In MicroStrategy, Narrowcast Server is a proactive information delivery server that allows for this distribution of information through e-mail, printers, file services, SMS, and mobile devices. object Conceptually, an object is the highest grouping level of information about one concept, used by the user to achieve the goal of specified data analysis. More concretely, an object is any item that can be selected and manipulated, including folders, reports, facts, metrics, and so on. one-to-many An attribute relationship in which every element of a parent attribute can relate to multiple elements of a child attribute, while every element of the child attribute relates to only one element of the parent. The one-to-many attribute relationship is the most common in data models. See also: one-to-one many-to-many many-to-one relationship
Glossary: MOLAP
469
Glossary
one-to-one An attribute relationship in which every element of the parent attribute relates to exactly one element of the child attribute, and vice versa. See also: one-to-many many-to-one many-to-many relationship
online analytical A system with analytical processing that involves activities processing (OLAP) such as manipulating transaction records to calculate sales trends, growth patterns, percent to total contributions, trend reporting, and profit analysis. online transaction Typically, databases or mainframes that store transactional processing (OTLP) data. Transactional processing involves the simple recording of transactions such as sales, inventory, withdrawals, or deposits. page-by Segmenting data in a grid report by placing available attributes, consolidations, and metrics on a third axis called the Page axis. Since a grid is two-dimensional, only a slice of the cube can be seen at any one time. The slice is characterized by the choice of elements on the Page axis. By varying the selection of elements, the user can page through the cube. See also: drill pivot sort subtotal surf
Glossary
parent attribute The higher-level attribute in an attribute relationship with one or more children. See also: child attribute relationship
partial relationship An attribute relationship in which elements of one attribute relate to elements of a second attribute, while the opposite is not necessarily true. See also: relationship one-to-many many-to-one many-to-many
partition base table A warehouse table that contains one part of a larger set of data. Partition tables are usually divided along logical lines, such as time or geography. Also referred to as a PBT. See also partition mapping. partition mapping The division of large logical tables into smaller physical tables based on a definable data level, such as month or department. Partitions minimize the number of tables and records within a table that must be read to satisfy queries issued against the warehouse. By distributing usage across multiple tables, partitions improve the speed and efficiency of database queries.
471
Glossary
partition mapping table A warehouse table that contains information used to identify the partitioned base tables as part of a logical whole. Also referred to as a PMT. See also: partition base table partition mapping
physical warehouse A detailed graphic representation of your business data as it schema is stored in the data warehouse. It organizes the logical data model in a method that make sense from a database perspective. See also schema. pivot To reconfigure data on a grid report by placing report objects (attributes, metrics, consolidations) on different axes. Also, to reconfigure a grid report by interchanging row and column headers, and hence the associated data. Subset of cross-tab. See also: drill page-by sort subtotal surf
port number The port number is how a server process identifies itself on the machine on which it is running. For example, when the Intelligence Server machine receives a network call from a client (Desktop, Web, Narrowcast Server, Command Manager, and so on), it knows to forward those calls to the Intelligence Server port number that is specified in the call.
Glossary
pre-aggregation Aggregation, or the calculation of numeric data at a specific attribute level, that is completed before reports are run, with the results stored in an aggregate table. See also: aggregate table aggregation
prefix A prefix is stored in the project metadata associated with a table or tables and is used by the Engine to generate SQL. Also, the Catalog Server uses it to obtain table sample values and row counts. In most cases, it should match the name space field since it is used to qualify on a specific table belonging to a certain owner or name space. Prefixes can be defined and modified from the Warehouse Catalog interface. See also table name space. process An executing application comprising one or more threads. Processes use temporary private address spaces and control operating system resources such as files, dynamic memory allocations, pipes, and synchronization objects. project 1) The highest-level intersection of a data warehouse, metadata repository, and user community, containing reports, filters, metrics, and functions. 2) An object containing the definition of a project, as defined in (1). The project object is specified when requesting the establishment of a session. project source Defines a connection to the metadata repository and is used by various MicroStrategy products to access projects. A direct project source is a two-tier connection directly to a metadata repository. A server project source is a 3-tier connection to a MicroStrategy Intelligence Server. One project source can contain many projects and the administration tools found at the project source level are used to monitor and administer all projects in the project source.
Glossary: pre-aggregation
473
Glossary
prompt 1) MicroStrategy object in the report definition that is incomplete by design. The user is asked during the resolution phase of report execution to provide an answer that completes the information. A typical example with a filter is choosing a specific attribute on which to qualify. 2) In general, a window requesting user input, as in type login ID and password at the prompt. qualification The actual condition that must be met for data to be included on a report. Examples include "Region = Northeast" or "Revenue > $1 million". Qualifications are used in filters and custom groups. You can create multiple qualifications for a single filter or custom group, and then set how to combine the qualifications using the logical operators AND, AND NOT, OR, and OR NOT. quality relationship The relationship between a parent attribute and two or more joint child attributes. The parent attribute is referred to as a quality because its definition is complete only with the intersection of its joint children. ratio The relationship in quantity, amount, or size between the cardinalities of related attributes. See also cardinality. relate table A table containing the ID columns of two or more attributes, thus defining associations between them. relational database A relational database management system (RDBMS) is a management system program that lets you create, update, and administer a relational database. A relational database is a collection of data items organized as a set of formally-described tables from which data can be accessed or reassembled in many different ways without having to reorganize the database tables. The leading RDBMS products are Oracle, IBM DB2 and Microsoft SQL Server.
Glossary
relationship An association specifying the nature of the connection between one attribute (the parent) and one or more other attributes (the children). For example, City is a child attribute of State. See also: parent attribute child attribute partial relationship quality relationship one-to-one one-to-many many-to-one many-to-many
report The central focus of any decision support investigation, a report allows users to query for data, analyze that data, and then present it in a visually pleasing manner. See also: filter template
report creation The process of building reports from existing, predesigned reports in MicroStrategy Desktop or in MicroStrategy Web. report design The process of building reports from basic report components using the Report Editor in MicroStrategy Desktop or MicroStrategy Web.
Glossary: relationship
475
Glossary
schema 1) The set of tables in a data warehouse associated with a logical data model. The attribute and fact columns in those tables are considered part of the schema itself. 2) The layout or structure of a database system. In relational databases, the schema defines the tables, the fields in each table, and the relationships between fields and tables. schema object A MicroStrategy object created, usually by a project designer, that relates the information in the logical data model and physical warehouse schema to the MicroStrategy environment. These objects are developed in MicroStrategy Architect, which can be accessed from MicroStrategy Desktop. Schema objects directly reflect the warehouse structure and include attributes, facts, functions, hierarchies, operators, partition mappings, tables, and transformations. shortcut object A MicroStrategy object that represents a link to any other MicroStrategy object such as report, filter, metric, and so forth. server definition A MicroStrategy object stored in the metadata containing information about the configuration of an Intelligence Server. server instance The combination of an Intelligence Server running with a particular server definition. simple key In a relational database, a primary key that requires only one column to uniquely identify a record within a table.
Glossary
sort Arranging data according to some characteristic of the data itself (alphabetical descending, numeric ascending, and so forth). See also: drill page-by pivot subtotal surf
source system Any system or file that captures or holds data of interest. star schema A highly denormalized physical warehouse schema in which lookup tables are consolidated so that every attribute ID and description column for a given hierarchy exists in one table. statistics tables Tables that are used to record a variety of statistical information about the usage and performance of a MicroStrategy system. Structured Query The query language standardized in 1986 by the American Language (SQL) National Standards Institute (ANSI) and used to request information from tables in a relational database and to manipulate the tables structure and data. subtotal A totaling operation performed for a portion of a result set. See also:
2010 MicroStrategy, Inc.
477
Glossary
surf To add filters, attributes, attribute elements, metrics, and functions to existing analysis objects. See also: drill page-by pivot sort subtotal
system hierarchy The superset hierarchy containing all attributes in a project. Unlike a browse hierarchy, it is not explicitly created but is automatically deduced by the MicroStrategy platform from all information available to it. Compare user hierarchy. table name space A field that is read from the warehouse catalog and used to organize databases. This field cannot be modified from the product since it is actually stored in the warehouse. Each table object in the metadata stores the name space or owner from which it came. This is needed to uniquely identify each table saved in the project when comparing table information in the metadata to the real one in the warehouse. table size The estimated size of a database table in terms of number of rows. template The data definition portion of the template consists of the group of objects (attribute, metrics, custom groups, and so on) that defines the columns of data to be included in the result set. The layout and format of these objects are defined within the template's view definition. transformation A schema object that maps a specified time period to another time period, applying an offset value, such as current month minus one month. Although the vast majority are based on
Glossary
time, a transformation can also map different objects, such as defunct product codes to new ones. Time transformations are used in metrics to compare values at different times, such as this year versus last year or current date versus month-to-date. transformation metric An otherwise simple metric that takes the properties of the transformation applied to it. For example, a metric calculates total sales. Add a transformation for last year and the metric now calculates last years total sales. threshold Used to create conditional formatting for metric values. For example, if revenue is greater than $200, format that cell to have a blue background with bold type. user hierarchy A named set of attributes and their relationships, arranged in specific sequences for a logical business organization. They are user-defined and are used to define the browse and drill relationships between attributes. virtual cube 1) In an OLAP data model, a conceptual, multidimensional representation of data. Unlike a physical cube, a virtual cube does not perform data retrieval and consequently lacks the performance problems and size limitations associated with a physical cube. A virtual cube maps MicroStrategy objects such as hierarchies and metrics to OLE DB for OLAP objects. 2) The result of mapping a logical data model to an OLE DB for OLAP multidimensional model after hierarchies and metrics have been selected from a project. No physical cube is created or loaded, but a definition of the virtual cube structure is stored in MicroStrategy metadata.
479
Glossary
INDEX
A
accessing Project Creation Assistant 84 Warehouse Catalog 322 adding table to a project 88 adding a table to a project 87, 119 aerial perspective of hierarchy 299, 314 aggregate function defined on 364 aggregate table defined on 358 advantages 359 base table 361 compression ratio 364 effectiveness 364 integrating into project 365 logical table size 366 parent-child relationship 363 pre-aggregation 360 query frequency 362 aggregate-aware 365 aggregation defined on 359 degree of 361 dense 361 dynamic 359 sparse 361
2010 MicroStrategy, Inc.
alias attribute column 256 fact column 144, 193, 202 table 279, 281 allocation expression 218 analysis, time-series 373 application-level partition defined on 367 Architect defined on 15, 101 adding tables 122 displaying data sources 121 modifying tables 126 removing tables 123 updating tables 125 atomic defined on 361 attribute defined on 10 Attribute Creation Wizard 225 Attribute Editor 231 browse form 287 cardinality 35 child 24 column alias 256 component. See report display form and browse form. compound 160, 284 compound key 160, 284
481
Index
constant 255 creating in Project Creation Assistant 226 creating using Attribute Editor 233 cross-dimensional. See joint child relationship. derived attribute 250 derived expression 155, 250 display 162, 287 element. See attribute element. example 22 expression 223 filtering in a hierarchy 304 form. See attribute form. heterogeneous mapping 157, 253 identifying 30 implicit 255 in hierarchy 25 joint child relationship 272 many-to-many relationship 261, 265 many-to-one relationship 261 multiple counting in relationship 267 nonrelated 262 one-to-many relationship 261 one-to-one relationship 261 overview 22 parent 24 properties 223, 224 qualification 370 ratio 35 relationship. See attribute relationship. report display form 287 role. See attribute role. simple expression 248 system hierarchy 168, 260 virtual 255 attribute component. See report display form and browse form.
Attribute Creation Wizard 225 using 226 Attribute Editor 231 creating an attribute 233 creating an attribute form 245 updating a hierarchy 296 attribute element defined on 23, 237 example 23 overview 23 attribute form defined on 36 creating with Attribute Editor 245 display 162, 287 example 36 expression 247 group 285 qualification 370 attribute relationship defined on 24, 168, 260 as property of attribute 223 example 24 identifying 31 in lookup table 44 overview 24 attribute role defined on 276 automatic recognition 278, 279 explicit table alias 279, 281 automatic attribute role recognition 278
B
base fact column 47 base table defined on 361 pre-aggregation 360 BI architecture 2 browse attribute 308 form 287 browsing 308 enabling in a hierarchy 309
2010 MicroStrategy, Inc.
482
Index
C
calculating growth percentage 373 logical table size 336 variance 373 cardinality for an attribute 35 Cartesian join 260 catalog SQL 338 category. See hierarchy. child attribute 24 class. See hierarchy. column defined on 41, 325 base fact column 47 data type. See column data type. derived fact 47 description 41 fact 41 heterogeneous naming 49 homogeneous naming 50 ID 41 physical warehouse schema 40, 41 column alias defined on 202 attribute 256 fact 144, 193, 202 column data type changed 345 compound attribute 160, defined on 284 creating 285 compound key defined on 42 compound attribute and 160, 284 compression ratio defined on 364 Configuration Wizard 77 connecting
2010 MicroStrategy, Inc.
to a database 331 consolidating lookup tables 58 constant attribute 255 creating attribute 233 compound attribute 285 fact 183 hierarchy 292 logical data model 26 project 80 user hierarchy 292 cross product join 212 cross-dimensional attribute. See joint child relationship. customizing catalog SQL 338
D
Data Explorer defined on 310, 310 enabling hierarchy browsing 179, 294, 310 data model. See logical data model. data provider. See project source. data slice 369 data source defined on 6 displaying in Architect 121 data type Big Decimal 452 changed in column 345 example 430 high-precision 452 mapping and 429 warehouse catalog 449 data warehouse defined on 5 connecting to 78 modifying default options 131 physical schema and 39 schema type 51 structure 51
483
Index
Warehouse Catalog 320 database connection operation 331 custom login 331 gateway support 329 read operation 331 secondary 329 database gateways, example 329 database instance defined on 75 database management system 337 degradation defined on 214 dense aggregation 361 derived attribute 250 fact 140, 196 fact column 47 derived facts, example 197 description column defined on 41 Desktop. See MicroStrategy Desktop. dimension See also hierarchy. disallowing fact entry level 219 drilling using a hierarchy 310 dynamic aggregation 359 dynamic relationship defined on 363
E
element, attribute 237 entity relationship diagram (ERD) defined on 28 entity. See hierarchy. entry level defined on 183 entry point 305 ERD. See entity relationship diagram. ETL. See extraction, transformation, and loading process. examples attribute display for browsing 288
484
attribute elements 23, 237 attribute form expressions 247 attribute forms 36, 223 attribute qualifications 370 attribute relationships 24, 260 attribute roles 275 attributes 22 attributes, heterogeneous mapping 253 column alias 202 compound attributes 285 configuration objects 9 dashboards and scorecards 386 data model sample 25 data types 430 database gateways 329 derived facts 197 documents 387 drilling using hierarchies 310 ETL 4 fact degradations 214 facts, disallowing reporting 219 heterogeneous column names 199 hierarchies 297, 363 internationalization 240 logical data model 18, 26, 389 logical tables 405 logical views 410 multiple data sources 346 parent/child relationship 263 partitions 368 physical schema 40, 398 project 385 simple and compound keys 42 sort order 247 source system for capturing data 3 table data sample 328 table relation 207
Index
transformations 374 unique identifiers 34 explicit table alias 279, 281 expression map 195 expression-based transformation 375 creating 378 member expression 380 member table 380 extension, level 204 extraction, transformation, and loading (ETL) process defined on 4, 6
F
fact 20, defined on 181 allocation expression 218 base fact column 47 column alias 144, 193, 202 column. See fact column. creating 183 cross product join 212 degradation defined on 214 derived 140, 196 derived fact column 47 disallowing 219 extension 204 Fact Creation Wizard 184 fact definition 193, 194 Fact Editor 184, 189 fact entry level 183 fact relation 211 heterogeneous fact column 142, 199 hierarchy and 25 identifying 29 implicit 196 level extension 193, 204 table 46 table relation 206 table. See fact table.
2010 MicroStrategy, Inc.
fact column defined on 41 base 47 derived 47 heterogeneous 142, 199 Fact Creation Wizard 184 Fact Editor 184, 189 fact expression defined on 195 fact table defined on 182 column naming 50 level 48 overview 21 warehouse and 46 filtered hierarchy 304 flag 273 form attribute 243 expression 247 group 285 form group defined on 285
G
gateway support for database 329 growth percentage calculation 373
H
heterogeneous attribute mapping 157, 253 column naming defined on 49 fact column 142, 199 partition mapping 368 heuristics schema creation 103 hierarchy 291 aerial perspective 314 Attribute Editor 296 attribute filter 304 attributes in 25
485
Index
browse attribute 308 browsing 308, 310 creating 292 Data Explorer and 179, 294, 310 defining 32 displaying 300 drilling 310 enabling browsing 309 entry point 305 example 297, 363 fact in 25 filtering an attribute in 304 Hierarchy Editor 297, 299, 310 Hierarchy Viewer 299 limited 302 locked 300 logical data model and 24 organization 297 Project Creation Assistant 296 structure 298 system hierarchy 296 user hierarchy 297 Hierarchy Editor 297, 299, 310 Hierarchy Viewer 299 highly denormalized schema 57 higher level lookup table 58 highly normalized schema 52 homogeneous column naming 50 partition mapping 369, 370
and attribute elements 166 and attribute forms 167 character sets 68 defining languages 86 displaying columns for 109 enabling 90 example 240
J
join, cross product 212 joint child defined on 272 joint child attribute and transformation metric 381 joint child relationship 272
K
key compound 42 simple 42
L
layer defined on 132 level extension 204 limited hierarchy 302 locked hierarchy defined on 300 logical data model defined on 17 attribute in 24 building 26 cardinality 35 conventions 33 design factors 59 example 18, 26 for MicroStrategy Tutorial 389, 398 ratio 35 sample 25
I
implicit attribute defined on 255 implicit fact 196 international technical support xxvi internationalization 90 about 61
486
Index
schema type 51 source of structure 29 unique identifier 34 Logical Table Editor 366 logical table size 366 logical views, example 410 login, custom 331 lookup table defined on 43 attribute relationship and 44 consolidating 58 many-to-many relationship 44 one-to-one relationship 44
M
many-to-many relationship defined on 261 design considerations 265 example 32 lookup table 44 relate table 45 many-to-many transformation double-counting 381 table-based transformation and 376 many-to-one relationship defined on 261 mapping schema object in Warehouse Catalog 336 mapping type 381 many-to-many 381 one-to-one 381 member attribute 380 expression 380 table 380 metadata defined on 8 connecting to 78 shell 73 table 77
2010 MicroStrategy, Inc.
metadata partition mapping 368 attribute qualification 370 data slice 369 warehouse partition mapping versus 372 metadata shell defined on 73 metric transformation 374 MicroStrategy Desktop 11 MicroStrategy metadata. See metadata. MicroStrategy Project Builder. See Project Builder. MicroStrategy Tutorial 385 data model 397 logical data model 389, 398 physical schema 398 physical warehouse schema 398 schema 398 viewing the data model 397 viewing the physical schema 398 MicroStrategy Web Universal 13 migrating a table 337 moderately normalized schema 54 MOLAP defined on 358 multidimensional data model. See logical data model. multiple counting 265
N
nonrelated attributes 262 normalized schema 53, 55
O
object, user 10 OLTP 3 one-to-many relationship defined on 261 example 31
487
Index
relate table 45 one-to-one relationship defined on 261 lookup table 44 online analytical processing. See OLAP. online transaction processing. See OLTP. opening Project Creation Assistant 84 Warehouse Catalog 322
P
parent attribute 24 parent-child relationship 24, 363 dynamic 363 static 364 partition base table defined on 367, 371 partition mapping defined on 366 application-level 367 attribute qualification 370 data slice 369 example 368 heterogeneous 368 homogeneous 369, 370 metadata 368, 372 partition base table 371 server-level 367 table 324, 371 type 368 warehouse 370, 372 partition mapping table defined on 371 PBT. See partition base table. physical warehouse schema defined on 39 design factors 59 example 40 for MicroStrategy Tutorial 398 sample 398 planning a project 81 PMT. See partition mapping table.
488
pre-aggregation defined on 360 aggregate table 358 base table 361 compression ratio 364 integrating aggregate table 365 logical table size 366 parent-child relationship 363 query frequency 362 prefix 335 project defined on 14 adding a table to 87, 88, 119 adding tables using Architect 122 aggregate table 365 creating 80 data warehouse 87 integrating an aggregate table 365 managing a table 322 managing a table for 322 modifying tables using Architect 126 planning 81 Project Builder 95 Project Creation Assistant 85, 88, 115 removing a table from 88 removing tables using Architect 123 sample project 385 schema 318 source. See project source. table management 322 updating tables using Architect 125 Warehouse Catalog 87 warehouse table in 87, 119 Project Builder 95 Project Creation Assistant 83, 296 project source defined on 73 connecting to 78 creating 83
Index
Q
qualification for an attribute form 370 quality. See joint child relationship. query frequency 362
R
ratio for an attribute 35 RDBMS defined on 5 server-level partitioning 367 read operation for a database 331 relate table 45 related attributes. See attribute relationship. relation, fact 211 relational database management system. See RDBMS. relationship dynamic 363 many-to-many 265 parent-child 363 relate table 45 static 364 removing table from a project 88 report display form 287 row count for table 335
star 58 type. See schema type. updating 319 schema type 51 comparison 60 server-level partitioning 367 simple expression 248 key 42 source system defined on 3, 5, 27 sparse aggregation 361 SQL defined on 5 attributes and columns in 22 catalog 338 default catalog SQL 343 facts and columns in 21 star schema 58 static relationship defined on 364 structure of hierarchy 298 of table 325 Structured Query Language. See SQL. summary table 358 support. See technical support. supported data type 430 system hierarchy 168, 260, defined on 296
S
schema creation heuristics 103 highly denormalized 57 highly normalized 53 MicroStrategy Tutorial project 398 moderately normalized 55 object 14 physical warehouse 39 project 318
2010 MicroStrategy, Inc.
T
table adding to a project 87, 119, 122 aggregate 358 alias 279, 281 calculating logical size 336 calculating size 336 compound key 42 fact table defined on 46, 182 key 42
489
Index
Logical Table Editor 366 lookup 43, 44 managing for a project 323 migrating 337 modifying 126 name space 325, 332, 335 physical warehouse schema 40 prefix 335 primary key 42 relation 206 removing from a project 123 row count 335 sample data 328 simple key 42 size defined on 366 summary 358 transformation 375 updating 125 updating structure 326 viewing structure 325 warehouse table in Project Creation Assistant 87 table-based member expression 380 table-based transformation 375 creating 376 member table 380 technical support xxvii international xxvi text fact. See joint child relationship. time-series analysis 373 transformation defined on 374 components 379 double-counting 381 example 374 expression-based 375, 378 many-to-many 376 mapping type 381 member attribute 380
member expression 380 member table 380 metric 374 metric. See transformation metric. one-to-one mapping type 381 table-based 375, 376 transformation metric defined on 374 joint child attribute 381 troubleshooting column data type changed 345 column missing 345 data warehouse connection 344 table missing 344
U
unique identifier 34 updating project schema 319 table structure 326 user defined object. See fact expression. user hierarchy defined on 297 browse attribute 308 browsing 308 creating 292 displaying 300 drilling 310 enabling browsing 309 entry point 305 filtering an attribute in 304 limited 302 locked 300 structure 298 user object 10 using attribute form versus characteristic attribute 259
490
Index
V
variance calculation 373 viewing sample data model 397 sample table data 328 sample warehouse schema 398 table structure 325 virtual attribute 255
W
Warehouse Catalog accessing 322 column missing 345 connection operation 331 data type 345 database gateway support 329 default catalog SQL 343 displaying information 335 managing 323 mapping schema object 336 read operation 331 troubleshooting 344 updating table structure 326 usage and settings 320 viewing table structure 325 warehouse partition mapping 370 metadata partition mapping versus 372 partition base table 371 partition mapping table 371 warehouse table in Project Creation Assistant 87 warehouse, physical schema 39, 398
491
Index
492