Вы находитесь на странице: 1из 196

BusinessObjects XI 3.0/3.

1: Advanced Universe Design

Instructors Guide BOU320

Copyright

2009 SAP BusinessObjects. All rights reserved. SAP BusinessObjects owns the following United States patents, which may cover products that are offered and licensed by SAP BusinessObjects and/or affliated companies: 5,295,243; 5,339,390; 5,555,403; 5,590,250; 5,619,632; 5,632,009; 5,857,205; 5,880,742; 5,883,635; 6,085,202; 6,108,698; 6,247,008; 6,289,352; 6,300,957; 6,377,259; 6,490,593; 6,578,027; 6,581,068; 6,628,312; 6,654,761; 6,768,986; 6,772,409; 6,831,668; 6,882,998; 6,892,189; 6,901,555; 7,089,238; 7,107,266; 7,139,766; 7,178,099; 7,181,435; 7,181,440; 7,194,465; 7,222,130; 7,299,419; 7,320,122 and 7,356,779. SAP BusinessObjects and its logos, BusinessObjects, Crystal Reports, Rapid Mart, Data Insight, Desktop Intelligence, Rapid Marts, Watchlist Security, Web Intelligence, and Xcelsius are trademarks or registered trademarks of Business Objects, an SAP company and/or affiliated companies in the United States and/or other countries. SAP is a registered trademark of SAP AG in Germany and/or other countries. All other names mentioned herein may be trademarks of their respective owners.

C O N T E N T S
About this Course
Course introduction.....................................................................................................xi Course description......................................................................................................xii Course audience..........................................................................................................xii Prerequisites.................................................................................................................xii Level, delivery, and duration....................................................................................xii Applicable certifications and designations..............................................................xii Course success factors...............................................................................................xiii Course setup...............................................................................................................xiii Course materials.........................................................................................................xiii Hints on preparing for this course...........................................................................xiv Training system availability.....................................................................................xiv Learning process.........................................................................................................xiv

Lesson 1

Reviewing Universe Design Concepts


Lesson introduction.......................................................................................................1 Using your BusinessObjects Universe Designer knowledge..................................2 Review: Using universe design concepts............................................................2 Activity: Implementing a universe......................................................................6 Reviewing the course database and universe..........................................................11 The course database.............................................................................................11 An overview of the Motors universe.................................................................11 Demonstration: To deploy the Motors universe (Optional)..........................12 Activity: To deploy the Motors universe (Optional).......................................13 Lesson summary..........................................................................................................16

Lesson 2

Working with Aggregate Awareness


Lesson introduction.....................................................................................................17 Defining aggregate awareness...................................................................................18 What is aggregate awareness?............................................................................18 Summary tables....................................................................................................18 Summary tables and SQL ...................................................................................18 Applying aggregate awareness.................................................................................20 Setting up aggregate awareness.........................................................................20

Table of ContentsInstructors Guide

iii

Demonstration: To insert a summary table......................................................20 Demonstration: To detect contexts....................................................................21 Redefine the objects .............................................................................................22 Applying aggregate awareness to objects........................................................22 Demonstration: To apply the @aggregate_aware function............................22 Define incompatible objects................................................................................23 Demonstration: To use the Aggregate Navigation automatic detection tool..........................................................................................................................24 Demonstration: To test aggregate awareness..................................................26 Activity: Setting up aggregate awareness - part 1...........................................27 Activity: Setting up aggregate awareness - part 2...........................................30 Using aggregate awareness to resolve fan traps..............................................33 Demonstration: To resolve a two-table fan trap using aggregate awareness..............................................................................................................33 Outer joins and aggregate awareness...............................................................35 Quiz: Working with aggregate awareness...............................................................36 Lesson summary..........................................................................................................37

Lesson 3

Designing Advanced Objects


Lesson introduction.....................................................................................................39 Combining database functions in objects.................................................................40 Using database functions in objects...................................................................40 Demonstration: To create a data range object..................................................41 Demonstration: To extract data from strings...................................................42 Activity: Combining database functions in objects ........................................43 Working with analytic functions.......................................................................46 What are analytic functions?..............................................................................46 Demonstration: To create objects using analytic functions (Optional)........46 Constructing relative date-time objects....................................................................48 Date functions in objects.....................................................................................48 Relative date-time objects ..................................................................................48 CASE statements in measure objects ................................................................48 Activity: Constructing relative date-time objects ...........................................49 Moving averages..................................................................................................53 Demonstration: To create a moving average through time...........................53 Activity: Creating a moving average.................................................................57 Quiz: Designing advanced objects............................................................................61 Lesson summary..........................................................................................................62

iv

Advanced Universe DesignInstructors Guide

Lesson 4

Creating Complex Predefined Conditions, LOVs, and Joins


Lesson introduction.....................................................................................................63 Creating complex predefined conditions.................................................................64 Subqueries in predefined conditions.................................................................64 Demonstration: To retrieve the maximum sales date and associated revenue value........................................................................................................64 Demonstration: To define subqueries in predefined conditions...................65 Demonstration: To create complex subqueries by using the Universe Designer Query Panel (Optional)......................................................................66 Activity: Creating subqueries in predefined conditions................................69 @Prompt scenarios in predefined conditions...................................................71 Demonstration: To create an _ALL Values_ prompt in a Predefined Condition...............................................................................................................71 Demonstration: To create a predefined condition that returns a pattern selection.................................................................................................................73 Activity: Using @prompt in predefined conditions........................................75 Working with advanced LOVs..................................................................................77 Customizing LOVs...............................................................................................77 Demonstration: To modify an LOV to have an ALL values entry................77 Activity: Modifying LOVs..................................................................................80 Arranging LOV data as an A-Z index...............................................................82 Demonstration: To create an A-Z index in a cascading LOV........................82 Activity: Arranging LOVs...................................................................................85 Working with advanced join syntaxes......................................................................86 Defining @prompt functions in a join...............................................................86 Defining conditional join paths..........................................................................86 Demonstration: To define a conditional join....................................................86 Using joins to construct relative date-time objects..........................................87 Demonstration: To use joins for relative date-time objects............................87 Conditional joins and running calculations.....................................................89 Demonstration: To create running calculations by using conditional joins........................................................................................................................89 Activity: Using complex joins.............................................................................91 Quiz: Creating complex predefined conditions and LOVs...................................97 Lesson summary..........................................................................................................98

Lesson 5

Securing Universes
Lesson introduction.....................................................................................................99 Defining connection and user credential parameters...........................................100

Table of ContentsInstructors Guide

About security and universes ..........................................................................100 User credentials for the connection ................................................................100 Demonstration: To set user database credentials in the universe connection...........................................................................................................100 Working with Central Management Server (CMS) universe security...............104 Organizing universes in secured folder structures ......................................104 Working with table mapping in restriction sets....................................................105 About restriction sets.........................................................................................105 Working with table mapping...........................................................................105 Demonstration: To apply table mapping in a restriction set.......................105 Activity: Working with table mapping in a restriction set...........................107 Quiz: Securing universes..........................................................................................110 Lesson summary........................................................................................................111

Lesson 6

Implementing Universe Life Cycle Management


Lesson introduction...................................................................................................113 Moving content from development to production...............................................114 Life cycle management......................................................................................114 Using the Import Wizard..................................................................................114 Universes and universe connections...............................................................114 Working with Business Intelligence Archive Resource (BIAR) files .........114 Demonstration: To export universes to a BIAR file.......................................115 Demonstration: To import universes from a BIAR file.................................116 Using test folders................................................................................................118 Life cycle management recommendations.....................................................118 Activity: Moving content from development to production.......................118 Quiz: Implementing universe life cycle management..........................................123 Lesson summary........................................................................................................124

Lesson 7

Maintaining and Optimizing Universes


Lesson introduction...................................................................................................125 Optimizing universes................................................................................................126 The Connection Server......................................................................................126 Setting up a trace file.........................................................................................126 Connection configuration parameters.............................................................126 Demonstration: To access the connection configuration parameters.........126 Custom connection parameters........................................................................127 Demonstration: To access the custom connection parameters....................127 Dynamic SQL parameters.................................................................................127 Adapting dynamic SQL parameters................................................................128 BEGIN_SQL........................................................................................................128 END_SQL............................................................................................................128

vi

Advanced Universe DesignInstructors Guide

ANSI92 and FILTER_IN_FROM .....................................................................129 Demonstration: To edit the End_SQL parameter..........................................129 About ANSI92 SQL syntax ..............................................................................129 The ANSI92 dynamic SQL parameter.............................................................130 Demonstration: To edit the ANSI92 parameter.............................................130 Demonstration: To test the effects of the FILTER_IN_FROM parameter.............................................................................................................130 Applying the FILTER_IN_FROM functionality to individual classes and objects...................................................................................................................131 Demonstration: To apply FILTER_IN_FROM functionality to individual classes and objects..............................................................................................131 Demonstration: To test FILTER_IN_FROM functionality applied to individual classes and objects...........................................................................135 The JOIN_BY_SQL parameter..........................................................................135 Activity: Using dynamic SQL parameters......................................................135 Applying index awareness ......................................................................................139 What is index awareness? ................................................................................139 Demonstration: To review applied primary key index awareness.............139 Avoiding joins in tables.....................................................................................140 Demonstration: To set up foreign key index awareness..............................140 Multiple foreign key entries.............................................................................142 Demonstration: To apply multiple foreign key entries................................142 SQL Editor dialog box ......................................................................................143 Demonstration: To add a string value in the SQL Editor dialog box.........143 Using an index awareness WHERE clause.....................................................144 Demonstration: To add an index awareness WHERE clause .....................144 Applying best practices for universe design.........................................................146 Best practices for designing and optimizing your universe........................146 Quiz: Maintaining and optimizing universes........................................................147 Lesson summary........................................................................................................148

Lesson 8

Creating Universes from Other Data Sources


Lesson introduction...................................................................................................149 Creating a universe from an XML data source......................................................150 Which data sources are supported in the Metadata Exchange panel?.......150 Working with the Metadata Exchange panel.................................................150 Demonstration: To create a universe from a CWM Relational 1.0/1.1 metadata file........................................................................................................150 Creating stored procedure and JavaBeans universes...........................................153 Stored procedure universes..............................................................................153 Creating a universe based on stored procedures..........................................153 Demonstration: To view existing stored procedures (Optional).................153 Demonstration: To create a universe based on a simple stored procedure.............................................................................................................154

Table of ContentsInstructors Guide

vii

Stored procedure parameters in the universe................................................156 Demonstration: To create a universe based on stored procedures with input parameters................................................................................................156 Advantages and disadvantages of stored procedure universes.................158 JavaBeans and universes...................................................................................158 Activity: Creating stored procedure universes .............................................158 Working with OLAP universes...............................................................................161 Understanding the OLAP cube........................................................................161 Generating universes from OLAP cube sources............................................161 Demonstration: To create a universe from an OLAP cube..........................161 Modifying and updating an OLAP universe.................................................163 Demonstration: To refresh the structure of an OLAP universe..................164 Activity: Creating an OLAP universe.............................................................165 Quiz: Creating universes from other data sources...............................................167 Lesson summary........................................................................................................168

Appendix A

End of Course Challenge


Activity: Completing the end of course challenge................................................169

Appendix B

Data Access Files


BusinessObjects data access files.............................................................................175 The PRM file...............................................................................................................176

Appendix C

External Strategies
Using external strategies in Universe Designer....................................................177 Types of strategies.....................................................................................................178

Appendix D

SQL syntaxes for other RDBMS


Alternative SQL syntaxes for other RDBMS..........................................................179 ORACLE......................................................................................................................180 MySQL.........................................................................................................................181 DB2...............................................................................................................................182

viii

Advanced Universe DesignInstructors Guide

Advanced Universe Design


Introductions, Course Overview...........................................30 minutes
Lesson 1

Reviewing Universe Design Concepts........................................1 hour


Using your BusinessObjects Universe Designer knowledge Lesson 2

Working with Aggregate Awareness..........................................2 hours


Defining aggregate awareness Applying aggregate awareness Lesson 3

Designing Advanced Objects.................................................2.25 hours


Combining database functions in objects Constructing relative date-time objects Lesson 4

Creating Complex Predefined Conditions, LOVs, and Joins.....................................................................................................2 hours


Creating complex predefined conditions Working with advanced LOVs Working with advanced join syntaxes Lesson 5

Securing Universes...................................................................45 minutes


Defining connection and user credential parameters Working with Central Management Server (CMS) universe security Lesson 6

Implementing Universe Life Cycle Management.............45 minutes


Moving content from development to production

AgendaInstructors Guide

ix

Lesson 7

Maintaining and Optimizing Universes.....................................2 hours


Optimizing universes Applying best practices for universe design Lesson 8

Creating Universes from Other Data Sources..................1.75 hours


Creating a universe from an XML data source Creating stored procedure and JavaBeans universes Working with OLAP universes

Advanced Universe DesignInstructors Guide

About this Course


Course introduction
(LG xi)

This section explains the conventions used in the course and in this training guide.

About this CourseInstructors Guide

xi

Course description

(LG xii)

This two-day instructor-led advanced course is designed to give you the comprehensive skills and in-depth knowledge needed to design universes in BusinessObjects Universe Designer. The business benefit of this course is that you will learn best-practice methodology for creating universes that respond to your reporting requirements. Through well-designed universes, report designers and business users will be able to create reports without having to know anything about the underlying data source or structure.

Course audience

(LG xii)

The target audience for this course is anyone responsible for creating and designing universes using Universe Designer, using BusinessObjects XI 3.0/3.1. The learners who attend the course will be most successful if they have experience in working with Business Objects Universe Designer. New features covered in the XI 3.0/3.1 course that are not applicable to BusinessObjects XI R1/R2 learners include: Creating universes from stored procedures and JavaBeans Creating, modifying, and updating universes from OLAP data sources using the enhanced OLAP functionality in Universe Designer

Prerequisites

(LG xii)

To be successful, learners who attend this course should have attended the following offerings: BusinessObjects XI R2: Universe Design, and/or BusinessObjects XI 3.0/3.1: Universe Design BusinessObjects Web Intelligence XI R2: Report Design, and/or BusinessObjects Web Intelligence XI 3.0/3.1: Report Design To be successful, you must be familiar with: The metadata and logical structure of the databases in your organization BusinessObjects Web Intelligence report building Using BusinessObjects Universe Designer Using and working with SQL and relational database management systems concepts and structures The BusinessObjects Central Management Console

Level, delivery, and duration

(LG xii)

This advanced instructor-led offering is a two-day course.

Applicable certifications and designations

(LG xii)

This course is not applicable to any Business Objects Certified Professional programs.

xii

Advanced Universe DesignInstructors Guide

Course success factors


(LG xiii)

Your learning experience will be enhanced by: Activities that build on the life experiences of the learner Discussion that connects the training to real working environments Learners and instructor working as a team Active participation by all learners

Course setup

(LG xiii)

Refer to the setup guide for details on hardware, software, and course-specific requirements.

Course materials
Instructor Note:

(LG xiii)

Point out as part of the course introduction and again at the end of the last day of class that learners will receive an electronic feedback form as part of our evaluation process. Emphasize that their comments will assist us to improve future courses. As an instructor, encourage the learners to retrieve information and find answers to questions using the online Help that is included with the product. Included in the course materials is an instructors guide that contains an agenda, lessons, and practice activities. The Instructors Guide outlines detailed contents as well as instructor notes, which do not appear in the Learners Guide, for teaching this course. The materials included with the course materials are: Name card Learners Guide The Learners Guide contains an agenda, learner materials, and practice activities. The Learners Guide is designed to assist students who attend the classroom-based course and outlines what learners can expect to achieve by participating in this course. Evaluation form At the conclusion of this course, you will receive an electronic feedback form as part of our evaluation process. Provide feedback on the course content, instructor, and facility. Your comments will assist us to improve future courses. Additional resources include: Sample files The sample files can include required files for the course activities and/or supplemental content to the training guide. Online Help Retrieve information and find answers to questions using the online Help and/or users guide that are included with the product.

About this CourseInstructors Guide

xiii

Hints on preparing for this course


Remember to check for additional information published after the course material was released. For the latest information or course updates see the Instructor Guide/System Setup Guide or Trouble Shooting Guide on SAP Service Marketplace. Find these guides under the alias /curr-info: http://service.sap.com/curr-info.

Training system availability


Your training system will be available and accessible on Sunday evening (CET time zone) of the week the training takes place. Do not use the system or prepare your course before that time. The system can still be in use by another course or in the refresh procedures of the IT preparation for your course.

Learning process

(LG xiii)

Learning is an interactive process between the learners and the instructor. By facilitating a cooperative environment, the instructor guides the learners through the learning framework.

Introduction
Why am I here? Whats in it for me? The learners will be clear about what they are getting out of each lesson.

Objectives
How do I achieve the outcome? The learners will assimilate new concepts and how to apply the ideas presented in the lesson. This step sets the groundwork for practice.

Practice
How do I do it? The learners will demonstrate their knowledge as well as their hands-on skills through the activities.

Review
How did I do? The learners will have an opportunity to review what they have learned during the lesson. Review reinforces why it is important to learn particular concepts or skills.

Summary
Where have I been and where am I going? The summary acts as a recap of the learning objectives and as a transition to the next section.

xiv

Advanced Universe DesignInstructors Guide

Lesson 1

Reviewing Universe Design Concepts


Lesson introduction
(LG 1)

Instructor Note: Remember to check for additional information published after the course material was released. For the latest information or course updates see the Instructor Guide/System Setup Guide or Trouble Shooting Guide on SAP Service Marketplace. Find these guides under the alias /curr-info: http://service.sap.com/curr-info. Your training system will be available and accessible on Sunday evening (CET time zone) of the week the training takes place. Do not use the system or prepare your course before that time. The system can still be in use by another course or in the refresh procedures of the IT preparation for your course. Review the lesson objectives. During this lesson you review your existing universe design and BusinessObjects Universe Designer knowledge, and review key concepts from the BusinessObjects XI 3.0/3.1: Universe Design course. After completing this lesson, you will be able to: Use your universe design and BusinessObjects Universe Designer knowledge to solve business problems Describe the course universe, database data, and structure

Reviewing Universe Design ConceptsInstructors Guide

Using your BusinessObjects Universe Designer knowledge (LG 2)


Instructor Note: Define unit objectives. The interactive review in this lesson asks you to use your BusinessObjects Universe Designer knowledge and features you should be proficient in to complete this course. After completing this unit, you will be able to: Use current BusinessObjects Universe Designer skills to solve reporting business problems

Review: Using universe design concepts

(LG 2)

Instructor Note: Allow 10-15 minutes for this activity. This activity acts as a review for what has been learned in the BusinessObjects XI 3.0/3.1: Universe Design course. This activity can be conducted as an interactive question and answer session. Note: Learners can make use of the Notes pages at the back of the guide to write down the answers. Review the activity with the learners to ensure that they have acquired the skills outlined in the activity objective.

Objective
Review your knowledge of Universe Designer

Instructions
1. What is a universe? Answer: The BusinessObjects universe is the semantic layer that isolates business users from the technical complexities of the databases where their corporate information is stored. For the ease of the end user, universes are made up of objects and classes that map to data in the database, using everyday terms that describe their business environment. 2. Does a universe store data? Answer: You associate data to universes by mapping to a data source. Data is not stored in the .unv file. 3. What are the main advantages of a universe? Answer: Only the universe designer needs to know how to write SQL and understand the structure of the target database. The interface allows you to create a universe in an easy-to-use graphical environment.

Advanced Universe DesignInstructors Guide

Data is secure. Users can see only the data exposed by the universe. Users can only read data, not edit it. The results are reliable and the universe is relatively easy to maintain. Users can use a simple interface to create reports. All users work with consistent business terminology. Users can analyze data locally. 4. Describe the connection types and their purposes. Answer: Secured: Use this connection to enable your universe to be exported to the BusinessObjects Enterprise repository. Shared: Use this connection to share your universe across the network with other designers. Personal: Use this connection if the universe is solely for a single user and there is no need to neither share nor publish this universe to the Enterprise system. 5. What are the types of objects that can be created in a universe? Provide a brief description of each type. Answer: Dimension: These objects relate to the key information being retrieved from the database. They can be date, character, or number type, and may contain a calculation. They are used in queries and condition/filters and can also be used to drill on in hierarchies and link on between queries. Detail: These objects relate to supportive information and are associated with dimensions. They can be date, character, or number type, and may contain a calculation. They are used in queries and condition/filters but cannot be used to drill on or link on between queries. Measure: These objects are dynamic aggregates and are always a number type, containing functions like Sum, Count, Average, Max, or Min. Depending on the other objects in the query, they dynamically aggregate themselves when displayed in the report block. Predefined Condition/Filter: These objects contain a name, a description and a restriction. They are designed to give the user a choice as to whether to apply a condition filter or not. They can be quite basic, or can contain a complex where clause. 6. What are the different join types allowed in the universe structure. Provide a short description of each type. Answer: Equi: This join works on the principle of the data in the fields that are a joined match, for example Customer ID = Customer ID, therefore returning data from both tables where the data matches. Outer: This join works in the same way as an equi-join, however there may be data in one table but not the other, and the requirement is for the data to be returned regardless. For example, a join between Customer and Sales would be based on Customer ID, however

Reviewing Universe Design ConceptsInstructors Guide

a customer may still be prospective and not have any records in the sales table, but all customers must be reported on regardless of sales. Complex/Theta: This join works on the Between principle. For example, a sales date may be joined to a begin and also an end date in a table which is date based, for example sales date between begin date and end date. Self-restricting: This join works as a restriction on the table. If there is a field that can be used as a flag on a table, then this join would allow that flag to be referenced every time the table is used in the SQL statement. Self-referencing: A self-referencing join is a join from one column of a table to another column of the same table. This join should not be used as it creates a loop. Ideally, if this join exists, then the table should be aliased and the appropriate join and cardinality should be assigned. Shortcut: A shortcut join is a join that provides an alternate path between two tables. It improves the performance of a query by not taking into account intermediate tables, and shortening a normally longer join path.

7. What are the different types of SQL traps that can be found in a schema? How can each of these types be identified? How can each type be resolved in the universe schema? Answer: Chasm Trap: Identify - A chasm trap is essentially a many-to-one-to-many relationship and may be seen as a parent table with two child tables, the child tables having the many end of the relationship. If a query is run with a chasm trap, depending on the objects used, either too many or not enough rows (but aggregation may be affected) are produced. Resolve - Best resolved by using contexts.

Fan Trap: Identify - A fan trap is identified as a one-to-many or a one-to-many-to-many relationship. In itself, this isn't an issue - what is the issue is if there are two fields being used as aggregates and they are at different levels in the path. This can give the same result as a chasm trap. Resolve - If they can be avoided by using the lowest level of granularity then this is the best practice, however that isn't always possible. In which case, a combination of aliases and contexts resolves the fan trap.

8. What are loops and how can they be resolved? Answer: Loops are joins between tables that (eventually) come back to the starting point, forming a circle, or loop. Usually the error Incompatible combination of objects alerts you to the fact you may have a loop. 9. Describe how you would test a measure to make sure the aggregation levels are projected correctly. Answer:

Advanced Universe DesignInstructors Guide

To test a measure correctly, a minimum of three queries should be created. 1. 2. The measure on its own. The measure with two different dimensions, in different queries. Once the table has been projected, remove the dimensions and then add them again using the drag and drop method. This checks the aggregation in the report is correct. Applying a total to the tables checks (if they are all the same total) the aggregation level from the database.

3.

10.Explain two drawbacks of using restrictions at the object level. Answer: Two drawbacks: 1. Conflicting restrictions in the objects may be confusing if those objects are placed in the query. For example: UK customers, US customers. Effectively you are saying they must be UK and US at the same time, this is a conflict so no data is returned. Creates a flat level at the end of the class making drilling through the hierarchy difficult.

2.

11.Describe the use of the @select function. Answer: The @select function has no benefit to the end user. However, it does have benefit to the designer, as this is how they can reuse code between objects. 12.What is a hierarchy? Answer: A hierarchy is the order of dimensions in a "class" in a one-to-many order. Hierarchies can be default (or natural) and custom. 13.Describe what a derived table is and how it is generally used in a universe schema. Answer: A derived table is a table that contains an SQL statement. It is generally used: When it is not possible to create a table at the database level, especially if there is a need to link two otherwise un-linkable tables together To create a table based on a restriction - instead of aliasing tables based on their flag and using self-restricting joins 14.Describe what index awareness is, and how it is used in a universe schema. Answer: Index awareness is a way of utilizing the indexing in the database to enable queries to be more efficient in the SQL that they generate. It is set up via the object properties. 15.What are the pros and cons of delegated functionality in a universe-based reporting structure? Answer: Delegated or "smart" measure objects were discussed in the core Universe Design class. The objective is to shift the responsibility for the aggregation to the data source, instead of the universe This allows for complex and weighted calculations of dimensional subsets,

Reviewing Universe Design ConceptsInstructors Guide

but requires a refresh to the data source in order to display the results in the Web Intelligence report.

Activity: Implementing a universe

(LG 3)

Instructor Note: Allow 45-50 minutes for this activity. This activity is a review for topics learned in the BusinessObjects XI 3.0/3.1: Universe Design course. Note: This activity uses the Club SQL Server 2005 database. Solution table schema:

Be aware that the user login parameter for starting Universe Designer and Web Intelligence Rich Client are different in the CSG and non-CSG environments. Consult the table for the information for each activity step. Be aware that, in the CSG environment, all classroom-created connections and universes are stored in the same centralized repository. It is therefore necessary to give a unique name to each connection and universe that are created. Be aware that the location for locally saved universes is different in the CSG and the non-CSG environment. Consult the table for the information for each activity step. Review the activity with the learners to ensure that they have acquired the skills outlined in the activity objective. Note: Walk through answers to questions raised in the activity steps. Answers for the steps are outlined in the table below:

Advanced Universe DesignInstructors Guide

Step

Details

1.

CSG: Provide the students with their CSG student login name. Non-CSG: Students can use Administrator as login name. CSG: Ensure students use their initials (provided they are unique) or their student numbers (for example, "S01", "S02") as a postfix to the TravelClub universe and ClubOLEDB connection names to ensure a unique naming convention. Non-CSG: It is not essential to use a postfix for the universe or connection name. CSG: Provide the students with the SQL server login credentials and server name used in the classroom. Non-CSG: Students can use the sa credentials. Prompt students to look at the schema and ask: Who is your audience? What objects do they need?

2.

3.

4.

6.

The universe requires contexts: Reservation Line and Invoice Line. CSG: Universes are saved in: \\My Documents\My Business Objects Universes.

7.

Non-CSG: The default location is in: \\Documents and


Settings\<user>\Application Data\Business Objects\Business Objects 12.0\Universes\<universe>.unv.

8.

CSG: Provide the students with their CSG student login name. Non-CSG: Students can use Administrator as login name.

Objective
Implement a universe using Universe Designer

Instructions
The project team is asked to design a universe solution for the Island Resorts Company. The project team made the following findings during the preparation, analysis, and planning phases, and are now preparing for the implementation stage.

Reviewing Universe Design ConceptsInstructors Guide

The Island Resorts Company requires an ad-hoc reporting system for their resort locations. There are five holiday destinations; Royal Caribbean, Hawaiian Club, French Riviera, Bahamas Beach, and Australian Reef. Standards Customers and clients are referred to as guests. Database design specifics The database has six years of data: 2004 - 2006 for current bookings, 2007 - 2009 for reservations. Objects and filters Condition objects are required for the three years of guests, the three years for reservations, the location, guests under the age of 30, and guests from the US. Dates are to be reported on as year, quarter, month, week, and invoice or reservation date. Measures are for future guests, current guests, and also for revenue. Customer information for reporting is hierarchical, and should include the customer's age group. Some personal details of customers are also required for reporting. 1. Start a Universe Designer session and log on using the credentials provided by the instructor. 2. Create a new blank universe called TravelClub _xx, where "xx" stands for your initials. 3. Create a new OLE DB connection called ClubOLEDB_xx, where "xx" stands for your initials. a. Select File Parameters Definition, and then click New below the Connection field. b. Click Next. c. Select Secured from the Connection Type drop-down list. d. In the Connection Name field, type ClubOLEDB_xx, where "xx" stands for your initials. e. Expand the Microsoft node, which is the target database for the connection. f. Expand the MS SQL Server 2005 node, which is the target middleware for the connection. g. Select the OLE DB Providers driver name and click Next. h. Select Use specified username and password as the authentication mode. i. In the User name and Password fields enter the database login credentials. Use the SQL Server database server credentials, as provided to you by the instructor. j. In the Server field, select or enter the appropriate SQL Server name to connect to, as provided to you by the instructor. k. In the Database field, enter Club, the name of the database you are connecting to. l. Click Next twice, and click Finish. m. In the Wizard Connection dialog box, click Test to test the connection. If the connection is valid, a message dialog box appears, indicating that the connection is correct. If you receive an error message, check that you entered all the parameters correctly. n. Click Finish to exit the wizard.

Advanced Universe DesignInstructors Guide

4. Insert the tables outlined in the diagram:

5. Create classes to hold objects for measures, reservations, customers, sales, and resorts. Most objects are dimensions, except for those in the measures class. The use of details is for personal information on the client only. 6. Check for chasm traps, fan traps, and loops, and resolve them accordingly. 7. Save your universe locally. 8. Test your universe by building queries in Web Intelligence Rich Client. a. Launch Web Intelligence Rich Client. Go to Start Programs BusinessObjects XI 3.0/3.1 BusinessObjects Enterprise Web Intelligence Rich Client. b. Log on using the credentials provided by the instructor. c. Select the create a new document based on a data source icon. d. Select Browse for more data sources. e. Select Universe, and click Next. f. Select your TravelClub universe, and click OK. g. Build a new query using the objects you have created. Drag and drop the objects into the Result Objects pane. h. Click Run Query to view the final results displayed in the report. 9. Run appropriate reports in Web Intelligence Rich Client to: Identify number of guests who have stayed by time period as well as by country of origin. Identify number of guests by each location, listing the services. Determine the revenue generated by time period. Identify whether customers are from the US or whether they are under the age of 30. A requirement exists to identify Americans who are under the age of 30 separately from other guests.

Reviewing Universe Design ConceptsInstructors Guide

Identify the different services available at each location. The services could be accommodation, amenities, or activities. Report on the number of guests by age group for the time period 2004 to 2006. Report on the number of guests by age group for the time period 2007 to 2009.

10

Advanced Universe DesignInstructors Guide

Reviewing the course database and universe


Instructor Note: Define unit objectives.

(LG 6)

In order to create a BusinessObjects universe, you must first be familiar with the data and structure of the database to which the universe is connected. The universe used for this course has been created in the BusinessObjects XI 3.0/3.1: Universe Design course, and is further extended during this advanced course. After completing this unit, you will be able to: Understand the database and universe used during this course

The course database


Instructor Note:

(LG 6)

Review the database scenario and its characteristics with the students: There are three showrooms, two in the US and one in the UK. Each showroom has the franchise for a number of different car makers, who all manufacture a number of different models, available in a range of colors. Customers may either rent or buy cars. Customers usually rent or buy from the showroom in their own country but this is not always the case. The database contains data for two financial years 2003/2004 and 2004/2005. Each year begins on April 6 and ends on April 5 in the subsequent year. Information about employees who work within the organization is also available in the database. There are summary tables for quarterly and annual revenue and numbers to speed up queries. The data is stored in a SQL Server 2005 database. Connections to the database are made using OLE DB. Inform the students of some of the assumptions to be made in regards to the course database. Explain that the remainder of this course is spent on further developing the Motors universe for this imaginary deployment.

An overview of the Motors universe


Instructor Note:

(LG 6)

Provide a brief overview of the Motors universe. Describe what has been covered in the core universe design course. Show the Motors universe file by opening it from the Activity_Resources Motors_start folder on the course resources.

Reviewing Universe Design ConceptsInstructors Guide

11

Demonstration: To deploy the Motors universe (Optional)


Instructor Note:

Note: These demonstration steps only apply if this course is not taught directly after the BusinessObjects XI3.0/3.1: Universe Design course. If this course is taught directly after the core Universe Design course, use your saved Motors universe file for course demonstrations and activities. The Motors universe is built throughout the BusinessObjects XI 3.0/3.1: Universe Design course. This course builds on the final universe file from the BusinessObjects XI 3.0/3.1: Universe Design course. If this is taught separate from the core Universe Design course, use the Motors universe file provided in the Activity_Resources Motors_start folder in the course resources. Ensure that a secured OLEDB connection is created to work with the universe file. Be aware that the steps are different in the CSG and non-CSG environment. In the CSG environment, all classroom-created connections and universes are stored in the same centralized repository. It is therefore necessary to give a unique name to each connection and universe that are created. The demonstration indicates the different steps required in both environments. 1. Open the Motors universe file provided in the Activity_Resources Motors_start folder of the course resources. 2. If you are teaching this course in a CSG environment, rename the universe in File Parameters Definition. Rename the universe to Motors_Ixx (where "xx" stands for instructor number for example, I01 or I02). In a non-CSG environment you do not need to rename the universe. 3. Create a new OLE DB connection. Select File Parameters Definition, and then click New below the Connection field. 4. Click Next. 5. Select Secured from the Connection Type drop-down list. 6. Provide a name for the connection in the Connection Name field. CSG: Name this connection MotorsOLEDB_Ixx (where "xx" stands for instructor number for example, I01 or I02). Non-CSG: MotorsOLEDB 7. Expand the Microsoft node, the target database for the connection. 8. Expand the MS SQL Server 2005 node, which is the target middleware for the connection. 9. Select the OLE DB Providers driver name and click Next. 10.Select Use specified username and password as the authentication mode. 11.In the User name and Password fields use the SQL Server database server credentials as provided to you in the training environment.

12

Advanced Universe DesignInstructors Guide

12.In the Server field, select or enter the appropriate SQL Server name to connect to, as provided to you in the training environment. 13.In the Database field, enter Motors, which is the name of the SQL Server database you are connecting to. 14.Click Next twice, and click Finish. 15.In the Wizard Connection dialog box, click Test to test the connection. If the connection is valid, a message dialog box appears indicating that the connection is correct. If you receive an error message, check that you entered all the parameters correctly. 16.Click Finish to exit the wizard. 17. Select File Save As to save your Motors universe version locally. Be aware that the location for locally saved universes is different for the CSG and the non-CSG environment. CSG: Universes are saved in: \\My Documents\My Business Objects Universes. Non-CSG: The default location is in: \\Documents and Settings\<user>\Application Data\Business Objects\Business Objects 12.0\Universes\<universe>.unv.

Activity: To deploy the Motors universe (Optional)

(LG 7)

Instructor Note: Allow 15 - 20 minutes for this activity. Explain the activity objective and instructions as a bridge from the lecture to the practice. Note: These activity steps only apply if this course is not taught directly after the BusinessObjects XI 3.0/3.1: Universe Design course. If this course is taught directly after the core Universe Design course, students continue to use their saved Motors universe file for course activities. The Motors universe is built throughout the BusinessObjects XI3.0/3.1: Universe Design course. This course builds on the final universe file from the BusinessObjects XI3.0/3.1: Universe Design course. If this is taught separate from the core Universe Design course, the final version of the BusinessObjects XI 3.0/3.1: Universe Design course needs to be deployed. Be aware that some steps are different in the CSG and the non-CSG environment, and that the activity instructions do not give these details explicitly. Consult the table for the information for each activity step. Review the activity with the learners to ensure that they have acquired the skills outlined in the activity objective. Note: Walk through answers to questions raised in the activity steps. Answers for the steps are outlined in the table below:
Step 1. Details

CSG: Provide the students with their CSG student login name.

Reviewing Universe Design ConceptsInstructors Guide

13

Step

Details

Non-CSG: Students can use Administrator as login name. CSG: Ensure students use their initials (provided they are unique) or their student numbers (for example, "S01", "S02") as a postfix to the Motors universe and MotorsOLEDB connection names to ensure a unique naming convention. Non-CSG: It is not essential to use a postfix for the universe or connection name. CSG: Provide the students with the SQL server login credentials and server name used in the classroom. Non-CSG: Students can use the sa credentials. CSG: Universes are saved in: \\My Documents\My Business Objects Universes.
4.

2.

3.

Non-CSG: The default location is in: \\Documents and


Settings\<user>\Application Data\Business Objects\Business Objects 12.0\Universes\<universe>.unv.

Objective
Deploy the Motors universe

Instructions
The Motors universe is built throughout the BusinessObjects XI 3.0/3.1: Universe Design course. This course builds on the final universe file from the BusinessObjects XI 3.0/3.1: Universe Design course. If this course is taught separate from the core Universe Design course, the final version of the BusinessObjects XI 3.0/3.1: Universe Design course needs to be deployed using the steps outlined in this activity. 1. In Universe Designer, open the Motors universe file provided in the Activity_Resources Motors_start folder in the course resources. 2. Rename the universe to Motors_xx, where "xx" stands for your initials. 3. Create a new OLE DB connection called MotorsOLEDB_xx, where "xx" stands for your initials. a. Select File Parameters Definition, and then click New below the Connection field. b. Click Next. c. Select Secured from the Connection Type drop-down list.

14

Advanced Universe DesignInstructors Guide

d. In the Connection Name field, type MotorsOLEDB_xx, where "xx" stands for your initials. e. Expand the Microsoft node, which is the target database for the connection. f. Expand the MS SQL Server 2005 node, which is the target middleware for the connection. g. Select the OLE DB Providers driver name and click Next. h. Select Use specified username and password as the authentication mode. i. In the User name and Password fields enter the database login credentials. Use the SQL Server database server credentials, as provided to you by the instructor. j. In the Server field, select or enter the appropriate SQL Server name to connect to, as provided to you by the instructor. k. In the Database field, enter Motors, which is the name of the database you are connecting to. l. Click Next twice, and click Finish. m. In the Wizard Connection dialog box, click Test to test the connection. If the connection is valid, a message dialog box appears indicating that the connection is correct. If you receive an error message, check that you entered all the parameters correctly. n. Click Finish to exit the wizard. 4. Select File Save As to save your Motors universe version locally.

Reviewing Universe Design ConceptsInstructors Guide

15

Lesson summary

(LG 9)

Instructor Note: Recap the lesson objectives with the learners to check that all learners have acquired the required skills before moving on to the next section. After completing this lesson, you are now able to: Use your universe design and BusinessObjects Universe Designer knowledge to solve business problems Describe the course universe, database data, and structure

16

Advanced Universe DesignInstructors Guide

Lesson 2

Working with Aggregate Awareness


Lesson introduction
(LG 11)

This lesson describes how you can use features in Universe Designer to define an objects SELECT statement so that you can run a query against aggregate tables in the database instead of against the base tables. You can set conditions so that a query runs against aggregate tables if doing so optimizes the query. If this is not the case, the query runs against the base tables. This ability of an object to use aggregate tables to optimize a query is called aggregate awareness. After completing this lesson, you will be able to: Define aggregate awareness Apply aggregate awareness to objects

Working with Aggregate AwarenessInstructors Guide

17

Defining aggregate awareness


Instructor Note: Define unit objectives.

(LG 12)

Aggregate awareness is a term that describes the ability of a universe to make use of aggregate tables in a database. Using aggregate tables speeds up the execution of queries, improving the performance of SQL transactions. The reliability and usefulness of aggregate awareness in a universe depends on the accuracy of the aggregate tables. They must be refreshed at the same time as all fact tables. After completing this unit, you will be able to: Understand what is meant by the term aggregate aware Understand why universes that are aggregate aware allow queries to process more efficiently

What is aggregate awareness?


Instructor Note:

(LG 12)

Describe what aggregate awareness is. Describe how the use of summary tables and aggregate awareness can improve query performance. Note: Remind students that we are using the SQL Server Motors database and Motors universe for the continuation of this course.

Summary tables
Instructor Note:

(LG 12)

Describe what summary tables are and what type of data they contain. Point out that aggregate awareness works on all tables, not just fact tables. It can also be applied to all object types with all data types, not just numbers and measures.

Summary tables and SQL


Instructor Note:

(LG 13)

Describe the effect that summary tables have on the generated SQL. Point out that making use of summary table data speeds up response times because: There are fewer rows to process. Fewer, if any, joins are required. Aggregates of a normalized database are based on event/fact level data. Describe normalization and denormalization: Database normalization is a technique for designing relational database tables to minimize duplication of information and to avoid data anomalies. Higher degrees of normalization

18

Advanced Universe DesignInstructors Guide

typically involve more tables and create the need for a larger number of joins, which can reduce performance. Denormalization is the process of taking a normalized database and modifying table structures to optimize the performance by keeping a minimum relationship between tables; one dimension table versus one fact table. Another method is to use prebuilt summarized data in the schema.

Working with Aggregate AwarenessInstructors Guide

19

Applying aggregate awareness


Instructor Note: Define unit objectives.

(LG 15)

The first step in setting up aggregate awareness in a universe is to determine which objects are to be aggregate aware. You can use either measure objects or dimension objects. After completing this unit, you will be able to: Set up aggregate aware objects Use aggregate awareness to resolve fan traps Use aggregate awareness to resolve outer join errors Test aggregate awareness in the universe

Setting up aggregate awareness


Instructor Note:

(LG 15)

Describe the four-step process of applying aggregate awareness. Use the Power Point slides provided on the course resources if required. Inform students that each of the steps is explained in turn in this unit.

To insert a summary table

(LG 15)

Demonstration: To insert a summary table


Instructor Note:

Demonstrate adding the ANNUAL_FIGURES table to your Motors universe. This demonstration represents step 1 in the aggregate awareness process. Do not insert quarter figures data as this is done during the Setting up aggregate awareness - part 1 activity. Encourage students to follow along, as these demonstration steps also represent the first steps of the Setting up aggregate awareness - part 1 activity. This demonstration continues building on the Motors universe file created in the BusinessObjects XI3.0/3.1: Universe Design course. If this course is taught directly after the core Universe Design course, use your saved Motors universe file for course demonstrations and activities. If this course is not taught directly after the core Universe Design course, ensure you have followed the steps to deploy the Motors universe as outlined in the To deploy the Motors universe demonstration. Note: The Motors universe is extended throughout this course. Save the version during each demonstration and reuse the same saved universe version for following demonstrations.
Steps 1. Values

ANNUAL_FIGURES

20

Advanced Universe DesignInstructors Guide

Steps 2.

Values

Place the table somewhere below the FRANCHISE table. In this summary table, the foreign keys are SHOWROOM_ID and MAKER_ID. These keys allow you to join the summary table to the SHOWROOM and the MAKER tables.
SHOWROOM.SHOWROOM_ID = ANNUAL_FIGURES.SHOWROOM_ID (1:N) MAKER.MAKER_ID = ANNUAL_FIGURES.SHOWROOM_ID (1:N)

3.

4.

After completing this step, save your Motors universe file.

1. Insert the required summary table(s) in the structure using the Table Browser. 2. Position the table where it is convenient for the joins you need to make. 3. Add joins from the summary table to the existing structure. You need to examine the foreign keys in the summary table to see where the summary table can be joined to the universe. 4. Set cardinality for the new joins.

To detect contexts

(LG 15)

Demonstration: To detect contexts


Instructor Note:

Demonstrate detecting contexts after adding the ANNUAL_FIGURES table to your Motors universe. This demonstration represents step 2 in the aggregate awareness process. Encourage students to follow along, as these demonstration steps also represent the first steps of the Setting up aggregate awareness - part 1 activity. Demonstrate by using your saved Motors universe file. Note: The Motors universe is extended throughout this course. Save the version during each demonstration and reuse the same saved universe version for following demonstrations.
Steps 1. 2. Values

Create a new Annual_Figures context.

1. Click Detect Contexts on the toolbar. 2. Accept the new contexts and rename them if required.

Working with Aggregate AwarenessInstructors Guide

21

Redefine the objects


Instructor Note:

(LG 16)

Inform students that after adding the new summary table(s) and by creating a new context, there is a need to redefine the objects, assuming that the objects have already been created. If you are creating a new object, simply include the @aggregate_aware function when defining the object. Inform students that the columns in the summary table containing aggregated and dimension data can be used to define object SELECT properties.

Applying aggregate awareness to objects


Instructor Note:

(LG 16)

Describe how to apply aggregate awareness to objects. Describe the @aggregate_aware function syntax and how it is applied to redefine objects.

To apply the @aggregate_aware function

(LG 17)

Demonstration: To apply the @aggregate_aware function


Demonstrate applying the @aggregate_aware function to existing objects. This demonstration represents step 3 in the aggregate awareness process. Encourage students to follow along, as these demonstration steps also represent the first steps of the Setting up aggregate awareness - part 1 activity. Demonstrate by using your saved Motors universe file. Note: The Motors universe is extended throughout this course. Save the version during each demonstration and reuse the same saved universe version for following demonstrations.
Steps 1. 2. 3. 4. @aggregate_aware(sum(ANNUAL_FIGURES.ANNUAL_SALE_COST), sum(SALE_MODEL.SALE_QTY * MODEL.MODEL_COST)) Values

Cost of Sales

5.

6. 7.

22

Advanced Universe DesignInstructors Guide

Steps 8.

Values

Number of Cars Sold:


@aggregate_aware(sum(ANNUAL_FIGURES.ANNUAL_SALE_NUMBER), sum(SALE_MODEL.SALE_QTY))

Sales Revenue:
@aggregate_aware(sum(ANNUAL_FIGURES.ANNUAL_SALE_VALUE), sum(SALE_MODEL.SALE_QTY * MODEL.MODEL_PRICE * ((100 - SALE.SALE_DISCOUNT) / 100)))

9.

Rental Revenue
@aggregate_aware(sum(ANNUAL_FIGURES.ANNUAL_RENT_VALUE), sum(RENTAL.DAYS_RENTED * RENTAL_MODEL.SALE_QTY * MODEL.MODEL_DAYRENT *((100 - RENTAL.SALE_DISCOUNT) / 100)))

Financial Year:
@aggregate_aware(ANNUAL_FIGURES.FP_YEAR, FINANCE_PERIOD.FP_YEAR)

1. Double-click the object whose properties you want to edit, or click Insert Object on the toolbar to create a new object. 2. Click >> of the Select field to open the Edit Select dialog box. The current SELECT properties for the object, if any, displays in the top panel of the dialog box. Note: It can make the structure of the SELECT statement clearer if you keep each level of the @aggregate_aware function on a separate line. 3. Click at the beginning of the existing statement, if necessary. 4. Double-click the @aggregate_aware function in the @functions list dialog box. 5. Insert the aggregate actions within the brackets of the @aggregate_aware function in order of highest to lowest level of aggregation data. Separate each action with a comma. 6. Parse the redefined objects. 7. Click OK to accept the SELECT statement. 8. Click OK to close the Edit Properties dialog box. 9. Repeat the process for all the appropriate objects.

Define incompatible objects


Instructor Note:

(LG 17)

Describe how to ensure that the @aggregate_aware function applies the correct SELECT statement, by defining object incompatibility by using the Aggregate Navigation tool.

Working with Aggregate AwarenessInstructors Guide

23

To use the Aggregate Navigation tool

(LG 18)

Demonstration: To use the Aggregation Navigation tool


Demonstrate by using the Aggregate Navigation tool. This demonstration represents step 4 in the aggregate awareness process. Encourage students to follow along, as these demonstration steps also represent the first steps of the Setting up aggregate awareness - part 1 activity. Demonstrate by using your saved Motors universe file. Note: The Motors universe is extended throughout this course. Save the version during each demonstration and reuse the same saved universe version for following demonstrations.
Steps 1. 2. 3. 4. 5. Values

ANNUAL_FIGURES Set the following objects as incompatible with the ANNUAL_FIGURES table: All objects in the Client class. Franchises in the Showroom class. Category of Car, Model in the Car class. All objects in the Sales Prices (subclass of Car) class. All objects in the Day Rental Charges (subclass of Car) class. All Rental class and subclasses objects, except Rental Revenue. All objects in the Sales Details (subclass of Sales) class. All objects in the Sales Dates (subclass of Sales) class. Financial Month and Financial Quarter in the Financial Period class. Rental Model in the hidden Where Restriction Objects class. All objects in the Staff class. Average Sales Total and Delegated Average Sales Total in the Sales Figures (subclass of Sales) class. All objects in the Annual Revenue class. In the condition pane set all conditions in the Client and Showroom classes as incompatible.

6.

7.

24

Advanced Universe DesignInstructors Guide

Steps 8.

Values

1. Identify all objects that reference the summary table(s) and associated tables included in the new context(s). Right-click each table and choose View Associated Objects. 2. Check the SQL for each associated object. Check the SELECT, WHERE clauses, and check the tables selected in the List of Tables by clicking the Tables button. Identify any object that references a table not in the summary table context as incompatible. 3. Do the same for condition objects. Note: Any objects that have an @function in their SELECT or WHERE are not picked up by the View Associated Objects option, because Universe Designer detection tools cannot look inside the parenthesis of an @function. You must use your knowledge of the universe or refer to universe documentation to identify if any of these objects need to be made incompatible/compatible. It is better to leave an object incompatible if you are not sure. 4. Select Tools Aggregate Navigation. The Aggregate Navigation dialog box displays.

In the Aggregate Navigation dialog box you can set the objects and conditions identified in step 2 and 3 as incompatible or compatible. 5. Select the summary table in the Universe Tables pane. The right pane shows the list of classes and objects that need to be checked for compatibility for the summary table you selected.

Working with Aggregate AwarenessInstructors Guide

25

6. Open each class in turn and select the check box adjacent to each object that is incompatible with the summary table and its context.

Use your familiarity with the universe to check that objects shown as compatible (that is, not checked) operate correctly and not produce Cartesian products or an incompatible combination of objects. 7. If an object is set incorrectly, clear the object by clicking it. 8. When you are satisfied with all incompatibility settings, click OK to close the Aggregate Navigation dialog box.

Demonstration: To test aggregate awareness


Instructor Note:

This demonstration is not based on a generic procedure outlined in the Learner's Guide. Demonstrate this by using your saved Motors universe file. Note: The Motors universe is extended throughout this course. Save the version during each demonstration and reuse the same saved universe version for following demonstrations. Encourage students to follow along, as these demonstration steps also represent the first steps of the Setting up aggregate awareness - part 1 activity. 1. Launch the Universe Designer Query Panel. 2. Add the Financial Year and Sales Revenue objects into the Query Panel, and view the SQL. The SQL indicates that this object uses the summary table(s). 3. Add the Financial Year, Sales Revenue, and Showroom objects into the Query Panel, and view the SQL. The SQL indicates that this object uses the summary table(s).

26

Advanced Universe DesignInstructors Guide

4. Add the Financial Year, Sales Revenue, and Financial Month objects into the Query Panel, and view the SQL. The SQL indicates that the summary table(s) are not used, as the Financial Month object is set as incompatible. Note: ANSI92 is automatically applied for all universes when using SQL Server. The sqlsvr.prm file contains a parameter that is pre-set to ANSI92.

Activity: Setting up aggregate awareness - part 1

(LG 20)

Instructor Note: Allow 15 - 20 minutes for this activity. Explain the activity objective and instructions as a bridge from the lecture to the practice. This activity continues building on the Motors universe file created in the BusinessObjects XI3.0/3.1: Universe Design course. If this course is taught directly after the core Universe Design course, students continue to use their saved Motors universe file for course demonstrations and activities. If this course is not taught directly after the core Universe Design course, ensure you have followed the steps to deploy the Motors universe as outlined in the To deploy the Motors universe activity. Note: The Motors universe is extended throughout this course. Instructors need to follow the activity steps to update their universe version that was saved during the last demonstration. The updated version of the universe file, containing the activity step changes, is used for further demonstrations in following lessons. Review the activity with the learners to ensure that they have acquired the skills outlined in the activity objective. Answers to the questions, substeps, or instructor tips are shown in the table:
Step Answer/Result

The following objects need to be set as incompatible with the ANNUAL_FIGURES table: All objects in the Client class. Franchises in the Showroom class. Category of Car, Model, in the Car class. All objects in the Sales Prices (subclass of Car) class. All objects in the Day Rental Charges (subclass of Car) class. All Rental class and subclasses objects, except Rental Revenue. All objects in the Sales Details (subclass of Sales) class. All objects in the Sales Dates (subclass of Sales) class. Financial Month, and Financial Quarter in the Financial Period class. Rental Model in the hidden Where Restriction Objects class. All objects in the Staff class. Average Sales Total, and Delegated Average Sales Total in the Sales Figures (subclass of Sales) class.

2.

Working with Aggregate AwarenessInstructors Guide

27

Step

Answer/Result

All objects in the Annual Revenue class. In the condition pane set all conditions in the Client and Showroom classes as incompatible.


3.

Showroom, Financial Year, Sales Revenue, and Rental Revenue. The SQL should use ANNUAL_FIGURES summary table. Model, Financial Year, Sales Revenue, and Rental Revenue. As Model is set to incompatible, two SELECT statements are generated, one for the rental context and one for the sales context. Financial Year, Sales Revenue, and Financial Month. The SQL should use the original fact table(s), as the Financial Month object is set as incompatible.

The following objects need to be set as incompatible with the QUARTER_FIGURES table: All objects in the Client class. Franchises in the Showroom class. All Rental class and subclasses objects. All objects in the Sales Details (subclass of Sales) class. All objects in the Sales Dates (subclass of Sales) class. Financial Month in the Financial Period class. Rental Model in the Where Restriction Objects hidden class. All objects in the Employee class. Average Sales Total, and Delegated Average Sales Total in the Sales Figures (subclass of Sales) class. All objects in the Annual Revenue class. In the condition pane set all conditions in the Client and Showroom classes as incompatible.

5.

Objectives
Insert summary tables into your Motors universe Apply aggregate awareness

Instructions
Prestige Motors management is finding that the annual and quarterly reports take a long time to run. They have requested that these reports be produced without any noticeable processing delay. Insert the ANNUAL_FIGURES and QUARTER_FIGURES summary tables into your Motors universe and make the universe aggregate aware.

28

Advanced Universe DesignInstructors Guide

Note: The steps in the activity represent some of the steps demonstrated by the instructor in the classroom. 1. In Universe Designer, open your Motors universe file. 2. Incorporate the ANNUAL_FIGURES summary table in your Motors universe and apply aggregate awareness as follows: a. Insert the ANNUAL_FIGURES table in the structure of the universe and insert the following joins and set cardinality.
SHOWROOM.SHOWROOM_ID = ANNUAL_FIGURES.SHOWROOM_ID (1:N) MAKER.MAKER_ID = ANNUAL_FIGURES.SHOWROOM_ID (1:N)

b. Detect contexts. Note: In this instance, the new joins and tables do not affect existing contexts. Do not delete or overwrite the existing contexts. c. Redefine the SELECT properties of the objects as indicated below: Rental Revenue
@aggregate_aware(sum(ANNUAL_FIGURES.ANNUAL_RENT_VALUE), sum(RENTAL.DAYS_RENTED * RENTAL_MODEL.SALE_QTY * MODEL.MODEL_DAYRENT *((100 - RENTAL.SALE_DISCOUNT) / 100)))

Sales Revenue
@aggregate_aware(sum(ANNUAL_FIGURES.ANNUAL_SALE_VALUE), sum(SALE_MODEL.SALE_QTY * MODEL.MODEL_PRICE * ((100 - SALE.SALE_DISCOUNT) / 100)))

Number of Cars Sold


@aggregate_aware(sum(ANNUAL_FIGURES.ANNUAL_SALE_NUMBER), sum(SALE_MODEL.SALE_QTY))

Cost of Car Sales


@aggregate_aware(sum(ANNUAL_FIGURES.ANNUAL_SALE_COST), sum(SALE_MODEL.SALE_QTY * MODEL.MODEL_COST))

Financial Year
@aggregate_aware(ANNUAL_FIGURES.FP_YEAR,FINANCE_PERIOD.FP_YEAR)

d. Set incompatible objects manually by using Aggregate Navigation and check the results. Note: Define the Franchises object as incompatible. 3. Save the changes and test the annual level of aggregate awareness by making these queries in Web Intelligence Rich Client. Use the following objects in your query: Showroom, Financial Year, Sales Revenue, and Rental Revenue. Model, Financial Year, Sales Revenue, and Rental Revenue. Financial Year, Sales Revenue, and Financial Month. Ensure you view the inferred SQL in each instance.

Working with Aggregate AwarenessInstructors Guide

29

4. Incorporate the QUARTER_FIGURES summary table in the Motors universe and apply aggregate awareness. Tip: You need to edit the @aggregate_aware syntax in the objects listed in step 2 to include the quarter level. In addition you need to apply the @aggregate_aware function to the Financial Quarter object. 5. Set incompatible objects manually by using Aggregate Navigation and check the results. Note: Define the Franchises object as incompatible. 6. Save the changes and test the quarter level of aggregate awareness by making three more queries in Web Intelligence Rich Client. Use the following objects in your query: Financial Year and Rental Revenue. Financial Year, Financial Quarter, and Rental Revenue. Financial Year, Financial Month, and Rental Revenue. 7. Test that the objects that are incompatible with both the ANNUAL_FIGURES and QUARTER_FIGURES summary tables infer SQL at the fact table level.

Activity: Setting up aggregate awareness - part 2

(LG 22)

Instructor Note: Allow 15 - 20 minutes for this activity. Explain the activity objective and instructions as a bridge from the lecture to the practice. Note: The Motors universe is extended throughout this course. Instructors need to follow the activity steps to update their universe version that was saved during the last demonstration. The updated version of the universe file, containing the activity step changes, is used for further demonstrations in following lessons. Review the activity with the learners to ensure that they have acquired the skills outlined in the activity objective. Answers to the questions, sub-steps, or instructor tips are shown in the table:
Step Answer/Result

YEAR_ORDERCOUNT compatible objects are: Sales\Sales Details\Order Count Sales\Sales Dates\Sales Year
8.

YEAR_QUARTER_ORDERCOUNT compatible objects are: Sales\Sales Details\Order Count Sales\Sales Dates\Sales Year Sales\Sales Dates\Sales Quarter YEAR_QUARTER_MONTH_ORDERCOUNT compatible objects are: Sales\Sales Details\Order Count

30

Advanced Universe DesignInstructors Guide

Step

Answer/Result

Sales\Sales Dates\Sales Year Sales\Sales Dates\Sales Quarter Sales\Sales Dates\Sales Month

Students should see the following SQL indicating that only 1 table (the main aggregate table YEAR_ORDERCOUNT) is being used:
12. SELECT DISTINCT YEAR_ORDERCOUNT.Year, YEAR_ORDERCOUNT."Order Count" FROM YEAR_ORDERCOUNT

Students should see the following SQL indicating that only 1 table (the main aggregate table YEAR_ORDERCOUNT) is being used:
13. SELECT DISTINCT YEAR_QUARTER_ORDERCOUNT.Year, YEAR_QUARTER_ORDERCOUNT.Quarter, YEAR_QUARTER_ORDERCOUNT."Order Count" FROM YEAR_QUARTER_ORDERCOUNT

Students should see the following SQL indicating that only 1 table (the main aggregate table YEAR_ORDERCOUNT) is being used:
14. SELECT DISTINCT YEAR_QUARTER_MONTH_ORDERCOUNT.Year, YEAR_QUARTER_MONTH_ORDERCOUNT.Quarter, YEAR_QUARTER_MONTH_ORDERCOUNT.Month, YEAR_QUARTER_MONTH_ORDERCOUNT."Order Count" FROM YEAR_QUARTER_MONTH_ORDERCOUNT

15.

If you run this query, you get an "incompatible combination of objects" error message. This is the correct behavior and occurs because the Sale Date has no aggregate awareness implemented. The two separate SQL statements are created in the query, which cannot be joined together.

Objectives
Insert standalone summary tables into the Motors universe Apply aggregate awareness

Instructions
The DBA has created some aggregate tables in SQL Server Management Studio in the form of Views. The Views are to demonstrate the concept of Data Warehouse aggregate tables. Apply

Working with Aggregate AwarenessInstructors Guide

31

an aggregate awareness solution in your Motors universe, using the Views provided. These tables are incorporated into the schema as standalone tables. 1. In Universe Designer, open your Motors universe. 2. Incorporate the three summary tables (Views) in your Motors universe as standalone tables. View table values to verify that data is returned.

3. In the Sales Details class, add a new object called Order Count. Use the select statement:
count(SALE.SALE_ID)

4. Implement aggregate awareness to the objects in the Sales Dates class. Open the Sales Year Object. Modify the SELECT statement, applying the @aggregate_aware function:
@aggregate_aware(YEAR_ORDERCOUNT.Year, YEAR_QUARTER_ORDERCOUNT.Year, YEAR_QUARTER_MONTH_ORDERCOUNT.Year, {fn year( SALE.SALE_DATE )})

5. Parse the Sales Year object to verify the modified SQL syntax. 6. Apply aggregate awareness to the Sales Quarter and Sales Month objects. The SQL used reflects similar syntax as applied in the Sales Year object. Parse the modified objects to verify that there are no errors in the SQL syntax. 7. Implement aggregate awareness to the Order Count object created in the Sales Details class. Parse the modified object syntax to ensure that there are no errors. 8. Set incompatibilities. 9. From the Tools menu launch the Query Panel. Run a query with Sales Year and Order Count.

32

Advanced Universe DesignInstructors Guide

10.Click the SQL icon. What is the result? Is this as expected, and why? 11.Edit the query and add the Sales Quarter object. Check the generated SQL. What is the result? Is this as expected, and why? 12.Edit the query and add the Sales Month object. Check the generated SQL. What is the result? Is this as expected, and why? 13.Run a new query in the Universe Designer Query Panel, using the Sale Date and Order Count objects. Check the generated SQL. What is the result? Is this as expected, and why?

Using aggregate awareness to resolve fan traps


Instructor Note:

(LG 23)

Inform students that you can use aggregate awareness to resolve fan traps. Review with students the two-table fan trap scenario. Note: This scenario has been introduced in the Resolving SQL Traps lesson in the BusinessObjects XI 3.0/3.1: Universe Design course.

To resolve a two-table fan trap using @aggregate_aware

(LG 25)

Demonstration: To resolve a two-table fan trap by using aggregate awareness


Instructor Note:

Demonstrate how to solve a two-table fan trap scenario by using aggregate awareness. This demonstration contains additional steps to the generic procedure outlined in the Learner's Guide. Demonstrate using the Fan.unv file located in the course resources. Be aware that in the CSG environment all classroom created connections and universes are stored in the same centralized repository. It is therefore necessary to give a unique name to each created connection and universe. 1. Open the Fan.unv file from Demonstration_Resources Lesson 2 folder in the course resources. 2. If you are teaching this course in a CSG environment, rename the universe in File Parameters Definition. Rename the universe to Motors_Ixx (where "xx" stands for your instructor number for example, I01 or I02). In a non-CSG environment you do not need to rename the universe.

Working with Aggregate AwarenessInstructors Guide

33

3. If you are teaching this course in a CSG environment, rename the universe in File Parameters Definition.Rename the universe to Fan_Ixx (where "xx" stands for your instructor number for example, I01 or I02). In a non-CSG environment you do not need to rename the universe. 4. Ensure that your Fan universe points to the Motors SQL Server 2005 database. For CSG: Use the MotorsOLEDB_ins connection. CSG: Use the MotorsOLEDB_Ixx connection (where "xx" stands for your instructor number for example, I01 or I02). Non-CSG: Use the MotorsOLEDB connection. 5. (Optional) Demonstrate the effect of the two-table fan trap in Web Intelligence Rich Client prior to resolving the trap using aggregate awareness: a. Ensure the Multiple SQL for each measure option is not selected. b. Save your Fan universe file locally to make it available in Web Intelligence Rich Client. This universe connects to the Motors database. c. In Web Intelligence Rich Client, create the following queries: Drag Sale.Sale_ID and Sales Revenue into the Result Objects pane. Apply a Quick Filter to Sale.Sale_ID for the value 1143. Click Add Query. Drag Sale_Model.Sale_ID and Number of Cars Sold into the Result Objects pane. Apply a Quick Filter to Sale_Model.Sale_ID for the value 1143. Click Add Query Drag Sale.Sale_ID,Sales Revenue, and Number of Cars Sold into the Result Objects pane. Apply a Quick Filter to Sale.Sale_ID for the value 1143. Note: The sales revenue of the first query is less than the sales revenue for the third query and indicates the fan trap issue. d. Edit the third query and add the Model ID object. This displays two ID values, and is the reason for the duplication of the sales revenue value. 6. Solve the fan trap using aggregate awareness. Create SALE_ALIAS table in your Fan universe. 7. Create a join between the SALE and the SALE_ALIAS tables.
SALE_ALIAS.SALE_ID = SALE.SALE_ID

8. Set cardinality. SALE_ALIAS (N) : SALE (1). 9. Create two contexts: Context 1:
SALE.SALE_ID = SALE_MODEL.SALE_ID SALE.SALE_TYPE = 'S'

Context 2:
SALE.SALE_ID = SALE_ALIAS.SALE_ID SALE_ALIAS.SALE_TYPE = 'S'

34

Advanced Universe DesignInstructors Guide

10.Apply the @aggregate_aware function to the Sales Revenue object (the first choice referring to SALE table and then the SALE_ALIAS). 11.Make the Number of Cars Sold of object incompatible with SALE table. 12.Save you Fan universe file and test the results in Web Intelligence Rich Client: Drag Sale.Sale_ID and Sales Revenue into the Result Objects pane. Apply a Quick Filter to Sale.Sale_ID for the value 1143. Click Add Query. Drag Sale_Model.Sale_ID and Number of Cars Sold into the Result Objects pane. Apply a Quick Filter to Sale_Model.Sale_ID for the value 1143. Click Add Query Drag Sale.Sale_ID,Sales Revenue, and Number of Cars Sold into the Result Objects pane. Apply a Quick Filter to Sale.Sale_ID for the value 1143. Note: The sales revenue values are now correct for all three queries - the fan trap has been resolved. 13.Edit the third query and add the Model ID object. The result are still correct.

Outer joins and aggregate awareness


Instructor Note:

(LG 25)

Describe the outer join scenario concept. Describe that depending on the RDBMS, the BusinessObjects querying tool may generate an error or produce incorrect results. Note that in SQL Server the correct results are returned, however in Oracle no null values are retrieved, and in some databases, MS Access for example, an ambiguous join error is produced at query level. If required indicate this scenario on the white board. There is no demonstration for this as SQL Server return the correct results.

Working with Aggregate AwarenessInstructors Guide

35

Quiz: Working with aggregate awareness

(LG 28)

1. How does the @aggregate_aware function improve query performance? Answer: It directs the query to run against aggregate tables or summary tables, whenever possible. 2. Why does using summary table data speed up response times? Answer: There are fewer rows to process. Value calculation is not required. Fewer, if any, joins are required. 3. The tool you use in Universe Designer to set incompatibilities between objects and tables in the structure of the universe is called the ___________________ tool. Answer: Aggregate Navigation

36

Advanced Universe DesignInstructors Guide

Lesson summary

(LG 29)

Instructor Note: Recap the lesson objectives with the learners to check that all learners have acquired the required skills before moving on to the next section. After completing this lesson, you are now able to: Define aggregate awareness Apply aggregate awareness to objects

Working with Aggregate AwarenessInstructors Guide

37

38

Advanced Universe DesignInstructors Guide

Lesson 3

Designing Advanced Objects


Lesson introduction
Instructor Note: Define unit objectives. You can create advanced objects that aid users in answering more specific questions in their reports. This lesson also looks at how database functions can be combined to create complex objects, how you can create relative date-time objects and how you can utilize analytic SQL functions, known as Transact_SQL functions in SQL Server. Note: The database functions mentioned and used in this lesson are for SQL Server. Refer to the SQL syntaxes for other RDBMS appendix for the equivalent functions and syntaxes in Oracle, DB2, or MySQL. After completing this lesson, you will be able to: Combine database functions in objects Construct relative date-time objects (LG 31)

Designing Advanced ObjectsInstructors Guide

39

Combining database functions in objects


Instructor Note: Discuss the unit objectives.

(LG 32)

Initially, universes may only contain the basic dimension and detail objects that reflect the tables and column names in the universe structure, together with some more advanced measure objects that combine columns for aggregation of revenue or cost. When end users start building reports based on this universe, it may turn out that several business questions cannot be answered using the available objects. This often results in having end users define variables and complex formulas in their reports to get the required information shown. As a designer, it is important to identify what type of additional object functionality is needed to allow end users to generate the data in their report. In many cases instead of using report variables and functions, these reporting needs can be added in the universe in the form of more advanced objects. This unit describes a number of frequently used methods for creating complex objects. After completing this unit, you will be able to: Use and combine database functions in objects Create static and dynamic data ranges

Using database functions in objects


Instructor Note:

(LG 32)

Introduce the SQL functions available in Universe Designer. Edit one of the objects in the Motors universe and select the >> button in the Select field. The available functions will appear in the Function list in Number, Character, Date, and @Functions categories. Introduce the Charindex, Length, Left, Right, and Substring functions, as outlined in the Learner's Guide. Provide a scenario of when you can use these functions, for extracting data from a string value. Note: Charindex is used in the Learner's Guide example. Some database can use a Pos function to look for the position of a value in a string. Remember that these are examples to show that you can extend object syntaxes by combining several database functions. With the vast availability of different SQL functions, and depending on the RDBMS used, other combined function solutions can be used to illustrate the same. Introduce the Ceiling, Floor, Round, and CAST functions, as outlined in the Learner's Guide. Provide a scenario of when you can use these functions, for an age range object. Introduce the CASE statement, as outlined in the Learner's Guide.

40

Advanced Universe DesignInstructors Guide

Note: Inform students that functions mentioned in this lesson are based on SQL Server. A list of equivalent functions for Oracle, DB2, and MySQL are listed in the SQL syntaxes for other RDBMS appendix. Note: The PRM file is mentioned in this lesson. Refer students to the Data Access Files appendix for more information. Further information on these data access files can be found in the BusinessObjects XI 3.0/3.1: Data Access Guide

Demonstration: To create a data range object


Instructor Note:

This demonstration is not based on a generic procedure in the Learner's Guide. Students need to see this demonstration to be able to complete the Combining database functions in objects activity. Demonstrate using your saved Motors universe file. Note: The Motors universe is extended throughout this course. Save the version during each demonstration and reuse the same saved universe version for following demonstrations. 1. In the Client class, add a new Client Age object based on the CLIENT.CLIENT_AGE column. 2. Create a new object called Age Range that shows the age range in the format of, for example, 40 - 49. The Age Range object is set as a Character type object, as it uses the CAST function to combine a lower and upper age range formulas. 3. Add the following SELECT statement to the new Age Range object:
CAST((floor(CLIENT.CLIENT_AGE/10)*10) as varchar)+'-'+ CAST((((floor(CLIENT.CLIENT_AGE/10)+1)*10)-1) as varchar)

Note: Ensure that all brackets are in place, otherwise the formula does not parse. Note: The CAST function is not listed in the function list. This illustrates that you can use function syntax that is supported by the RDBMS that holds the data. Parse the syntax to ensure this returns no errors. Note: Inform students that it is also possible to make this a dynamic range object. Students create this in the Database functions in objects activity. 4. Explanation of the SELECT string in Age Range:
floor(CLIENT.CLIENT_AGE/10)*10:

This part of the formula represents the lower range value is created by dividing the CLIENT.CLIENT_AGE value by 10, and by rounding the value down to the integer by using the floor function. If the CLIENT.CLIENT_AGE value is 44, this results in a value of 4. To complete the lower range value syntax, it is multiplied by 10.
(((floor(CLIENT.CLIENT_AGE/10)+1)*10)-1):

This part of the formula represents the upper range value. It is done in the same way as the lower range, but a value of 1 is added before multiplying by 10. After multiplying it

Designing Advanced ObjectsInstructors Guide

41

by 10, it is subtracted by 1. If the CLIENT.CLIENT_AGE value is 44 then this results in a value of 49.
CAST( as varchar)

Combined this gives the two range values, but they now need to be combined to create a range of "40-49". As the floor function is numeric, it needs to be converted to character to be able to place the hyphen in between. 5. Save the changes in your Motors universe locally. 6. Create a new Web Intelligence Rich Client document, using Client Name, Age, and Age Range.

Demonstration: To extract data from strings


Instructor Note:

This demonstration is not based on a generic procedure in the Learner's Guide. Students need to see this demonstration to be able to complete Combining database functions in objects activity. Demonstrate using your saved Motors universe file. Note: The Motors universe is extended throughout this course. Save the version during each demonstration and reuse the same saved universe version for following demonstrations. 1. Open your saved Motors universe in Universe Designer. 2. Navigate to the Area Code detail object in the Client class and display the list of values. Scenario: End users need an object that displays only the first group of values (up to the space) of a Postal Code, representing the local Area Code. For example, "SL6", "W1" or "NW6". However, the group of values can be either two or three characters long ("W1", or "NW6"). This can pose a problem with using the left or substring function as it is unknown how many character values need to be extracted. The common delimiter is the space or hyphen that separates the first part of the ZIP code, or Postal Code, from the second. If the position of the space is known, then this can be the deciding factor of how many values to extract from the left-hand side. To establish the position of the space in this string, charindex can be used. 3. Edit the object Area Code and modify the SELECT statement with the following syntax:
charindex(' ', CLIENT.CLIENT_AREA_CODE)

4. Change the object to Number type. 5. Parse the object, click Apply, and Display. Refresh the LOV. The values returned indicate where the space is located in the different Area Code values. 6. Edit the Area Code object again, and modify the syntax to:
CASE charindex(' ', CLIENT.CLIENT_AREA_CODE) WHEN 0 THEN CLIENT.CLIENT_AREA_CODE ELSE

42

Advanced Universe DesignInstructors Guide

rtrim(substring(CLIENT.CLIENT_AREA_CODE,1,charindex(' ', CLIENT.CLIENT_AREA_CODE))) END

Note: The rtrim function is used to remove the space (on the right) from the substring. 7. Explanation of the SELECT string in Area Code:
charindex(' ', CLIENT.CLIENT_AREA_CODE):

This part of the formula locates the position of the dividing space.
substring(CLIENT.CLIENT_AREA_CODE,1,charindex(' ', CLIENT.CLIENT_AREA_CODE)):

This part of the formula extracts the first part of the area code values (including the space delimiter). Note: Some of the area code values only have the first part displayed in the original Area Code object. When using charindex the space position is zero. These area codes are now excluded from the LOV.
rtrim(substring(CLIENT.CLIENT_AREA_CODE,1,charindex(' ', CLIENT.CLIENT_AREA_CODE))):

The rtrim function is used to remove the space (on the right) from the substring.
CASE WHEN THEN ELSE END:

Some of the area code values only have the first part displayed in the original Area Code object. When using charindex the space position is zero. These area codes are now excluded from the LOV. The CASE function identifies if the charindex result is zero. If this is the case then the syntax is to take the original area code value, otherwise extract the values up to the space delimiter. 8. Click Apply and OK. 9. Display the LOV. Click Refresh to display the new list. 10.As the universe has Aggregate Awareness assigned, it is good practice to set any new objects to be either compatible or incompatible with these tables. In this instance, Client Age is a new object in the client class. Ensure that the client class is incompatible with the annual figures, quarter figures, year order count, year quarter order count, and year quarter month order count tables. 11.Save the changes to the universe.

Activity: Combining database functions in objects

(LG 36)

Instructor Note: Allow 20 - 30 minutes for this activity. Explain the activity objective and instructions as a bridge from the lecture to the practice. Note: The Motors universe is extended throughout this course. Instructors need to follow the activity steps to update their universe version that was saved during the last demonstration. The updated version of the universe file, containing the activity step changes, is used for further demonstrations in following lessons.

Designing Advanced ObjectsInstructors Guide

43

Review the activity with the learners to ensure that they have acquired the skills outlined in the activity objective. Answers to the questions, sub-steps, or instructor tips are shown in the table(s):
Instructions: Create a data range object Step Answer/Result

Age Range:
2. CAST((floor(CLIENT.CLIENT_AGE/10)*10) as varchar)+'-'+ CAST((((floor(CLIENT.CLIENT_AGE/10)+1)*10)-1) as varchar)

Dynamic Age Range:


5. CAST((floor(CLIENT.CLIENT_AGE/(@prompt('Enter Range Increment','N',,,)))* (@prompt('Enter Range Increment','N',,,))) as varchar)+' - ' + CAST((((floor(CLIENT.CLIENT_AGE/(@prompt('Enter Range Increment','N',,,)))+1)* (@prompt('Enter Range Increment','N',,,)))-1) as varchar)

Instructions: Extract data from a string Step Answer/Result

Phone Area Code:


1. CASE charindex('(',CLIENT.CLIENT_PHONE_NO) WHEN 0 THEN CLIENT.CLIENT_PHONE_NO ELSE substring(CLIENT.CLIENT_PHONE_NO,charindex('(', CLIENT.CLIENT_PHONE_NO),charindex(')',CLIENT.CLIENT_PHONE_NO)) END

Note: There may be other solutions possible to achieve this. SQL syntaxes are provided in the Activity_Resources folder on the course resources.

Objectives
Create a data range object Extract data from a string

Instructions: Create a data range object


The end user would like to be able to run a query showing the customer age and the age range the customer falls into. For example, 10-19, 20-29, 30-39, and so forth. Using the floor and CAST functions, create an Age Range object based on the CLIENT.CLIENT_AGE column. 1. Add a new Client Age object in the Client class. 2. Create a new age range object, using a range band of 10.

44

Advanced Universe DesignInstructors Guide

For example, the range object needs to show the lower range value of 40, and the upper range value of 49, when the CLIENT.CLIENT_AGE value is 44. Note: Ensure that the brackets are in the right location to get the correct calculation order. 3. Click Apply and OK to save the object changes. 4. Test the new object in Web Intelligence Rich Client. 5. In Universe Designer create a copy of the Age Range object. Rename the object Dynamic Age Range. 6. Edit the Dynamic Age Range SELECT syntax. Replace the value 10 by the following @prompt function syntax:
(@prompt('Enter Range Increment','N',,,))

The formula used in the object now becomes:


CAST((floor(CLIENT.CLIENT_AGE/(@prompt('Enter Range Increment','N',,,)))*(@prompt('Enter Range Increment','N',,,))) as varchar) +' - '+CAST((((floor(CLIENT.CLIENT_AGE/(@prompt('Enter Range Increment' ,'N',,,)))+1)*((@prompt('Enter Range Increment','N',,,)))-1) as varchar)

Note: Remember that it is useful to add a help text for this type of object to let the end user know what type of value they are expected to fill into the prompt. For example, in this case it can be noted that the end user can enter into the prompt values like 5, 10, 15, 20, and so forth. 7. Click Apply and OK to save the object changes. 8. As the universe has Aggregate Awareness assigned, it is good practice to set any new objects to be either compatible or incompatible with these tables. In this instance, Age Range is a new object in the client class. Ensure that the client class is incompatible with the annual figures, quarter figures, year order count, year quarter order count, and year quarter month order count tables. Save the change to your universe. 9. Test the results in Web Intelligence Rich Client.

Instructions: Extract data from a string


This activity can be completed using a combination of functions like: CASE, left, right, length, substring, or charindex. 1. Using any combination of the functions mentioned above in combination with the CASE statement, create a new Phone Area Code object that extracts the area code value from the Phone NO. If there is no area code value ensure the entire Phone NO is displayed. 2. As the universe has Aggregate Awareness assigned, it is good practice to set any new objects to be either compatible or incompatible with the summary tables used in your schema. Save the change to your universe.

Designing Advanced ObjectsInstructors Guide

45

Working with analytic functions


Instructor Note:

(LG 38)

Describe that Universe Designer supports the use of analytic functions for specific RDBMS. Describe that end users can use analytic functions to perform data analysis that is not normally possible within the reporting capabilities of the BusinessObjects reporting tools.

What are analytic functions?


Instructor Note:

(LG 38)

Discuss analytic functions with the focus on utilizing Ranking in objects. Analytic functions are called RISQL functions in RedBrick, OLAP functions in Teradata, and are known as Transact_SQL functions in SQL Server. Describe the Row_Number and Rank analytic functions. Describe that in addition to the ranking options, you can use the Over () and Partition By() elements in combination with aggregate functions like Count, Sum, Min, Max and Average. Note: Aggregate functions only work when certain parameters have been defined in the PRM file. They do not work by typing directly in the Select field. No data is retrieved in the report. The same goes with combining the row and rank values with an aggregate.

Demonstration: To create objects using analytic functions (Optional)


Instructor Note:

Demonstrate adding the ROW_NUMBER function your Motors universe in Universe Designer. This demonstration is not based on a generic procedure in the Learner's Guide. Demonstrate using the saved Motors universe file. Note: The Row Number object is no longer used in further demonstrations and activities and can be removed from the universe at the end of this demonstration. 1. Open your Motors universe. 2. Create a new Row Number detail object in the Client class. Associate the detail with the Client Name dimension. Set the data type to numeric. 3. Enter the following syntax directly into the Select field box:
Row_Number() Over (Partition By 1 Order By (CLIENT.CLIENT_LASTNAME))as Row_Number

Note that Client Lastname is used for the Order By clause. 4. Save the changes. (The syntax may not parse in the universe but still runs correctly in a Web Intelligence Rich Client query)

46

Advanced Universe DesignInstructors Guide

5. Launch Web Intelligence Rich Client and create a new query using Client Name and Row Number. Each row is now provided with a row number value.

Designing Advanced ObjectsInstructors Guide

47

Constructing relative date-time objects


Discuss the unit objectives.

(LG 41)

Every universe has a need for relative time objects that end users can use to make calculations based on current dates or based on a prompted dynamic period. This unit looks at how you can create different types of relative date-time objects. After completing this unit, you will be able to: Create relative date-time objects based on a prompted period Create current date-time objects Create YTD objects

Date functions in objects


Instructor Note:

(LG 41)

Introduce the date SQL functions available in Universe Designer. Edit one of the objects in your Motors universe. Discuss how SQL functions are used for dates. Consult the Learner's Guide for examples on how date functions are used to construct date objects. Look under the Date functions in objects heading for more information. Explain that depending on the function used, the data returned can be a number value or string value. This section emphasizes on date functions that return a numeric value. Functions mentioned here are for SQL Server. Refer to the SQL syntaxes for other RDBMS appendix for the equivalent functions in Oracle, DB2, or MySQL.

Relative date-time objects


Instructor Note:

(LG 43)

Discuss how you can construct relative date-time objects. Consult the Learner's Guide for more information under the Relative date-time objects heading. Note: Prompt for discussion. Students may have other ideas on making these objects. Discuss the use of the @select function when constructing complex objects. Discuss the use of @prompt in complex objects.

CASE statements in measure objects


Instructor Note:

(LG 44)

Describe how you can use the CASE statement to construct "If Then Else" logic, and create objects that compare date function syntaxes with existing database columns. Describe how you can incorporate the @prompt and @select functions in CASE statements.

48

Advanced Universe DesignInstructors Guide

Activity: Constructing relative date-time objects

(LG 46)

Instructor Note: Allow 20 - 30 minutes for this activity. Explain the activity objective and instructions as a bridge from the lecture to the practice. Note: The Motors universe is extended throughout this course. Instructors need to follow the activity steps to update their universe version that was saved during the last demonstration. The updated version of the universe file, containing the activity step changes, is used for further demonstrations in following lessons. Note: The Sales Date Prompt object contains an @prompt syntax in the SELECT clause. Normally an @prompt is handled in the WHERE clause and the SELECT contains the table.column reference. For the purpose of feeding through the prompted value into other object SELECT clauses using the @select function, the @prompt requires to be placed in the Sales Date Prompt object SELECT clause. Placing the prompt in the WHERE clause, results in incorrect data returned in the activity. Note: The table reference for the Sales Date Prompt object is set via the Tables button. The @prompt syntax only parses when it is set to a Character type. It is viewed as constant, as there is no date column referenced. Setting the object to character type does not affect the outcome of the activity. Review the activity with the learners to ensure that they have acquired the skills outlined in the activity objective.

Objectives
Create relative date-time reference objects Use the reference objects as a base to build relative date-time measures

Instructions
Prompt objects are constructed using database date functions, to return an input base for end users to enter a year, month, or a full date value. These prompted values are compared to the actual database date column (or datepart), for example SALE.SALE_DATE. A CASE statement can be used to compare the prompted period with the actual database column period, and build boolean "reference" objects, or "flags" that can be used to build relative date-time measures objects. If the prompted period input value matches the actual database column period, the CASE statement returns a 1 value. After creating the boolean flags, the final stage is to build the relative date-time measure objects. For each 1 value of the boolean flag, the relative date-time measure value is returned. Note: This activity uses the @select function to reference already created objects. The @select function is an internal function that allows you, as the designer, to reuse universe objects without forcing you to repeat the entire SQL syntax. The @select syntax used in this activity can be generated by selecting the objects and functions in the Edit Select menu. 1. In Universe Designer, open your Motors universe file.

Designing Advanced ObjectsInstructors Guide

49

2. Create a new YTD Date Objects subclass in the Sales class. 3. Create the following sale date prompt objects in the YTD Date Objects subclass. Sales Date Prompt:
@prompt('Select Date or Type Date (dd/mm/yyyy)','D','Sales Dates\Sale Date',mono,free)

SELECT

syntax:

Note: The Sales Date Prompt object contains an @prompt syntax in the SELECT clause. Normally an @prompt is handled in the WHERE clause and the SELECT contains the table.column reference. For the purpose of feeding through the prompted value into other object SELECT clauses using the @select function, the @prompt requires to be placed in the Sales Date Prompt object SELECT clause. The table reference is set via the Tables button. The @prompt syntax only parses when it is set to a Character type. It is viewed as constant, as there is no date column referenced. Setting the object to Character type does not affect the outcome of the activity.

Description:

Prompts the user to choose a sales date from the list of values or manually type in a date value (YYYYMM). Character (see Note above for details).

Type: Tables button:

Select SALE as the reference table.

Sales Year Prompt:


SELECT datepart(yyyy,@select(YTD Date Objects\Sales Date Prompt))

syntax:

Description: Type:

Subtracts the year from the entered sales date prompt value. Number

Sales Month Prompt:


SELECT

datepart(mm,@select(YTD Date Objects\Sales Date Prompt))

syntax: Description: Subtracts the month from the entered sales date prompt value.

50

Advanced Universe DesignInstructors Guide

Type:

Number

4. In the YTD Date Objects subclass, create the following indicator or boolean flag objects that are used to create relative date-time measure objects in the remaining activity steps. Note: The boolean flag objects need to be hidden. They should not be used by end users as objects on their own. Tip: The @select statements shown in the table can be generated by selecting the objects and functions in the Edit Select menu.
Sales Date in Prompt flag SELECT syntax CASE WHEN @select(Sales Dates\Sales Year) = @select(YTD Date Objects\Sales Year Prompt) AND @select(Sales Dates\Sales Month) = @select(YTD Date Objects\Sales Month Prompt) THEN 1 ELSE 0 END Description

Indicator that returns 1 if both the year and the month of the sales date are equal to the year and month in the entered prompt date. Otherwise it returns 0.

Sales Month in Prompt flag SELECT syntax CASE WHEN sign(@select(Sales Dates\Sales Year)+1 @select(YTD Date Objects\Sales Year Prompt)) = 0 AND sign(@select(Sales Dates\Sales Month) @select(YTD Date Objects\Sales Month Prompt)) = 0 THEN 1 ELSE 0 END Description

Indicator that returns 1 if the year of the sales date equals the year in the entered prompt date minus one year, and the month of the sales date equals the month of the reference period. Otherwise it returns 0.

Sales Year in Prompt flag SELECT syntax CASE WHEN @select(Sales Dates\Sales Year) = @select(YTD Date Objects\Sales Year Prompt) AND sign(@select(Sales Dates\Sales Month) (@select(YTD Date Objects\Sales Month Prompt)-1) = 1 THEN 1 ELSE 0 END Description

Indicator that returns 1 if the month of the sales date <= sales month prompt, and the year of the sales date is equal to the sales year prompt. Otherwise it returns 0.

Designing Advanced ObjectsInstructors Guide

51

Note: The first part of the Sales Year in Prompt flag statement compares the year values. If the year selected in the prompt matches the year value in the date this returns the sale date values for those rows. The second part of the statements subtracts the month value selected in the prompt(-1) from each value in the sale date rows returned. The sign function does the following: if the subtraction value is a minus value it returns -1, if the subtraction value ends in 0 it returns 0, if the subtraction value ends up in a positive value, it returns 1. If a sale date of 4/3/2004 is selected in the prompt, the datepart(mm) changes this to a value of 4. The -1 part of the formula changes this value to 3 as the prompt input value. When the prompted period value (3) is subtracted from the month value (4) a positive value is returned and ends in 1. With the CASE statement this ensures that month 4 is included in the values returned. 5. Hide the entire YTD Date Objects subclass. 6. Create a new YTD Measure Objects subclass in the Sales class. 7. Create the following relative date-time measure objects in the YTD Measure Objects subclass: Tip: The @select statements shown in the table can be generated by selecting the objects and functions in the Edit Select menu.
Measure Object SELECT Syntax sum(SALE.SALE_TOTAL)

Sales Total Total Sales in prompted yyyy-mm period Total Sales in prompted year period Total Sales in prompted year period - 1yr

sum((SALE.SALE_TOTAL)* @select(YTD Date Objects\Sales Date in Prompt flag))

sum((SALE.SALE_TOTAL)* @select(YTD Date Objects\Sales Year in Prompt flag))

sum((SALE.SALE_TOTAL)* @select(YTD Date Objects\Sales Month in Prompt flag))

8. As the universe has aggregate awareness assigned, it is good practice to set any new objects to be either compatible or incompatible with the summary tables used in your schema. Ensure that the YTD Measure Objects and YTD Date Objects are incompatible with the annual figures, quarter figures, year order count, year quarter order count, and year quarter month order count tables. Save the change to your universe. 9. Save the changes and test your universe using Web Intelligence Rich Client.

52

Advanced Universe DesignInstructors Guide

10.Create a new query using Sale Date, Sales Total, and Total Sales in prompted yyyy-mm period. 11.Select a date from the LOV. The Total Sales in prompted yyyy-mm period object returns only sales data for the month and year values that equal the month and year values entered in the prompt, all other rows return 0. This way end users can compare the total sales revenue for all dates to the sales revenue returned for the selected yyyy-mm period. 12.Run a second query using the Sale Date, Sales Total, and Total Sales in prompted year period objects. 13.Select a date from the LOV. Note: There is no data for 2002, so ensure to select a date from 2004 or 2005 to see the last year values. The Total Sales in prompted year period object returns only sales data for the month and year values that equal the month and year values entered in the prompt. All other rows return 0. 14.Run a new query using the Sale Date, Sales Total, and Total Sale - 1yr objects. 15.Select a date from the LOV. Note: There is no data for 2002, so ensure to select a date from 2004 or 2005 to see the last year values. The Total Sales in prompted year period - 1yr object returns only sales data for the month and year values that equal the month and year values entered in the prompt minus 1 year. All other rows return 0.

Moving averages
Instructor Note:

(LG 50)

Describe what a moving average is and how it is generally used. Describe what is needed to create a moving average in a universe.

Demonstration: To create a moving average through time


Instructor Note:

Demonstrate how to create a moving average for Sale Total. This demonstration is not based on a generic procedure in the Learner's Guide. Students need to see this demonstration to be able to complete the Creating a moving average activity. Be aware that the steps are different in the CSG and non-CSG environment. the CSG environment, all classroom-created connections and universes are stored in the same centralized repository. It is therefore necessary to give a unique name to each connection

Designing Advanced ObjectsInstructors Guide

53

and universe that are created. The demonstration indicates the different steps required in both environments. Remind students that the Sale Mat, YTD Measure objects, and YTD Date objects need to be made incompatible with Annual Figures, Quarter Figures, Year_Quarter_Month_Order_Count, Year_Quarter_Order_Count, and Year_Order_Count tables. 1. Create a new universe. CSG: SaleMAT_Ixx (where "xx" stands for your instructor number e.g. I01 or I02). Use the MotorsOLEDB_Ixx connection. Non-CSG: SaleMAT. Use the MotorsOLEDB connection. 2. Insert the SALE and FINANCE_PERIOD tables into the universe. Join the table using a theta-join (N - 1).
SALE.SALE_DATE between FINANCE_PERIOD.FP_START and FINANCE_PERIOD.FP_END

3. Create an alias for the SALE table. Call the table SALE_MAT. 4. Create a new Derived Table, called DT_Date_N_Periods, using the following syntax:
SELECT Distinct FINANCE_PERIOD.FP_YEAR, FINANCE_PERIOD.FP_MONTH, dateadd(month,-@prompt('How many periods?','N',,,,),FINANCE_PERIOD.FP_END) as START_N_PERIODS, FINANCE_PERIOD.FP_START, FINANCE_PERIOD.FP_END FROM FINANCE_PERIOD

5. Join the SALE_MAT table to the DT_Date_N_Periods table using a theta-join (N - 1).
SALE_MAT.SALE_DATE between DT_Date_N_Periods.START_N_PERIODS and Date_N_Periods.FP_END

6. Add a self-restricting join on the SALE and SALE_MAT alias table for SALE_TYPE = 'S'. 7. Join the DT_Date_N_Periods table to the FINANCE_PERIOD table using a complex join (1 - 1).
DT_Date_N_Periods.FP_YEAR = FINANCE_PERIOD.FP_YEAR and DT_Date_N_Periods.FP_MONTH = FINANCE_PERIOD.FP_MONTH

8. Your universe structure should look like this:

54

Advanced Universe DesignInstructors Guide

9. Create two contexts, one for SALE, and one for SALE_MAT. SALE context
SALE.SALE_DATE between FINANCE_PERIOD.FP_START and FINANCE_PERIOD.FP_END SALE.SALE_TYPE = 'S'

SALE_MAT context
SALE_MAT.SALE_DATE between DT_Date_N_Periods.START_N_PERIODS and DT_Date_N_Periods.FP_END DT_Date_N_Periods.FP_YEAR = FINANCE_PERIOD.FP_YEAR and DT_Date_N_Periods.FP_MONTH = FINANCE_PERIOD.FP_MONTH SALE_MAT.SALE_TYPE = 'S'

10.Create a Sale_MAT class and add the following objects: Sales Total
sum(SALE.SALE_TOTAL)

Sales Total N Periods


sum(SALE_MAT.SALE_TOTAL)

Sales Total MAT


sum(SALE_MAT.SALE_TOTAL)/@prompt('How many periods?','N',,,,)

Financial Year
FINANCE_PERIOD.FP_YEAR

Financial Month
FINANCE_PERIOD.FP_MONTH

11. Select File Save As, and click Save to save your universe in the local universe directory. Be aware that the location for locally saved universes is different in the CSG and the non-CSG environment.

Designing Advanced ObjectsInstructors Guide

55

CSG: Universes are saved in: \\My Documents\My Business Objects Universes. Non-CSG: The default location is in: \\Documents and Settings\<user>\Application Data\Business Objects\Business Objects 12.0\Universes\<universe>.unv. 12.Test your universe in Web Intelligence Rich Client. Use all created objects in a table. 13.When prompted to enter the period value, enter 2.

The report displays the original sales values in the Sales Total column, and the Sales Total N Periods column shows the accumulated values based on the number of periods. In our example this is 2, so for the Month 02 row we get 551,172, which represents the sales total values of 385,235 + 165,937. For Month 03 this is 485,979 + 165,937, and gives a result of 651,916. The Sales Total MAT column shows the accumulated values divided by the number of periods, for example, 551,172/ 2 = 275,586.

56

Advanced Universe DesignInstructors Guide

Activity: Creating a moving average

(LG 53)

Instructor Note: Allow 15 - 20 minutes for this activity. Explain the activity objective and instructions as a bridge from the lecture to the practice. Note: The Motors universe is extended throughout this course. Instructors need to follow the activity steps to update their universe version that was saved during the last demonstration. The updated version of the universe file, containing the activity step changes, is used for further demonstrations in following lessons. Review the activity with the learners to ensure that they have acquired the skills outlined in the activity objective. Answers to the questions, substeps, or instructor tips are shown in the table:
Step Answer/Result

Context Name: SALES_MAT Joins included in context:


REGION.REGION_ID=CLIENT.REGION_ID MODEL.MODEL_PRICE between SALES_PRICE_RANGE.PRICE_RANGE_MIN and SALES_PRICE_RANGE.PRICE_RANGE_MAX SALE_MODEL.COLOUR_ID=COLOUR.COLOUR_ID SALE_MODEL.MODEL_ID=MODEL.MODEL_ID MODEL.STYLE_ID=STYLE.STYLE_ID MODEL.MAKER_ID=MAKER.MAKER_ID COUNTRY_SHOWROOM.COUNTRY_ID=SHOWROOM.COUNTRY_ID MAKER.COUNTRY_ID=COUNTRY_MAKER.COUNTRY_ID REGION.COUNTRY_ID=COUNTRY_REGION.COUNTRY_ID DT_Best_Cust.CLIENT_ID=CLIENT.CLIENT_ID DT_Best_Cust.CLIENT_ID=DT_Nested.CLIENT_ID EMPLOYEE.EMP_MGR_ID=MANAGER.EMP_ID EMPLOYEE.EMP_ID=CLIENT.EMPLOYEE_ID SALE_MAT.SALE_DATE between DT_Date_N_Periods.START_N_PERIODS and DT_Date_N_Periods.FP_END FINANCE_PERIOD.FP_YEAR=DT_Date_N_Periods.FP_YEAR and FINANCE_PERIOD.FP_MONTH=DT_Date_N_Periods.FP_MONTH CLIENT.CLIENT_ID=SALE_MAT.CLIENT_ID SHOWROOM.SHOWROOM_ID=SALE_MAT.SHOWROOM_ID SALE_MAT.SALE_ID=SALE_MODEL.SALE_ID SALE_MAT.SALE_TYPE='S'

6.

Objectives
Create moving average objects Test the moving average objects in Web Intelligence Rich Client

Instructions
1. In your Motors universe create a SALE_MAT alias table. Note: The self-restricting join for the SALE.SALE_TYPE column needs to be manually created for the SALE_MAT alias table.

Designing Advanced ObjectsInstructors Guide

57

2. Create a new Derived Table, called DT_Date_N_Periods, using the following syntax:
SELECT Distinct FINANCE_PERIOD.FP_YEAR, FINANCE_PERIOD.FP_MONTH, dateadd(month,-@prompt('How many periods?','N',,,,),FINANCE_PERIOD.FP_END) as START_N_PERIODS, FINANCE_PERIOD.FP_START, FINANCE_PERIOD.FP_END FROM FINANCE_PERIOD

3. Join the DT_Date_N_Periods table to the SALE_MAT table using a theta-join; using the START_N_PERIODS, FP_END, and SALE_DATE columns.
SALE_MAT.SALE_DATE between DT_Date_N_Periods.START_N_PERIODS and DT_Date_N_Periods.FP_END (N:1)

4. Join the DT_Date_N_Periods table to the FINANCE_PERIOD table using a complex join; joining month and year columns in both tables.
DT_Date_N_Periods.FP_YEAR = FINANCE_PERIOD.FP_YEAR and DT_Date_N_Periods.FP_MONTH = FINANCE_PERIOD.FP_MONTH (1:1)

5. Join the SALE_MAT table to the CLIENT, SHOWROOM, and SALE_MODEL tables. Set the appropriate cardinalities. (These are the same as the joins from the SALE table. ) 6. Create a SALE_MAT context. Tip: This context mirrors the existing SALES context and should consist of 19 joins. You can make a copy of the SALES context as follows: 1. Open List Mode, and select the SALES context. 2. Right-click the SALES context in the Context zone in List Mode. Select Insert Context. 3. The New Context window appears, with all joins from the original SALES context selected. 4. Name the context SALES_MAT and remove all joins referring to the original SALE table:
CLIENT.CLIENT_ID = SALE.CLIENT_ID SHOWROOM.SHOWROOM_ID = SALE.SHOWROOM_ID SALE.SALE_ID = SALE_MODEL.SALE_ID SALE.SALE_TYPE = 'S' SALE.SALE_DATE between FINANCE.FP_START and FINANCE.FP_END

5. Replace the removed joins with the SALE_MAT alias table joins. Ensure all newly created joins are included in the SALE_MAT context. 7. In the Sales class, create a new Sales MAT subclass. Insert the following objects: Sales Total
sum(SALE.SALE_TOTAL)

Note: A Sales Total object, with the same SELECT syntax, already exists in the YTD Measure Objects subclass, and instead of creating a new object with the same syntax, you can create a new object in the Sales MAT subclass that references the existing Sales Total object using the @select function.
@select(YTD Measure Objects\Sales Total)

58

Advanced Universe DesignInstructors Guide

Sales Total N Periods (MAT)


sum(SALE_MAT.SALE_TOTAL)

Sales Total (MAT)


sum(SALE_MAT.SALE_TOTAL)/@prompt('How many periods?','N',,,,)

Financial Year (MAT)


FINANCE_PERIOD.FP_YEAR

Note: Either use the syntax shown above, or use the @select function to reference the existing Financial Year object in the Finance Period class.
@select(Finance Period\Financial Year)

Financial Month (MAT)


FINANCE_PERIOD.FP_MONTH

Note: Either use the syntax shown above, or use the @select function to reference the existing Financial Month object in the Finance Period class.
@select(Finance Period\Financial Month)

8. As the universe has Aggregate Awareness assigned, it is good practice to set any new objects to be either compatible or incompatible with the summary tables used in your schema. Ensure that the Sale MAT objects are incompatible with the annual figures, quarter figures, year order count, year quarter order count, and year quarter month order count tables. Save the change to your universe. 9. Save your changes and launch Web Intelligence Rich Client. Create a query with all objects in the Sales MAT class, Test the report using different number of periods. Your report should look similar to this:

The report displays the Sales Total column, which references the original SALE table. The Sales Total N Periods column shows the accumulated sales total values based on the number of periods (for example Sales Total from Month 01 and Month 02), the Sales Total MAT

Designing Advanced ObjectsInstructors Guide

59

column shows the accumulated values divided by the number of periods (for example Sales Total from Month 01 and Month 02, divided by 2). 10.Test the report by adding dimension objects, for example Showroom Country. Apply a section or break, to get a better overview of the results. Your report should look similar to this:

60

Advanced Universe DesignInstructors Guide

Quiz: Designing advanced objects

(LG 57)

1. True or False: You can use all database functionality over and above what is listed in the functions list in the Select and Where fields. Answer: True 2. List three different analytic(Transact-SQL) functions. Answer: RANK ( ) OVER (PARTITION BY) ROW_NUMBER ( ) OVER (PARTITION BY) SUM ( ) OVER (PARTITION BY) 3. True or False. The @select function is an internal function that allows you, as the designer, to reuse universe objects without forcing you to repeat the entire SQL syntax. Answer: True

Designing Advanced ObjectsInstructors Guide

61

Lesson summary

(LG 58)

Instructor Note: Recap the lesson objectives with the learners as a check that all learners have acquired the required skills before moving on to the next section. After completing this lesson, you are now able to: Combine database functions in objects Construct relative date-time objects

62

Advanced Universe DesignInstructors Guide

Lesson 4

Creating Complex Predefined Conditions, LOVs, and Joins


Lesson introduction
(LG 59)

This lesson looks at how you can create complex predefined conditions, that can aid users to answer more specific questions in their reports. This lesson also looks at how LOVs can be customized to have an "ALL values" entry, and at prompts and conditional uses in joins. Note: The database functions mentioned and used in this lesson are for SQL Server. Refer to the SQL syntaxes for other RDBMS appendix for the equivalent functions and syntaxes in Oracle, DB2, or MySQL. After completing this lesson, you will be able to: Create complex predefined conditions Work with advanced LOVs Work with advanced join syntaxes

Creating Complex Predefined Conditions, LOVs, and JoinsInstructors Guide

63

Creating complex predefined conditions


Instructor Note: Discuss the unit objectives.

(LG 60)

This unit looks at how you can make use of a subquery within a condition and build subqueries via a manual and/or wizard method. After completing this unit, you will be able to: Define subqueries in predefined conditions Define @prompt syntaxes in predefined conditions

Subqueries in predefined conditions


Instructor Note:

(LG 60)

Describe the scenario outlined in the Learner's Guide. Scenario: An end user wants to run a query in which they want to see the Maximum Sale Date and the associated Sales Revenue. Demonstrate the scenario outlined in the Learner's Guide, using the steps outlined in the To retrieve the maximum sales date and associated revenue value demonstration.

Demonstration: To retrieve the maximum sales date and associated revenue value
Instructor Note:

Demonstrate the scenario outlined in the Learner's Guide. Demonstrate by using your saved Motors universe in Web Intelligence Rich Client. Note: The Motors universe is extended throughout this course. Save the version during each demonstration and reuse the same saved universe version for following demonstrations. 1. Launch Web Intelligence Rich Client. 2. Create a new report with Sale Date and Sales Revenue. Filter out a sample set of dates to reduce the size of the report and to illustrate the problem better. The sample image shown in this demonstration (and as illustrated in the Learner's Guide) has been filtered on the date values: 15/12/03, 22/12/03, 23/12/03, 16/12/04, 17/12/04, 18/12/04, 15/03/05, 18/03/05, 31/03/05. When using a sale date selection ensure that you select the 31/03/05 date, as this is the maximum sale data in the Motors database. 3. Place two tables side by side, both containing the Sale Date and Sales Revenue columns. 4. In the second table select the Sale Date column and replace it with the formula: =Max([Sale
Date])

The maximum Sale Date is the 31st of March 2005, and the Sales Revenue for that date is 17,505. When adding a new table with =Max([Sale Date]) and another column with Sales

64

Advanced Universe DesignInstructors Guide

Revenue, you can see that the Sales Revenue showing for the maximum Sale Date is actually the total revenue for all sale dates. Depending on the sale dates selected in step 2, your report looks similar to this:

Question: How would the end user get the result in Web Intelligence Rich Client? Note: If you create a Max Sale Date object in the universe the object becomes a measure, and this is not desired for reporting purposes. Answer: This can be solved by using a predefined condition that uses a subquery.

The subquery condition needs to contain the following syntax:


SALE.SALE_DATE = ALL ( SELECT max( SALE.SALE_DATE) FROM SALE WHERE (SALE.SALE_TYPE='S') )

Note: Designers need to keep in mind that using subqueries in a predefined condition can have a negative impact on query performance.

Demonstration: To define subqueries in predefined conditions


Instructor Note:

Demonstrate how to create the predefined condition with a subquery. This demonstration is not based on a generic procedure in the Learner's Guide. Demonstrate by using your saved Motors universe file. Note: The Motors universe is extended throughout this course. Save the version during each demonstration and reuse the same saved universe version for following demonstrations. 1. Open your Motors universe in Universe Designer, and add a new predefined condition. 2. Click the Filter icon at the bottom of the Universe pane.

Creating Complex Predefined Conditions, LOVs, and JoinsInstructors Guide

65

3. Click the Sales Dates subclass. 4. Insert a new condition using the Insert Condition button on the toolbar. 5. In the Name field enter Max Sales Date. 6. In the Description field, enter a help message describing the condition and any effect it may have on queries created. 7. Enter the condition directly in the Where field or via the Edit Where Clause box by selecting the >> button. 8. Insert the following subquery into the Where field: Note: This syntax can be found in the course resources.
SALE.SALE_DATE = ALL ( SELECT max( SALE.SALE_DATE) FROM SALE WHERE (SALE.SALE_TYPE='S') )

9. Save the changes and test the result in Web Intelligence Rich Client. Run a query with Sale Date and Sales Revenue in the Result Objects pane, and the new Max Sales Date in the Query Filter pane. The result now shows the maximum Sale Date and the correct Sales Revenue value of 17,505.

The benefit of using a subquery in a condition is that it allows the end user to combine several objects in a report and get the correct maximum Sale Date and Sales Revenue values. 10.Edit the query and add Invoice ID Number, Model, and Showroom.

Demonstration: To create complex subqueries by using the Universe Designer Query Panel (Optional)
To define a corrolated subquery syntax for a predefined condition by using the Universe Designer Query Panel.
Instructor Note:

Address to students that there is an "easier" way to get the correct syntax for a subquery condition; however, do note that this only applies to non-ANSI92 generated SQL. You must disable the ANSI92 setting in the PRM file to demonstrate this procedure.

66

Advanced Universe DesignInstructors Guide

Be aware that in a CSG environment, applying changes to the PRM file and other system files is prohibited. There is, therefore, a Flash file supplied in the course resources, that illustrates the use of the Calculation Wizard. The Flash file can be shown in class to demonstrate this procedure. For a non-CSG environment the same Flash file can be used, or step 2 (and substeps) can be followed to demonstrate this procedure. Note: This demonstration is not based on a generic procedure outlined in the Learner's Guide. 1. To create complex subqueries using the Universe Designer Query Panel Flash file demonstration: A Flash file demonstration can be accessed from the course resources. This demonstration file is supplied mainly for use in a CSG environment, but can also be used in a non-CSG environment if preferred. a. Launch the CSG simulations navigation page of the course resources, by using one of the following options: On the welcome page click the CSG flash file demonstration link. This link launches the Flash files navigation page. Explore to the Instructor_Resources CSG_simulations folder and launch the flash.html page. This .html file opens the Flash files navigation page. b. Select the Calculation wizard link. Note: Depending on your settings, you may need to allow blocked content. c. Click the next link in the Flash file demonstration to navigate through the procedure steps. 2. To create complex subqueries using the Universe Designer Query Panel steps for a non-CSG environment: In a non-CSG environment you can either use the Flash file demonstration supplied in the course resources, or demonstrate the steps directly in the environment as outlined below: a. You must disable the ANSI92 setting in the PRM file to demonstrate this procedure. Note: ANSI92 is automatically applied when using SQL Server. The sqlsvr_prm file in
C\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86\dataAccess\connectionsServer\OLEDB\sqlsvr.prm contains a parameter

that is set to ANSI 92:


<Parameter Name="OUTERJOINS_GENERATION">ANSI_92</Parameter>

Make a copy of the sqlsvr.prm file (to be able to restore it later on) and alter the parameter to read:
<Parameter Name="OUTERJOINS_GENERATION">NO</Parameter>

Remember that the PRM file is a system file and should be used/adapted responsibly. Please ensure that a backup version is available to restore the defaults if changes have been applied. b. Restart Universe Designer to take in the changes made in the PRM file.

Creating Complex Predefined Conditions, LOVs, and JoinsInstructors Guide

67

c. Open your Motors universe file in Universe Designer. d. Open the Universe Designer Query Panel. Click Tools Query Panel. e. Drag the objects that are needed to define the subquery into the Result Objects pane. In this example use Client Name and Sale Date. f. Drag the Sale Date to the Conditions pane. g. Select the Equal to operator. h. Select the Calculation operand. The Complex Condition Wizard opens. i. In the Select an Object dialog box, select the Sale Date object. This object represent the following section in the syntax:
SALE.SALE_DATE =

j. Click Begin. k. In the Select a Function dialog box select Maximum. This function represent the following section in the syntax:
max( SALE.SALE_DATE )

l. Click Next. The Define the Level of Calculation dialog box opens. m. Select Globally. Note: The Define the Level of Calculation dialog box allows you to decide whether the nested query is to be calculated Globally or By one or more objects. When selecting the By one or more objects option, the nested query inserts a GROUP BY (object) at the end of nested statement. In this example, there is no need for a GROUP BY clause, and the default option Globally is used. n. Click Next. The Synchronize your Calculation dialog box opens. This dialog box is in essence asking us which object we would like to tie our nested query to. o. Select the For each value of one or more objects option. When selecting this option the objects added to the Results Objects pane in step 3, are shown in their related universe class. To get the maximum Sale Date to be calculated for each Client Name, this object needs to be selected here. p. Select Client Name and click Next. The Set the Number of Values to Compare dialog box opens. This dialog box adds ALL or ANY to the syntax:
SALE.SALE_DATE = ALL

68

Advanced Universe DesignInstructors Guide

ALL: Is a keyword that denotes that the search condition is true if the comparison is

true for every value returned by the subquery. ANY: Is a keyword that denotes that the search condition is true if the comparison is true for at least one of the values returned. q. Select the All values option and then click Finish. r. Click View SQL. s. Copy the SQL. The SQL displays the syntax to be used for the subquery. Note: As the syntax is going to be used for a WHERE clause, only the statement below the WHERE needs to be copied. t. Paste the syntax in Notepad. u. Create a new condition object and paste the syntax into the WHERE clause.

Activity: Creating subqueries in predefined conditions

(LG 62)

Instructor Note: Allow 10 - 20 minutes for this activity. Explain the activity objective and instructions as a bridge from the lecture to the practice. Note: The Motors universe is extended throughout this course. Instructors need to follow the activity steps to update their universe version that was saved during the last demonstration. The updated version of the universe file, containing the activity step changes, is used for further demonstrations in following lessons. Review the activity with the learners to ensure that they have acquired the skills outlined in the activity objective.

Objective
Create new predefined conditions using subqueries

Instructions
1. Open your Motors universe file in Universe Designer. 2. Click the Filter icon at the bottom of the Universe pane. In the Sales Dates subclass, create a new Max Sales Date condition, and add an appropriate description. 3. The subquery to insert into the Where field is as follows:
SALE.SALE_DATE = ALL ( SELECT max(SALE.SALE_DATE) FROM SALE WHERE

Creating Complex Predefined Conditions, LOVs, and JoinsInstructors Guide

69

(SALE.SALE_TYPE='S') )

Note: The syntax for this subquery can be found on the course resources. 4. Click in the Filter icon at the bottom of the Universe pane. In the Sales Dates subclass, create a new Max Sales Date for each Client Name condition, and add an appropriate description. 5. The subquery to insert into the Where field is as follows:
( CLIENT.CLIENT_ID=SALE.CLIENT_ID ) AND ( SALE.SALE_DATE = ALL ( SELECT max( SALE.SALE_DATE ) FROM SALE, CLIENT SubAlias__1 WHERE (SubAlias__1.CLIENT_ID=SALE.CLIENT_ID) AND (SALE.SALE_TYPE='S') AND SubAlias__1.CLIENT_LASTNAME + ', ' + SubAlias__1.CLIENT_FIRSTNAME = CLIENT.CLIENT_LASTNAME + ', ' + CLIENT.CLIENT_FIRSTNAME ) )

Note: The syntax for this subquery can be found on the course resources. 6. Ensure that the condition objects in the Sale Date sub class are incompatible with the tables used in aggregate awareness. 7. Save the changes in the universe. 8. Launch Web Intelligence Rich Client. Run a query with Sale Date and Sales Revenue in the Result Objects pane, and the new Max Sales Date in the Query Filter pane. The result now shows the maximum Sale Date and the correct Sales Revenue value of 17,505.

The benefit of using a subquery in a condition is that it allows the end user to combine several objects in a report and get the correct maximum Sale Date and Sales Revenue values. 9. Edit the query and add Invoice ID Number, Model and Showroom. The maximum date and corresponding measure and dimension values are correctly shown in the report:

70

Advanced Universe DesignInstructors Guide

10.In the Motors database there are a number of clients that have multiple sale date rows. Create a new document in Web Intelligence Rich Client, using Sale Date, Client Name and Sales Revenue in the Result Objects pane. Filter on the Client Name for Paul Brent, Howard Hugheston, Paul Penn, and John Smith.

11.Run a new query, using Sale Date, Client Name, and Sales Revenue in the Result Objects pane, and the new Max Sales Date for each Client Name condition in the Query Filter pane. The result now shows the maximum Sale Date and the correct Sales Revenue value per Client Name.

@Prompt scenarios in predefined conditions


Instructor Note:

(LG 64)

Discuss why designers may need to implement @prompt syntaxes in predefined conditions. Describe the use of an ALL values entry in a prompt.

To create an ALL Values prompt in a predefined condition

(LG 64)

Demonstration: To create an "ALL Values" prompt in a predefined condition.


Instructor Note:

Demonstrate the ALL Values scenario in a prompt using the following steps. Demonstrate by using your saved Motors universe file. Note: The Motors universe is extended throughout this course. Save the version during each demonstration and reuse the same saved universe version for following demonstrations.

Creating Complex Predefined Conditions, LOVs, and JoinsInstructors Guide

71

At step 7, You may wish to split the syntax up by first adding the first syntax and then add the OR and second syntax. Explain what each part of the syntax does. After completing the demonstration, inform students that you can add ALL as a value in the LOV. This is covered in the LOV section of this lesson.
Steps 1. 2. 3. 4. 5. 6. Values

Motors

Client

Region Prompt "Select one or more values from the list, enter asterisk (*) to return all value."

7. 8.

9.

REGION.REGION_NAME IN @prompt('Select value or type * for all values', 'A','Client\Region',multi, free) OR ('*') IN @prompt('Select value or type * for all values', 'A','Client\Region',multi, free)

10. 11. 12.

13.

Test the changes in Web Intelligence Rich Client by running a query with Client Country, Region, Sales Revenue objects, and the Region Prompt condition.

1. Open your universe file in Universe Designer. 2. Click the Filter icon at the bottom of the Universe pane. 3. The Universe pane changes to show the Condition Object View. 4. Click the class in which you wish the condition to appear.

72

Advanced Universe DesignInstructors Guide

5. Insert a new condition using the Insert Condition button on the toolbar, or by selecting Insert Condition. This opens the Edit Properties dialog box for condition objects. 6. In the Name field, enter a name for the condition object. 7. In the Description field, enter a help message for users describing the condition and any effect it has on queries they make. 8. Enter the condition directly in the Where field or via the Edit Where Clause box by selecting the >> button. 9. The syntax to insert is as follows:
TABLENAME.COLUMN_NAME IN @prompt('message','type','{Class\Object}',multi, free) OR ('*') IN @prompt('message','type','{Class\Object}',multi, free)

So how does this syntax work? When the user selects a value from the LOV or enters a value directly in the box, the first part of the condition is valid. The second part is not valid at this point. However, due to the use of the OR statement, the condition is valid if one of the two parts is valid. When the user enters an asterisk (*), the second part of the condition is valid. Due to the use of the OR statement, the condition is always valid (* = *) and all values are returned. 10.Click Parse. 11.Click OK. 12.Save the changes in the universe. 13.When using the new prompt condition in the Query Filter pane in a new report, it allows end users to select one or more values from the list or type * in the Type a value box. This returns all values of the object.

To create a predefined condition that returns a pattern selection (LG 65) Demonstration: To create a predefined condition that returns a pattern selection
Instructor Note:

Describe that by using the @prompt function in a predefined condition you can also get end users to select value patterns. Demonstrate how to create a predefined condition that returns a pattern selection. Demonstrate by using your saved Motors universe file. Note: The Motors universe is extended throughout this course. Save the version during each demonstration and reuse the same saved universe version for following demonstrations.

Creating Complex Predefined Conditions, LOVs, and JoinsInstructors Guide

73

Steps 1. 2. 3. 4. 5. 6.

Values

Motors

Car

Maker Pattern Prompt This prompt allows you to: Enter the first letter of the maker. Enter one or more starting letters followed by the % sign. Enter a pattern like: "Fe%"
MAKER.MAKER_NAME LIKE @Prompt(Enter a value pattern followed by %', 'A',,,)+'%'

7.

8.

9. 10. 11.

Test the changes in Web Intelligence Rich Client by running a query with Maker Country, Maker, Rental Revenue objects, and the Maker Pattern Prompt condition.
12.

Note: Check that the Client class is incompatible with tables used in aggregate awareness.

1. Open your universe file in Universe Designer. 2. Click the Filter icon at the bottom of the Universe pane. 3. The Universe pane changes to show the Condition Object View. 4. Click the class in which you wish the condition to appear. 5. Insert a new condition using the Insert Condition button on the toolbar, or by selecting Insert Condition. This opens the Edit Properties dialog box for condition objects. 6. In the Name field, enter a name for the condition object.

74

Advanced Universe DesignInstructors Guide

7. In the Description field, enter a help message for users describing the condition and any effect it has on queries they make. 8. Enter the condition directly in the Where field or via the Edit Where Clause box by selecting the >> button. 9. The syntax to insert is as follows:
((TABLENAME.COLUMN_NAME) LIKE (@prompt('message','type',,,)+'%')

10.Click Parse. 11.Click OK. 12.Save the changes in the universe. Note: Using LIKE as an operator does not work with a list of values. You can in theory get users to select one value or use the pattern, but in reality this does not work out very well in Web Intelligence Rich Client. It is best to ensure that there is no LOV referenced in the @prompt function syntax.

Activity: Using @prompt in predefined conditions

(LG 66)

Instructor Note: Allow 10 - 20 minutes for this activity. Explain the activity objective and instructions as a bridge from the lecture to the practice. Note: The Motors universe is extended throughout this course. Instructors need to follow the activity steps to update their universe version that was saved during the last demonstration. The updated version of the universe file, containing the activity step changes, is used for further demonstrations in following lessons. Review the activity with the learners to ensure that they have acquired the skills outlined in the activity objective.

Objectives
Create a new predefined condition using an ALL values prompt Create a new predefined condition using a match pattern prompt

Create a new predefined condition using an ALL values prompt


1. In Universe Designer open your Motors universe file. 2. Click the Filter icon at the bottom of the Universe pane. 3. Insert a new condition in the Client class, called Client ALL values. In the Description field, enter a help message for users describing the condition and any effect it has on queries they make, for example: "Select one or more values from the
list, enter asterisk (*) to return all values."

4. Enter the condition directly in the Where field or via the Edit Where Clause box by selecting the >> button.

Creating Complex Predefined Conditions, LOVs, and JoinsInstructors Guide

75

The syntax to insert is as follows:


@select(Client\Client Name) IN @prompt('Select value or type * for all values' ,'A','Client\Client Name',multi,free) OR ('*') IN @prompt('Select value or type * for all values' ,'A','Client\Client Name',multi, free)

5. Click Parse, and OK. 6. Save changes and create a new Web Intelligence Rich Client report using Client Name and the new Client ALL values prompt filter. 7. In the Type a value box enter * and click the arrow. 8. Click Run Query. The report returns all Client Name values. 9. Edit the query and re-run. Remove the asterisk and test that the end user can also select multiple values from the LOV. Note: You may need to click on Refresh List if the values are not shown.

Create a new predefined condition using a match pattern prompt


1. In Universe Designer, create a new condition in the Client class, called Client Name Pattern Prompt. 2. In the Description field, enter a help message for users describing the condition and any effect it has on queries they make, for example:
This prompt allows you to:

Enter the first letter of the surname. Enter one or more starting letters followed by the % sign. Enter a pattern like: B%, J% 3. Enter the condition directly in the Where field or via the Edit Where Clause box by selecting the >> button. The syntax to insert is as follows:
@select(Client\Client Name) LIKE (@prompt('Enter a name pattern','A',,,)+'%')

4. Click Parse and OK. 5. Save the changes and create a new Web Intelligence Rich Client report using Region, Client Name, and the new Client Name Pattern Prompt condition. 6. In the prompt box enter B%, J%. 7. Click Run Query. The report returns all clients with a last name starting with "B" and a first name starting with "J".

76

Advanced Universe DesignInstructors Guide

Working with advanced LOVs


Instructor Note: Discuss the unit objectives.

(LG 68)

This unit explains different techniques for customizing your list of values. After completing this unit, you will be able to: Add an ALL values entry to an LOV Arrange LOVs using an A-Z index

Customizing LOVs
Instructor Note:

(LG 68)

Introduce the concept of having an ALL values entry in the LOV. Note: Designers need to keep in mind that customizing LOVs can have an impact on universe and query performance. Point out to students that this provides an ALL values entry in the LOV that can later be utilized in predefined conditions. Note: End users can now create their own optional prompts in Web Intelligence and Web Intelligence Rich Client that allow them to leave a prompt blank to retrieve all values. However, they cannot use the optional prompt option with prompt conditions created in the universe, hence an ALL values entry helps them return the full list of values.

To modify an LOV to have an ALL values entry

(LG 68)

Demonstration: To modify an LOV to have an ALL values entry


Instructor Note:

Demonstrate how to modify an LOV to have an ALL Values option. Demonstrate by using your saved Motors universe in Web Intelligence Rich Client. Note: The Motors universe is extended throughout this course. Save the version during each demonstration and reuse the same saved universe version for following demonstrations. Note: This demonstrates to add an ALL value to the LOV that can be run in a query. You can use: UNION SELECT 'ALL' FROM TABLE, which adds the value ALL to the LOV, for example:
SELECT DISTINCT REGION.REGION_NAME FROM REGION UNION SELECT 'ALL' FROM REGION

Creating Complex Predefined Conditions, LOVs, and JoinsInstructors Guide

77

However the "ALL" value in the example above is a fictitious value with no reference, and cannot be run in a query using SQL Server. When an end user selects it in a query the query returns an error "No data to retrieve". This option can be used for other RDBMS like Oracle. Note: This demonstration links the original object column data to the "ALL" value to ensuring that data is returned in the query when the "ALL" value is selected in the LOV.
Steps Values

1.

Create a new class called LOV Objects. In the LOV Objects class create a new object called Region_ALL.
CASE WHEN REGION.REGION_NAME = REGION.REGION_NAME THEN 'ALL' ELSE REGION.REGION_NAME END

2.

3. 4. 5.

6.

Remove the Region_ALL object from the Result Objects pane and drag in the Region object instead. The SQL shows the UNION between the Region object and the Region_ALL object.

7. 8. 9.

10.

The LOV now contains a list of all individual Region Name values, and the value 'ALL'.

11. 12. 13. 14.

Region Prompt

78

Advanced Universe DesignInstructors Guide

Steps

Values Region.Region_Name IN @prompt('Select value or type * for all values', 'A','LOV Objects\Region_ALL',multi,free) OR ('*') IN @prompt('Select value or type * for all values', 'A','LOV Objects\Region_ALL',multi,free)

15.

16.

OR ('ALL') IN @prompt('Select value or type * for all values) ','A','LOV Objects\Region_ALL',multi,free)

1. In Universe Designer, create a new object. Note: This object only serves as an ALL values object for use in an ALL values prompt syntax. 2. Use the following SELECT syntax for this object:
CASE WHEN TABLENAME.COLUMN_NAME = TABLENAME.COLUMN_NAME THEN 'ALL' ELSE TABLENAME.COLUMN_NAME END

The same TABLENAME.COLUMN_NAME is referenced in all sections of the CASE statement. This syntax converts each of the column values to a generic 'ALL' value. 3. Click the Properties tab. 4. Click Edit. 5. In the Query Panel select the Combine Queries toolbar icon. This generates a second query tab with the UNION symbol. 6. In the Query 2 tab, remove the newly created ALL values object and drag in the original object used in the ALL values prompt. 7. Click View SQL. The SQL shows the UNION between the ALL values object and the original prompt object.
SELECT Distinct CASE WHEN TABLENAME.COLUMN_NAME = TABLENAME.COLUMN_NAME THEN 'ALL' ELSE TABLENAME.COLUMN_NAME END FROM TABLENAME UNION SELECT Distinct TABLENAME.COLUMN_NAME FROM TABLENAME

8. Click OK to close the SQL Viewer. 9. Click Run. 10.Click Display. The LOV contains a list of all individual column values and the value 'ALL'. 11.Click OK twice.

Creating Complex Predefined Conditions, LOVs, and JoinsInstructors Guide

79

12.Click the Show or Hide Item toolbar icon to hide the ALL values object. 13.Click the Filter icon at the bottom of the Universe pane. 14.Open the previously created ALL values prompt condition. The original SQL syntax for this condition reads:
TABLENAME.COLUMN_NAME IN @prompt('message','type','{Class\Object}',multi, free) OR ('*') IN @prompt('message','type','{Class\Object}',multi, free)

15.The prompt syntax now needs to be altered to reference the LOV of the new ALL values object. Modify the syntax to:
TABLENAME.COLUMN_NAME IN @prompt('message','type','{Class\Object_ALL_Values}',multi, free) OR ('*') IN @prompt('message','type','{Class\Object_ALL_Values}',multi, free)

16.Append the following syntax to the modified condition:


OR ('ALL') IN @prompt('message','type','{Class\Object_ALL_Values}', multi, free)

This syntax ensures that when the 'ALL' value is selected in the LOV it has a 'reference' and the query returns all object values. When used in a query, the end user sees the value ALL as part of the LOV of the prompted object. Selecting this returns all values.

Activity: Modifying LOVs

(LG 69)

Instructor Note: Allow 10 - 20 minutes for this activity. Explain the activity objective and instructions as a bridge from the lecture to the practice. Note: The Motors universe is extended throughout this course. Instructors need to follow the activity steps to update their universe version that was saved during the last demonstration. The updated version of the universe file, containing the activity step changes, is used for further demonstrations in following lessons. Review the activity with the learners to ensure that they have acquired the skills outlined in the activity objective.

Objectives
Create a Client ALL values object Modify the LOV for the Client ALL values predefined condition

80

Advanced Universe DesignInstructors Guide

Instructions
1. In Universe Designer, open your Motors universe file. 2. Create a new class called LOV Objects. 3. Create a new Client_ALL object in the LOV Objects class. 4. Click Apply. 5. Use the following SELECT syntax for the Client_ALL object:
CASE WHEN @select(Client\Client Name) = @select(Client\Client Name) THEN 'ALL' ELSE @select(Client\Client Name) END

This syntax converts all Client Name values to 'ALL'. 6. Click the Properties tab. 7. Click Edit. 8. In the Query Panel select the Combine Queries toolbar icon. This generates a second query tab with the UNION symbol. 9. In the Query 2 tab, remove the Client_ALL object and drag in the Client Name object instead. 10.Click View SQL. The SQL shows the UNION between the Client Name object and the Client_ALL object. Click OK to close the SQL Viewer. 11.Click Run. 12.Click Display. The LOV now contains a list of all individual client names and the value 'ALL'. 13.Click OK. 14.Select the Export with universe option. 15.Click OK. 16.Click the Show or Hide Item toolbar icon to hide the LOV Objects class. 17.Click the Filter icon at the bottom of the Universe pane. 18.Open the Client ALL values Prompt condition. 19.The prompt syntax now needs to reference the Client_ALL LOV. Modify the syntax to:
@select(Client\Client Name) IN @prompt('Select value or type * for all values','A','LOV Objects\Client_ALL',multi, free) OR ('*') IN @prompt('Select value or type * for all values' ,'A','LOV Objects\Client_ALL',multi, free)

Creating Complex Predefined Conditions, LOVs, and JoinsInstructors Guide

81

20.Append the following syntax to the modified condition:


OR ('ALL') IN @prompt('Select value or type * for all values)','A','LOV Objects\Client_ALL',multi, free)

This syntax ensures that when the 'ALL' value is selected in the LOV it has a 'reference' and the query returns all client name values. The complete modified syntax should read:
@select(Client\Client Name) IN @prompt('Select value or type * for all values','A','LOV Objects\Client_ALL',multi, free) OR ('*') IN @prompt('Select value or type * for all values' ,'A','LOV Objects\Client_ALL',multi, free) OR ('ALL') IN @prompt('Select value or type * for all values)','A','LOV Objects\Client_ALL',multi, free)

21.Save the changes in your universe. 22.Launch Web Intelligence Rich Client. 23.Create a new report using Region and Client Name in the Result Objects pane, and the Client ALL values Prompt condition in the Query Filter pane. 24.Click Run Query. 25.The ALL value now shows up in the available list of values. Select the ALL value and click the arrow. 26.Run the query. This should return all client names. Note: This activity creates an extra object to bring in the ALL value. The UNION statement can also be added directly to the LOV with the Do not regenerate SQL before running option ticked.

Arranging LOV data as an A-Z index


Instructor Note:

(LG 71)

Describe how you can arrange LOVs as an A-Z index. Note: Designers need to keep in mind that customizing LOVs can have an impact on universe and query performance.

To create an A-Z index in a cascading LOV

(LG 72)

Demonstration: To create an A-Z index in a cascading LOV


Instructor Note:

Describe how a large list of values may benefit from an A-Z index to make this more user friendly for the end users. Demonstrate by using your saved Motors universe in Web Intelligence Rich Client.

82

Advanced Universe DesignInstructors Guide

Note: The Motors universe is extended throughout this course. Save the version during each demonstration and reuse the same saved universe version for following demonstrations. Step 4a indicates optional procedure steps to show students the Universe Designer hierarchical view of an LOV, prior to creating the cascading LOV.
Steps 1. Values

Motors Insert a new object called First Letter of Client Lastname in the LOV Objects class.
substring(CLIENT.CLIENT_LASTNAME, 1, 1)

2.

3. 4.

4a.

Optional steps: Open the Client Name object and click the Properties tab. Select Edit. In the List of Values Query Panel add the new First Letter of Client Lastname object and click Run. Click Display. Show students the Hierarchical View of the list. Show students the Tabular View and explain that in Web Intelligence there is no hierarchical view. What is shown in the tabular view is what Web Intelligence or Web Intelligence Rich Client end users see. Re-edit the LOV. Remove the First Letter of Client Lastname object and click Run to restore the LOV to its original state. Click OK to close.

5. 6. 7. 8. 9. 10.

First Letter of Client Lastname ; Client Name

11.

Show the results in Web Intelligence Rich Client: Drag the Client Name and Client Country objects into the Result Objects pane and the Client Name into the Query Filters pane.

Creating Complex Predefined Conditions, LOVs, and JoinsInstructors Guide

83

Steps

Values

Select Prompt as the operator and click Run Query. The LOV to select from is shown as an indexed hierarchical view. Note: Return to Universe Designer and restore the old Client Name LOV: 1. Edit the Client Name object and select the Properties tab. 2. Click Edit. 3. Remove the cascading LOV generated condition. 4. Click Run to restore the LOV.

1. Open your universe file in Universe Designer. 2. Insert a new object using the Insert Object toolbar icon. 3. In the Select field use the following SELECT syntax:
substring(TABLENAME.COLUMN_NAME, 1, 1)

This syntax returns the first letter of the column. 4. Click OK. 5. Click the Show or hide item toolbar icon to hide the object. 6. Select Tools List of Values Create cascading list of values. 7. Add the first letter object to the cascading list of values menu, followed by the original object.

8. Verify that the Hierarchical View check box is selected. 9. Click Generate LOVs.

84

Advanced Universe DesignInstructors Guide

As the selected objects may already contains LOVs, a message appears asking whether you want to overwrite the existing values. 10.Click OK. 11.Save the changes in the universe.

Activity: Arranging LOVs

(LG 73)

Instructor Note: Allow 10 - 20 minutes for this activity. Explain the activity objective and instructions as a bridge from the lecture to the practice. Note: The Motors universe is extended throughout this course. Instructors need to follow the activity steps to update their universe version that was saved during the last demonstration. The updated version of the universe file, containing the activity step changes, is used for further demonstrations in following lessons. Review the activity with the learners to ensure that they have acquired the skills outlined in the activity objective.

Objective
Create a cascading A-Z index LOV

Instructions
1. Create a new object called First Letter of Manager Lastname in the hidden LOV Objects class 2. In the Select field enter the following SELECT syntax:
substring(MANAGER.EMP_LASTNAME, 1, 1)

This syntax returns the first letter of the manager's last name. 3. Create a new cascading LOV. 4. Add the First Letter of Manager Lastname object to the cascading list of values menu, followed by the original Manager object. 5. Verify that the Hierarchical View check box is selected. 6. Generate the LOVs. 7. Ensure the LOV Objects class is hidden from the Aggregate awareness tables. 8. Save the changes and test the results in Web Intelligence Rich Client. 9. Return to Universe Designer and restore the Manager LOV using the following steps: Edit the Manager object and select the Properties tab. Click Edit. Remove the cascading LOV generated condition. Click Run to restore the LOV.

Creating Complex Predefined Conditions, LOVs, and JoinsInstructors Guide

85

Working with advanced join syntaxes


Instructor Note: Discuss the unit objectives.

(LG 74)

This unit looks at prompts and conditional uses in joins, and how joins can be modified to accomplish relative date-time and running calculations in end user reports. After completing this unit, you will be able to: Define @prompt functions in joins Define conditional join paths Use conditional joins for relative date-time objects Use conditional joins to construct running sum objects

Defining @prompt functions in a join


Instructor Note:

(LG 74)

Describe the use of @prompt functions in a join.

Defining conditional join paths


Instructor Note:

(LG 75)

Describe the use of conditional join paths.

Demonstration: To define a conditional join


Instructor Note:

Demonstrate how to create a conditional join path. This demonstration is not based on a generic procedure in the Learner's Guide. Demonstrate by using your saved Motors universe in Web Intelligence Rich Client. Note: The Motors universe is extended throughout this course. Save the version during each demonstration and reuse the same saved universe version for following demonstrations.

1. In Universe Designer open your Motors universe file. 2. Double-click the join between the MANAGER and EMPLOYEE table. 3. Modify the join by using the following syntax:
MANAGER.EMP_ID = CASE WHEN @prompt('Manager or Employee?','A',{'Manager','Employee'},,) = 'Manager' THEN EMPLOYEE.EMP_MGR_ID ELSE EMPLOYEE.EMP_ID END

4. Click OK to close. 5. Save the changes and test the results in Web Intelligence Rich Client.

86

Advanced Universe DesignInstructors Guide

When running a query with Sales Person and Manager the prompt appears to return either all Employees (Sales Person and Manager list of names is the same) or Manager and Employee data, depending on the value selected in the prompt. 6. View the SQL for either selection and point out to students that the CASE statement changes the join syntax selection. 7. Restore the join to its original state. If students followed along ensure they do the same.

Using joins to construct relative date-time objects


Instructor Note:

(LG 76)

Describe how you can use a join condition to construct relative date-time objects. Discuss the advantages and disadvantages of doing so.

Demonstration: To use joins for relative date-time objects


Instructor Note:

Demonstrate how to use joins to construct relative date-time objects. This demonstration is not based on a generic procedure in the Learner's Guide. Be aware that the steps are different in the CSG and non-CSG environment. the CSG environment, all classroom-created connections and universes are stored in the same centralized repository. It is therefore necessary to give a unique name to each connection and universe that are created. The demonstration indicates the different steps required in both environments. 1. Create a new universe: CSG: SaleTotal_Ixx (where "xx" stands for your instructor number for example, I01 or I02). Use the MotorsOLEDB_Ixx connection. Non-CSG: SaleTotal. Use the MotorsOLEDB connection. 2. Insert the SALE and FINANCE_PERIOD tables. 3. Create an alias for the SALE table called SALE_PREVIOUS_YEAR. 4. Join the SALE table to the FINANCE_PERIOD table:
SALE.SALE_DATE between FINANCE_PERIOD.FP_START and FINANCE_PERIOD.FP_END (N:1)

5. Join the SALE_PREVIOUS_YEAR alias table to the FINANCE_PERIOD table by using a complex join:
dateadd(year,1,SALE_PREVIOUS_YEAR.SALE_DATE) between FINANCE_PERIOD.FP_START and FINANCE_PERIOD.FP_END (N:1)

6. Add the self-restricting joins for the SALE and the SALE_PREVIOUS_YEAR tables.
SALE.SALE_TYPE = 'S' SALE_PREVIOUS_YEAR.SALE_TYPE = 'S'

Creating Complex Predefined Conditions, LOVs, and JoinsInstructors Guide

87

7. Create two contexts; one for SALE and one for SALE_PREVIOUS_YEAR. SALE context
SALE.SALE_DATE between FINANCE_PERIOD.FP_START and FINANCE_PERIOD.FP_END SALE.SALE_TYPE = 'S'

SALE_PREVIOUS_YEAR context
dateadd(year,1,SALE_PREVIOUS_YEAR.SALE_DATE) between FINANCE_PERIOD.FP_START and FINANCE_PERIOD.FP_END SALE_PREVIOUS_YEAR.SALE_TYPE = 'S'

8. Create a Finance Period class with all columns from the FINANCE_PERIOD table. 9. Create a Sales Figures class. Add the following measures: Sales Total this year
sum(SALE.SALE_TOTAL)

Sales Total previous year


sum(SALE_PREVIOUS_YEAR.SALE_TOTAL)

10.Save your universe locally. Be aware that the location for locally saved universes is different in the CSG and the non-CSG environment. CSG: Universes are saved in: \\My Documents\My Business Objects Universes. Non-CSG: The default location is in: \\Documents and Settings\<user>\Application Data\Business Objects\Business Objects 12.0\Universes\<universe>.unv. 11.In Web Intelligence Rich Client, create a report with Fp Quarter, Fp Year, Sales Total this year, and Sales Total previous year.

88

Advanced Universe DesignInstructors Guide

Conditional joins and running calculations


Instructor Note:

(LG 78)

Describe the use of conditional joins for creating running calculations. Point out the limitations/disadvantages of this method.

Demonstration: To create running calculations by using conditional joins


Instructor Note:

Demonstrate how to use joins to construct Running Sum and Running Average objects. This demonstration is not based on a generic procedure in the Learner's Guide. Be aware that the steps are different in the CSG and non-CSG environment. the CSG environment, all classroom-created connections and universes are stored in the same centralized repository. It is therefore necessary to give a unique name to each connection and universe that are created. The demonstration indicates the different steps required in both environments. 1. Create a new universe: CSG: RunCalc_Ixx (where "xx" stands for your instructor number, for example I01 or I02). Use the MotorsOLEDB_Ixx connection. Non-CSG: RunCalc. Use the MotorsOLEDB connection. 2. Insert the SALE and FINANCE_PERIOD tables.

Creating Complex Predefined Conditions, LOVs, and JoinsInstructors Guide

89

3. Create an alias for the SALE table called SALE_RUNNING_SUM and an alias for the FINANCE_PERIOD called FINANCE_PERIOD_RUNNING_SUM. 4. Insert the following joins:
SALE.SALE_DATE between FINANCE_PERIOD.FP_START and FINANCE_PERIOD.FP_END (N:1) SALE_RUNNING_SUM.SALE_DATE between FINANCE_PERIOD_RUNNING_SUM.FP_START and FINANCE_PERIOD_RUNNING_SUM.FP_END (N:1) FINANCE_PERIOD.FP_YEAR = FINANCE_PERIOD_RUNNING_SUM.FP_YEAR and FINANCE_PERIOD.FP_MONTH >= FINANCE_PERIOD_RUNNING_SUM.FP_MONTH (1:1) SALE.SALE_TYPE = 'S'(1:1) SALE_RUNNING_SUM.SALE_TYPE = 'S'(1:1)

5. Create two contexts; one for SALE and one for SALE_RUNNING_SUM. SALE context
SALE.SALE_DATE between FINANCE_PERIOD.FP_START and FINANCE_PERIOD.FP_END SALE.SALE_TYPE = 'S'

SALE_RUNNING_SUM context
SALE_RUNNING_SUM.SALE_DATE between FINANCE_PERIOD_RUNNING_SUM.FP_START and FINANCE_PERIOD_RUNNING_SUM.FP_END FINANCE_PERIOD.FP_YEAR = FINANCE_PERIOD_RUNNING_SUM.FP_YEAR and FINANCE_PERIOD.FP_MONTH >= FINANCE_PERIOD_RUNNING_SUM.FP_MONTH SALE_RUNNING_SUM.SALE_TYPE = 'S'

6. Create a Finance Period class with all columns from the FINANCE_PERIOD table. 7. Add the following object to the Finance Period class: Month Number
right(FINANCE_PERIOD.FP_MONTH,2)+0

8. Hide the Month Number object. 9. Create a Sales Figures class. Add the following measures to the new Sales Figures class: Sales Total
sum(SALE.SALE_TOTAL)

Sales Total Running Sum


sum(SALE_RUNNING_SUM.SALE_TOTAL)

Sales Total Running Average


sum(SALE_RUNNING_SUM.SALE_TOTAL/@select(Sales Figures\Month Number))

10.Hide the Month Number object. 11.Save your universe locally. Be aware that the location for locally saved universes is different in the CSG and the non-CSG environment.

90

Advanced Universe DesignInstructors Guide

CSG: Universes are saved in: \\My Documents\My Business Objects Universes. Non-CSG: The default location is in: \\Documents and Settings\<user>\Application Data\Business Objects\Business Objects 12.0\Universes\<universe>.unv. 12.Test the results in Web Intelligence Rich Client. Create a report with Financial Month, Sales Total, Sales Total Running Sum, and Sales Total Running Average. The Sales Total Running Sum column displays a cumulative aggregation of each Sales Total cell plus the previous period cell value, so the row at Month 2 displays the Sales Total of Month 1 + Sales Total of Month 2, the row at Month 3 displays the Sales Total of Month 1 + Sales Total of Month 2 + Sales Total of Month 3, and so on. The average column calculates a cumulative aggregation of Sales Total cell plus previous cell value, divided by 2, 3, 4, and so on, depending on the number of cells added up. So, the row at Month 2 displays the Sales Total of Month 1 + Sales Total of Month 2 divided by 2, the row at Month 3 displays the Sales Total of Month 1 + Sales Total of Month 2 + Sales Total of Month 3 divided by 3, and so on.

Activity: Using complex joins

(LG 80)

Instructor Note: Allow 20 - 30 minutes for this activity. Explain the activity objective and instructions as a bridge from the lecture to the practice. Note: The Motors universe is extended throughout this course. Instructors need to follow the activity steps to update their universe version that was saved during the last demonstration. The updated version of the universe file, containing the activity step changes, is used for further demonstrations in following lessons. Review the activity with the learners to ensure that they have acquired the skills outlined in the activity objective. Answers to the questions, sub-steps, or instructor tips are shown in the table(s):

Creating Complex Predefined Conditions, LOVs, and JoinsInstructors Guide

91

Instructions: Create relative date-time calculations Step Answer/Result

Context Name: SALE_PREVIOUS_YEAR Joins included in context:


REGION.REGION_ID=CLIENT.REGION_ID MODEL.MODEL_PRICE between SALES_PRICE_RANGE.PRICE_RANGE_MIN and SALES_PRICE_RANGE.PRICE_RANGE_MAX SALE_MODEL.COLOUR_ID=COLOUR.COLOUR_ID SALE_MODEL.MODEL_ID=MODEL.MODEL_ID MODEL.STYLE_ID=STYLE.STYLE_ID MODEL.MAKER_ID=MAKER.MAKER_ID COUNTRY_SHOWROOM.COUNTRY_ID=SHOWROOM.COUNTRY_ID MAKER.COUNTRY_ID=COUNTRY_MAKER.COUNTRY_ID REGION.COUNTRY_ID=COUNTRY_REGION.COUNTRY_ID DT_Best_Cust.CLIENT_ID=CLIENT.CLIENT_ID DT_Best_Cust.CLIENT_ID=DT_Nested.CLIENT_ID MANAGER.EMP_ID = CASE @prompt('Manager or Employee?','A', {'Manager','Employee'},,) when 'Manager' then EMPLOYEE.EMP_MGR_ID else EMPLOYEE.EMP_ID end CLIENT.EMPLOYEE_ID=EMPLOYEE.EMP_ID CLIENT.CLIENT_ID=SALE_PREVIOUS_YEAR.CLIENT_ID SHOWROOM.SHOWROOM_ID=SALE_PREVIOUS_YEAR.SHOWROOM_ID SALE_PREVIOUS_YEAR.SALE_ID=SALE_MODEL.SALE_ID dateadd(year,1,SALE_PREVIOUS_YEAR.SALE_DATE) between FINANCE_PERIOD.FP_START and FINANCE_ PERIOD.FP_END SALE_PREVIOUS_YEAR.SALE_TYPE='S'

5.

Instructions: Create running calculations Step Answer/Result

Context Name: RUNNING_SALES_FIGURES Joins included in context:


SALE_RUNNING_SUM.SALE_DATE between FINANCE_PERIOD_RUNNING_SUM.FP_START and FINANCE_PERIOD_RUNNING_SUM.FP_END 4. FINANCE_PERIOD.FP_YEAR = FINANCE_PERIOD_RUNNING_SUM.FP_YEAR and FINANCE_PERIOD.FP_MONTH >= FINANCE_PERIOD_RUNNING_SUM.FP_MONTH SALE_RUNNING_SUM.SALE_TYPE='S' CLIENT.CLIENT_ID = SALE_RUNNING_SUM.CLIENT_ID SHOWROOM.SHOWROOM_ID = SALE_RUNNING_SUM.SHOWROOM_ID SALE_MODEL.SALE_ID = SALE_RUNNING_SUM.SALE_ID

Objectives
Create relative date-time calculations Create running calculations

92

Advanced Universe DesignInstructors Guide

Instructions: Create relative date-time calculations


1. In your Motors universe create a SALE_PREVIOUS_YEAR (SALE) alias table. Note: The self-restricting join for the SALE.SALE_TYPE column needs to be manually created for the alias table. 2. Join SALE_PREVIOUS_YEAR (SALE) to the FINANCE_PERIOD table.
dateadd(year,1,SALE_PREVIOUS_YEAR.SALE_DATE) between FINANCE_PERIOD.FP_START and FINANCE_PERIOD.FP_END

3. Set the appropriate cardinalities. 4. Join the SALE_PREVIOUS_YEAR (SALE) table to the CLIENT, SHOWROOM, and SALE_MODEL tables. Set the appropriate cardinalities. 5. Add a SALE_PREVIOUS_YEAR context. Tip: This context mirrors the existing SALES context. You can make a copy of the SALES context as follows: a. Open List Mode, and select the SALES context. b. Right-click the SALES context in the Context zone in List Mode. c. Select Insert Context. The New Context window appears, with all joins from the original SALES context selected. d. Name the context SALE_PREVIOUS_YEAR and remove all joins referring to the original SALE table:
CLIENT.CLIENT_ID = SALE.CLIENT_ID SHOWROOM.SHOWROOM_ID = SALE.SHOWROOM_ID SALE.SALE_ID = SALE_MODEL.SALE_ID SALE.SALE_TYPE = 'S' SALE.SALE_DATE between FINANCE.FP_START and FINANCE.FP_END

e. Replace the removed joins with the SALE_PREVIOUS_YEAR alias table joins. Ensure all newly created joins are included in the SALE_PREVIOUS_YEAR context. 6. In the Sales class, create a new Previous Year Sales Figures subclass. Insert the following objects: Sales Total this year:
sum(SALE.SALE_TOTAL)

Note: A Sales Total object, with the same SELECT syntax, already exists in the YTD Measure Objects class (subclass of Sales). Instead of creating a new object with the same syntax, you can create a new object in the Sales MAT subclass that references the existing Sales Total object using the @select function.
@select(YTD Measure Objects\Sales Total)

Sale Total previous year:


sum(SALE_PREVIOUS_YEAR.SALE_TOTAL)

Creating Complex Predefined Conditions, LOVs, and JoinsInstructors Guide

93

7. Save your changes and test the new objects in Web Intelligence Rich Client. Your results should look similar to this example:

Instructions: Create running calculations


1. In your Motors universe create a SALE_RUNNING_SUM (SALE) alias table and a FINANCE_PERIOD_RUNNING_SUM (FINANCE_PERIOD) alias table. Note: The self-restricting join for the SALE.SALE_TYPE column needs to be manually created for the alias table. 2. Insert the following two joins:
SALE_RUNNING_SUM.SALE_DATE between FINANCE_PERIOD_RUNNING_SUM.FP_START and FINANCE_PERIOD_RUNNING_SUM.FP_END FINANCE_PERIOD.FP_YEAR = FINANCE_PERIOD_RUNNING_SUM.FP_YEAR and FINANCE_PERIOD.FP_MONTH >= FINANCE_PERIOD_RUNNING_SUM.FP_MONTH

3. Join the SALE_RUNNING_SUM (SALE) table to the CLIENT, SHOWROOM, and SALE_MODEL tables. 4. Set the appropriate cardinalities.

94

Advanced Universe DesignInstructors Guide

5. Add a RUNNING_SALES_FIGURES context, consisting of the three new joins only:


SALE_RUNNING_SUM.SALE_DATE between FINANCE_PERIOD_RUNNING_SUM.FP_START and FINANCE_PERIOD_RUNNING_SUM.FP_END FINANCE_PERIOD.FP_YEAR = FINANCE_PERIOD_RUNNING_SUM.FP_YEAR and FINANCE_PERIOD.FP_MONTH >= FINANCE_PERIOD_RUNNING_SUM.FP_MONTH SALE_RUNNING_SUM.SALE_TYPE='S' CLIENT.CLIENT_ID = SALE_RUNNING_SUM.CLIENT_ID SHOWROOM.SHOWROOM_ID = SALE_RUNNING_SUM.SHOWROOM_ID SALE_MODEL.SALE_ID = SALE_RUNNING_SUM.SALE_ID

6. In the Sales class, create a new Accumulating Sales Figures subclass. Insert the following objects: Sales Total:
sum(SALE.SALE_TOTAL)

Note: Either use the syntax shown above or use the @select function to reference the existing Sales Total object in the YTD Measure Objects class (subclass of Sales).
@select(YTD Measure Objects\Sales Total)

Sales Total Running Sum:


sum(SALE_RUNNING_SUM.SALE_TOTAL)

Month Number:
right(FINANCE_PERIOD.FP_MONTH,2)+0

Note: Either use the syntax shown above or use the @select function to reference the existing Financial Month object in the Finance Period class.
right(@select(Finance Period\Financial Month),2)+0

Sale Total Running Average:


sum(SALE_RUNNING_SUM.SALE_TOTAL/@select(Accumulating Sales Figures\Month Number))

7. Hide the Month Number object. 8. Save your changes and test the new objects in Web Intelligence Rich Client. Run a report with Financial Month, Sales Total, Sales Total Running Sum, and Sales Total Running Average. The Sales Total Running Sum column displays a cumulative aggregation of each Sales Total cell plus the previous period cell value, so the row at Month 02 displays the Sales Total of Month 01 + Sales Total of Month 02, the row at Month 03 displays the Sales Total of Month 01 + Sales Total of Month 02 + Sales Total of Month 03, and so on. The Sales Total Running Average column calculates a cumulative aggregation of each Sales Total cell plus the previous period cell value, divided by 2, 3, 4, and so on, depending on the number of cells added up. Your results should look similar to this example:

Creating Complex Predefined Conditions, LOVs, and JoinsInstructors Guide

95

96

Advanced Universe DesignInstructors Guide

Quiz: Creating complex predefined conditions and LOVs (LG 84)


1. True or false? Using subqueries allows you to use aggregate functions in the WHERE clause. Answer: True 2. When setting up a predefined condition that returns a pattern, what two important syntaxes are required to achieve this? Answer: LIKE and % 3. What functions cannot be used in a join definition? Answer: @select and @where

Creating Complex Predefined Conditions, LOVs, and JoinsInstructors Guide

97

Lesson summary

(LG 85)

Instructor Note: Recap the lesson objectives with the learners as a check that all learners have acquired the required skills before moving on to the next section. After completing this lesson, you are now able to: Create complex predefined conditions Work with advanced LOVs Work with advanced join syntaxes

98

Advanced Universe DesignInstructors Guide

Lesson 5

Securing Universes
Lesson introduction
(LG 87)

Different aspects of universe security can be managed at different levels: in the universe connection; in the Central Management Server (CMS); and directly at universe level. Universe level security, in the form of restriction sets, is covered in the BusinessObjects XI 3.0/3.1: Universe Design course. This lesson looks at security at connection and CMS level, combined with the use of universe restriction sets. After completing this lesson, you will be able to: Define connection and user credential parameters Work with Central Management Server (CMS) universe security Work with table mapping

Securing UniversesInstructors Guide

99

Defining connection and user credential parameters (LG 88)


Instructor Note: Define unit objectives. The universe connection determines how users connect to the data source and access the database. A number of connection options can be set up to either use an explicit database user account or delegate the authentication to user specific credentials. Universe designers can secure universes by setting different authentication options in the universe connection. This unit looks at these different options and parameters that can be set in a universe. After completing this unit, you will be able to: Describe the different data source credentials that can be applied in the connection

About security and universes


Instructor Note:

(LG 88)

Discuss how universe security is managed at the CMS and universe levels. The BusinessObjects XI 3.0/3.1: Universe Design course looked at securing universes at universe level, using restriction sets.

User credentials for the connection


Instructor Note:

(LG 88)

Open the MotorsOLEDB connection and describe the two different data source credentials options that can be set in the connection. The Learner's Guide contains diagrams that can aid in explaining these two options to the students.

Demonstration: To set user database credentials in the universe connection


Instructor Note:

Demonstrate setting database credentials in the universe connection and the effect it has in Universe Designer and in Web Intelligence Rich Client. Be aware that in a CSG environment, access to the CMS is prohibited, and passing user credentials through the connection does not fully work. There are therefore three simulations for passing user credentials into a connection supplied in the course resources that can be shown in class to demonstrate this procedure. For a non-CSG environment the same simulations can be used, or step 2 (and substeps) can be followed to demonstrate this procedure. Note: To be able to follow the procedure steps ensure that the SQL Server user credentials and the BOE user credentials are set up, as outlined in the To set up user credentials in SQL

100

Advanced Universe DesignInstructors Guide

Server Management Studio and To define Business Objects Enterprise user credentials sections in the Facilities Setup Guide. Note: This demonstration is not based on a generic procedure outlined in the Learner's Guide. 1. To set user database credentials in the universe connection simulations: 1. Setting user credentials 2. Defining Business Objects Enterprise user credentials 3. Testing user credentials There are three simulations that can be accessed from the course resources and can be run in Demonstration and Tutorial modes. These three simulations are mainly supplied for use in a CSG environment, but can also be used in a non-CSG environment if preferred. a. Launch the CSG simulations navigation page of the course resources, by using one of the following options: On the welcome page click the CSG simulations link, which launches the Simulations navigation page. Explore to the Instructor_Resources CSG_simulations folder and launch the simulations.html page, which opens the Simulations navigation page. b. Select the Setting user credentials simulation. c. Select Demonstration or Tutorial mode. Demonstration mode automatically plays the procedure steps. Tutorial mode allows you to click through the steps at your own pace. d. Depending on your settings, allow blocked content, if required. e. If required, adjust the Adobe Flash Player security settings, by selecting OK to play the simulation, or clicking the Settings button to select the appropriate Adobe Flash Player security option. f. Launch the Defining Business Objects Enterprise user credentials simulation to continue the demonstration. g. Launch the Testing user credentials simulation to continue the demonstration. 2. To set user database credentials in the universe connection for a non-CSG environment. In a non-CSG environment you can either use the three simulation files (Setting user credentials, Defining Business Objects Enterprise user credentials, and Testing user credentials), or demonstrate the steps directly in the environment as outlined below: a. Log into SQL Server Management Studio. Go to Start Programs Microsoft SQL Server 2005 SQL Server Management Studio. Enter the sa login credentials and click Connect. b. Expand the Security section and right-click Logins. Explain that the DBA has created a new login and this login has been associated with a new user.

Securing UniversesInstructors Guide

101

Note: This user login is set up according to the steps outlined in the Facilities Setup Guide. c. Click the plus sign in front of the Motors database. In the Security folder a user is added by the DBA called User1. This user has been defined with the database role members to db_datareader. d. e. Expand Tables and right-click on ANNUAL_FIGURES. f. Select Properties. g. Set a restriction to deny Select for User1. 1. In the ANNUAL_FIGURES table properties, select the Permissions page. 2. Click Add. 3. Type in User1, click Check Names, and click OK. 4. In the Explicit permissions for User 1 area, select the check box for permission Select in the Deny column. 5. Click OK to accept the changes. h. Click OK to commit the changes. Exit the SQL Management Studio. i. Log into the Central Management Console. Select Start Programs Business Objects XI 3.0/3.1 Business Objects Enterprise Business Objects Enterprise Central Management Console. j. Navigate to the users. The System Administrator has created a new user called John. View the user settings. Note: This user is set up according to the steps outlined in the Facilities Setup Guide. John has been associated with the User1 SQL Server credentials. He has been added to the Administrators group. k. Log into Universe Designer and select ToolsConnections. l. Edit the MotorsOLEDB connection and enable the use of BusinessObjects credential mapping. m. Click Next and then Finish to exit the Connection Wizard. n. Log into Web Intelligence Rich Client as user John and create a new Web Intelligence Rich Client document. o. Add Showroom and Sales Revenue to the Result Objects pane. p. Click View SQL. The generated SQL uses the ANNUAL_FIGURES table. q. Click Run Query. Web Intelligence Rich Client gives an error message saying "SELECT permission was denied on object ANNUAL FIGURES". r. Log into Universe Designer as John. s. Open the Motors universe file.

102

Advanced Universe DesignInstructors Guide

t. Right-click the ANNUAL_FIGURES table and select View Table Values. Universe Designer gives an error message saying "SELECT permission was denied on object ANNUAL FIGURES". u. Open the MotorsOLEDB connection and clear the database credentials option. v. Set the login name and password back to the original SQL Server username and associated password. w. Select Tools Login As. Log back in as Administrator.

Securing UniversesInstructors Guide

103

Working with Central Management Server (CMS) universe security (LG 90)
The BusinessObjects system administrator can authorize or deny access to universes stored in the CMS. The administrator can define which universes users are authorized to access, and depending on the rights defined for a user group, the administrator can also restrict viewing, editing, deleting, and other actions in a universe. After completing this unit, you will be able to: Organize universes in secured folder structures

Organizing universes in secured folder structures


Instructor Note:

(LG 90)

Describe how you can use folders to organize universes. Describe how you can use the CMS to secure universe folders.

104

Advanced Universe DesignInstructors Guide

Working with table mapping in restriction sets


Instructor Note: Define unit objectives.

(LG 92)

As universe designer, you can define restrictions for users who are authorized to use a universe. A group of restrictions that correspond to a user group is called a restriction set. A restriction set can include object access, row access, query and SQL generation controls, and connection controls. These were covered in the BusinessObjects XI 3.0/3.1: Universe Design course. In addition you can use table mapping in a restriction set. This unit looks at how you can use table mapping to substitute one database table for another, and ensure that some users only have the right to see the substituted table values. After completing this unit, you will be able to: Apply table mapping in a restriction set

About restriction sets


Instructor Note:

(LG 92)

Review the type of restriction sets you can apply in Universe Designer. Review how are restriction sets created and managed.

Working with table mapping


Instructor Note:

(LG 93)

Describe what table mapping is and how it is applied in a restriction set.

To map one table to another

(LG 94)

Demonstration: To apply table mapping in a restriction set


Instructor Note:

Demonstrate how to create and apply a table mapping restriction set. Be aware that in the CSG environment, all classroom-created connections and universes are stored in the same centralized repository. It is therefore necessary to give a unique name to each connection and universe that are created. The demonstration indicates the different steps required in both environments. Be aware that the location for exported universes is different in the CSG and the non-CSG environment. The demonstration indicates the different steps required in both environments. Be aware that users and groups are different in the CSG and the non-CSG environment. The demonstration indicates the different steps required in both environments. 1. Create a new universe.

Securing UniversesInstructors Guide

105

CSG: TableMap_Ixx (where "xx" stands for your instructor number, for example I01 or I02). Use the MotorsOLEDB_Ixx connection. Non-CSG: TableMap. Use the MotorsOLEDB connection. 2. Insert the SALE and CLIENT tables, and add the following joins:
SALE.CLIENT_ID = CLIENT.CLIENT_ID SALE.SALE_TYPE = 'S'

3. Open the Table Browser and expand the MotorsEURO (and dbo) node. 4. Insert the SALE_EURO table. This table remains stand alone, however to ensure the correct results are returned, a self-restricting join is required:
SALE_EURO.SALE_TYPE = 'S'

5. Create a new Client class and add the following objects: Client Name
CLIENT.CLIENT_LASTNAME + ', ' + CLIENT.CLIENT_FIRSTNAME

Sales Total
sum(SALE.SALE_TOTAL)

6. Save and export your universe. CSG: Export your universe to the public folder called BOU320_<classnumber>_Pub. This is the only location that is accessible for the test sales user. Non-CSG: Export to the servername:6400 [Administrator] top folder level . This exports your universe to the default location in: C:\Documents and
Settings\<user_name>\Application Data\Business Objects\Business Objects 12.0\Universes\@<server_name>\.

7. From the Tools menu, select Manage security..., and then click Manage Access Restrictions... Note: If you have not yet exported the universe, a message box appears to indicate that you must export the universe before you can create security restrictions. 8. In the Manage Access Restrictions dialog box, click New. 9. In the Restriction Name field, type TableMap. 10.In the Edit Restriction dialog box, click the Table Mapping tab. 11.Click Add. 12.In the Original Table field select SALE, and in the Replacement Table field select SALE_EURO from the MotorsEURO database, and click OK. 13.Click Check All button to validate the status of the mapping settings, and click OK. 14.Save and export your universe.

106

Advanced Universe DesignInstructors Guide

For CSG: export your universe to the public folder called BOU320_<classnumber>_Pub. This is the only location that is accessible for the test sales user. Non-CSG: Export to the servername:6400 [Administrator] top folder level. 15.Log onto Web Intelligence Rich Client with the sales user log in credentials. CSG: A BOU320_<classnumber>_sa test sales user is precreated in the BOE system. Non-CSG: A Sales Rep user is set up according to steps outlined in the Facilities Setup Guide. 16.Run a query with Client Name and Sales Total. View the SQL to verify that this is taking the SALE_EURO table instead of the SALE table.

Activity: Working with table mapping in a restriction set

(LG 96)

Instructor Note: Allow 15 minutes for this activity. Explain the activity objective and instructions as a bridge from the lecture to the practice. Be aware that the location for exported universes is different in the CSG and the non-CSG environment. Consult the table for the information for each activity step. Be aware that users and groups are different in the CSG and the non-CSG environment. Consult the table for the information for each activity step. Review the activity with the learners to ensure that they have acquired the skills outlined in the activity objective. Note: Walk through answers to questions raised in the activity steps. Answers for the steps are outlined in the table below:
Step Details

3.

CSG: Students need to export their universe to the public folder called BOU320_<classnumber>_Pub, which is the only location that is accessible for the test sales user. Non-CSG: Students export to the servername:6400 [Administrator] top folder level. CSG: A BOU320_<classnumber>_sa test sales user is pre-created in the BOE system. Non-CSG: A Sales Rep user is set up according to steps outlined in the Facilities Setup Guide. CSG: Students need to export their universe to the public folder called BOU320_<classnumber>_Pub, which is the only location that is accessible for the test sales user.

8.

10.

Securing UniversesInstructors Guide

107

Step

Details

Non-CSG: Students export to the servername:6400 [Administrator] top folder level. CSG: A BOU320_<classnumber>_sa test sales user is pre-created in the BOE system. Non-CSG: A Sales Rep user is set up according to steps outlined in the Facilities Setup Guide.

11.

Objectives
Create a new restriction set Apply the restriction set to a user group Test the restriction set in Web Intelligence Rich Client

Instructions
In this activity you insert tables from the MotorsEURO database, which contain data in Euros instead of US dollars. In addition you use the table mapping feature in a restriction set to substitute four tables from the Motors database with the new tables from the MotorsEURO database. 1. Arrange your structure to be able to add four additional tables. Launch the Table Browser and expand the MotorsEURO (and dbo) node.

2. Insert the following tables into your structure: ANNUAL_FIGURES_EURO QUARTER_FIGURES_EURO SALE_EURO MODEL_EURO Note: These tables remain in your structure as stand-alone tables. 3. Save your universe and export it to the location specified by the instructor. To be able to use the Manage Access Restrictions menu you need to export your universe. A CUID is assigned, when you export your universe, allowing you to apply security to your universe file. 4. Go to Tools Manage Security Manage Access Restrictions and create a table mapping restriction set called Sales_Euro.

108

Advanced Universe DesignInstructors Guide

5. In the Table Mapping tab click Add. 6. In the Original Table field select ANNUAL_FIGURES. In the Replacement Table field, select ANNUAL_FIGURES_EURO from the MotorsEURO database and click OK. Repeat the for the remaining MotorsEURO tables: QUARTER_FIGURES_EURO SALE_EURO MODEL_EURO 7. Select Check All and click OK. 8. Apply this restriction set to the sales user. Check with the instructor for the exact user name to use. 9. Preview the restriction to check that it is correct. 10.Save your universe and export it to the location specified by the instructor. 11.Log onto Web Intelligence Rich Client with the sales user account. Check with the instructor for the exact user name to use. 12.Create a new report based on your exported Motors universe. 13.Run a query with Client Name and Sales Revenue. 14.View the SQL. The SALE and SALE_MODEL tables are replaced by the SALE_EURO and MODEL_EURO tables. 15.Run the report to view the results returned. The Sales Revenue data is in Euros. You can format the report to Euro currency in Web Intelligence Rich Client. 16.Run a query with Showroom and Sales Revenue. View the SQL. The ANNUAL_FIGURES table is replaced by the ANNUAL_FIGURES_EURO table.

Securing UniversesInstructors Guide

109

Quiz: Securing universes

(LG 99)

1. Universe security can be managed at which levels? Answer: Connection credentials and data source Central Management Server Universe 2. True or False. Instead of denying access per universe file, you can group universes in folders and set appropriate access rights per folder. Answer: True. 3. True or False. When the Use Single Sign-On when refreshing reports at view time option is selected for a connection, all users in the CMS that need to use this connection will require having their database user credentials set in the CMS. Answer: False. This only applies to the Use BusinessObjects credential mapping option.

110

Advanced Universe DesignInstructors Guide

Lesson summary

(LG 100)

Instructor Note: Recap the lesson objectives with the learners to check that all learners have acquired the required skills before moving on to the next section. After completing this lesson, you are now able to: Define connection and user credential parameters Work with Central Management Server (CMS) universe security Work with table mapping

Securing UniversesInstructors Guide

111

112

Advanced Universe DesignInstructors Guide

Lesson 6

Implementing Universe Life Cycle Management


Lesson introduction
(LG 101)

This lesson describes how to move content from a development environment to a production environment. After completing this lesson, you will be able to: Move content from development to production

Implementing Universe Life Cycle ManagementInstructors Guide

113

Moving content from development to production


Instructor Note: Describe unit objectives. After completing this unit, you will be able to: Describe life cycle management Use the Import Wizard Move content from a development environment to production

(LG 102)

Life cycle management


Instructor Note:

(LG 102)

Describe what is meant by life cycle management and how it is applied. Inform students that references made to objects in this content are referring to Business Intelligence content objects, not universe objects. Discuss the use of Component Unique IDs (CUIDs).

Using the Import Wizard


Instructor Note:

(LG 103)

Describe the Import Wizard and how it is used to move content. Discuss the different import scenarios available with the Import Wizard. Note: The Business Intelligence Archive Resource (BIAR) file is mentioned in this section and is discussed in more details later on in this lesson Discuss incremental import. Refer students to the BusinessObjects Enterprise XI 3.0/3.1 Import Wizard Guide for more information on the Import Wizard.

Universes and universe connections


Instructor Note:

(LG 107)

Describe the options for universes and connections in the Import Wizard.

Working with Business Intelligence Archive Resource (BIAR) files


(LG 108)
Instructor Note:

Describe what a BIAR file is and how it is used for moving content. Describe the concept of version control. Note: Describe to students that Import Wizard BIAR files are version dependent. If the file has been created with XI R2 Import Wizard it does not function correctly in the XI 3.0/3.1

114

Advanced Universe DesignInstructors Guide

Import Wizard, and vice versa, due to changes made to the XI 3.0/3.1 Import Wizard functionality.

To export data to a BIAR file

(LG 110)

To import data from a BIAR file into the destination CMS To promote universes and universe connections from a development environment to a production environment Demonstration: To export universes to a BIAR file
Instructor Note:

(LG 111)

(LG 111)

Demonstrate how to export universes to a BIAR file. Be aware that in a CSG environment export via the Import Wizard is prohibited. A simulation for exporting universes to a BIAR file is supplied in the course resources that can be shown in class to demonstrate this procedure. For a non-CSG environment the same simulation can be used, or step 2 (and substeps) can be followed to demonstrate this procedure. 1. To export to a BIAR file simulation: This simulation can be accessed from the course resources and can be run in Demonstration and Tutorial modes. This simulation is mainly supplied for use in a CSG environment, but can also be used in a non-CSG environment if preferred. a. Launch the CSG simulations navigation page of the course resources, by using one of the following options: On the welcome page click the CSG simulations link, which launches the Simulations navigation page. Explore to the Instructor_Resources CSG_simulations folder and launch the simulations.html page, which opens the Simulations navigation page. b. Select the Exporting content using a BIAR file simulation. c. Select Demonstration or Tutorial mode. Demonstration mode automatically plays the procedure steps. Tutorial mode allows you to click through the steps at your own pace. d. Depending on your settings, allow blocked content, if required. e. If required, adjust the Adobe Flash Player security settings, by selecting OK to play the simulation, or clicking the Settings button to select the appropriate Adobe Flash Player security option. 2. To export to a BIAR file procedure steps for a non-CSG environment: In a non-CSG environment you can either use the simulation file or demonstrate the steps directly in the environment as outlined below:

Implementing Universe Life Cycle ManagementInstructors Guide

115

a. Start the Import Wizard. Select Start Programs BusinessObjects XI 3.0/3.1 BusinessObjects Enterprise Import Wizard. b. Click Next twice. c. Click the Destination list and select and select Business Intelligence Archive Resource (BIAR) file. d. Click the ellipses button. e. In the File name field type CMS_Backup as the name of the BIAR file and click Open. f. Click Next. g. Select the Clear All option. h. Scroll down and select the Import universes option. i. Click Next three times. Note: You can discuss the frames with the students, depending on what you need to export to the BIAR file. You may select different options such as user access control rights, but for this demonstration, the default options are selected in each of these frames. j. Select Import all universes and only connection objects used by these universes. k. Click Next and Finish. The Import Wizard provides a summary of the elements you intend to export to the BIAR file. l. Click Done. The dialog box displays a summary of what has been exported into the BIAR file.

Demonstration: To import universes from a BIAR file


Instructor Note:

Demonstrate how to import universes from a BIAR file. Be aware that in a CSG environment import via the Import Wizard is prohibited. A simulation for importing universes from a BIAR file is supplied on the course resources that can be shown in class to demonstrate this procedure. For a non-CSG environment the same simulation can be used, or step 2 (and substeps) can be followed to demonstrate this procedure. 1. To import from a BIAR file simulation: This simulation can be accessed from the course resources and can be run in Demonstration and Tutorial modes. This simulation is mainly supplied for use in a CSG environment, but can also be used in a non-CSG environment if preferred. a. Launch the CSG simulations navigation page of the course resources, by using one of the following options: On the Welcome page click the CSG simulations link, which launches the Simulations navigation page. Explore to the Instructor_Resources CSG_simulations folder and launch the simulations.html page, whcihopens the Simulations navigation page.

116

Advanced Universe DesignInstructors Guide

b. Select the Importing a universe from a BIAR file simulation. c. Select Demonstration or Tutorial mode. Demonstration mode automatically plays the procedure steps. Tutorial mode allows you to click through the steps at your own pace. d. Depending on your settings, allow blocked content, if required. e. If required, adjust the Adobe Flash Player security settings, by selecting OK to play the simulation, or clicking the Settings button to select the appropriate Adobe Flash Player security option. 2. To import from a BIAR file procedure steps for non-CSG environments: In a non-CSG environment you can either use the simulation file or demonstrate the steps directly in the environment as outlined below. Note: A Sample.biar file is supplied on the course resources. The Sample.biar file contains a copy of the Motors universe; if you have exported your Motors universe to the CMS, the Sample.biar file version overwrites the existing universe in the CMS. You can save a local copy of your Motors universe to restore after the Sample.biar file import for further demonstrations and activities in the class. a. Start the Import Wizard. Select Start Programs BusinessObjects XI 3.0/3.1 BusinessObjects Enterprise Import Wizard. b. Click Next twice. c. Click the Source list and select and select Business Intelligence Archive Resource (BIAR) file. d. Click the ellipses button. e. Browse to the Sample.biar file and click Open. f. Click Next twice. The Sample.biar file is loaded, which may take a few minutes. g. Select the Clear All option. h. Scroll down and select the Import universes option. i. Click Next four times. Note: You can discuss the frames with the students, depending on what you need to export to the BIAR file. You may select different options such as user access control rights, but, for this demonstration, the default options are selected in each of these frames. j. Select Import all universes and only connection objects used by these universes. k. Click Next and Finish. The Import Wizard provides a summary of the elements you intend to import from the Sample.biar file. l. Click Done. After the import is complete, the dialog box displays a summary of what has been exported into the BIAR file. m. Verify what has been imported.

Implementing Universe Life Cycle ManagementInstructors Guide

117

You can verify the list of universe that have been imported, by selecting File Import in Universe Designer. The universes now available in the CMS are listed. You can verify this in the Central Management Console in the Universes directory. The universes now available in the CMS are listed. Universes that are added: Activity eFashion Island Resorts Marketing Maintaining Universes - activity Motors Motors_Security Staff

Using test folders


Instructor Note:

(LG 112)

Discuss using test folders. Stress that this is NOT the recommended way to deploy life cycle management, but can be used if no separate CMS environments can be deployed. Stress that this method can only be applied when you restrict access to the universe folders in the CMS. Stress that maintaining CUIDs is extremely important when using this method. When exporting the universe to a new folder, designers should use the option Move rather than Copy to avoid creation of new CUIDs. New CUIDs cause issues with the report dependencies. Reports can be re-pointed to the correct universe, but this is a time-consuming method. Note: Students are presented with the pros and cons of using folders, in the Moving content from development to production activity.

Life cycle management recommendations


Instructor Note:

(LG 113)

Describe Life cycle management recommendations.

Activity: Moving content from development to production

(LG 114)

Instructor Note: Allow 20 - 30 minutes for this activity. Explain the activity objective and instructions as a bridge from the lecture to the practice. Be aware that the location for exported universes is different in the CSG and the non-CSG environment. Consult the table for the information for each activity step. Be aware that users and groups are different in the CSG and the non-CSG environment. Consult the table for the information for each activity step.

118

Advanced Universe DesignInstructors Guide

Be aware that in the CSG environment all classroom-created universe folders and .wid documents are stored in the same centralized repository. It is therefore necessary to give a unique name to each connection and universe that are created. The demonstration indicates the different steps required in both environments. Review the activity with the learners to ensure that they have acquired the skills outlined in the activity objective. Note: Walk through answers to questions raised in the activity steps. Answers for the steps are outlined in the table below:
Step Details

3.

CSG: Students need to right-click the public folder called BOU320_<classnumber>_Pub, which is the only location that is accessible for the test sales user. Non-CSG: Students right-click the top node servername:6400
[Administrator]

4.

CSG: Ensure students use their initials (provided they are unique) or their student numbers (for example, "S01", "S02") as a postfix to the Development folder name to ensure a unique naming convention. Non-CSG: It is not essential to use a postfix for the Development folder name. CSG: ABOU320_<classnumber>_sa test sales user is precreated in the BOE system. Non-CSG: ASales Rep user is set up according to steps outlined in the Facilities Setup Guide. CSG: Ensure students use their initials (provided they are unique) or their student numbers (for example, "S01", "S02") as a postfix to the folder name to ensure a unique naming convention. Non-CSG: It is not essential to use a postfix for the folder name. CSG: Students log in with their CSG student login name. Non-CSG: Students use Administrator as login name. CSG: Students need to right-click the public folder called BOU320_<classnumber>_Pub, which is the only location that is accessible for the test sales user. Non-CSG: Students right-click the top node servername:6400
[Administrator]

7.

10.

11.

14.

Implementing Universe Life Cycle ManagementInstructors Guide

119

Step

Details

15.

CSG: Ensure students use their initials (provided they are unique) or their student numbers (for example, "S01", "S02") as a postfix to the Production folder name to ensure a unique naming convention. Non-CSG: It is not essential to use a postfix for the Production folder name. CSG: ABOU320_<classnumber>_sa test sales user is precreated in the BOE system. Non-CSG: ASales Rep user is set up according to steps outlined in the Facilities Setup Guide. CSG: Students log in with their CSG student login name. Non-CSG: Students use Administrator as login name. CSG: Students need to export their universe to the private folder called BOU320_<classnumber>_Priv, which is the only location that is not accessible for the test sales user. Non-CSG: Students export to LifeCycle folder, as set up according to steps outlined in the Facilities Setup Guide. This folder is not accessible to the Sales Rep user. CSG: ABOU320_<classnumber>_sa test sales user is precreated in the BOE system. Non-CSG: ASales Rep user is set up according to steps outlined in the Facilities Setup Guide.

18.

20.

25.

26.

Objective
Use test folders

Instructions
Create two new folders: Development and Production. Folders can be created directly in Universe Designer, as well as in the Central Management Console. In this activity the folders are created in Universe Designer. Create a Web Intelligence Rich Client report based on your Motors universe and explore what happens when the universe is moved and/or copied from the development folder to the production folder.

120

Advanced Universe DesignInstructors Guide

1. In Universe Designer go to File Import to import your Motors universe from the folder it was exported to in the last activity. 2. Click File Export. 3. In the Export Universe menu click Browse. 4. Right-click the folder specified by the instructor and select New Folder. Name the folder Development_xx, where "xx" stands for your initials. 5. Select your new Development folder and click OK twice to export your Motors universe to this new folder. As your universe was exported in the previous activity, a warning message appears. 6. Select Move to ensure there is only one version of your Motors universe. 7. Log into Web Intelligence Rich Client with the sales user. Check with the instructor for the exact user name to use. 8. Create a new Web Intelligence Rich Client document using your Motors universe from your Development folder. 9. Add the Client Name and Sales Revenue objects to the report. 10.Save the report locally as Dev_xx.wid file, where "xx" stands for your initials. 11.Log into Universe Designer with the login name used throughout the course (the same login name used in step 1), and import your Motors universe from your Development folder. 12. Click File Export. 13.In the Export Universe menu click Browse. 14.Right-click the folder specified by the instructor (same location used to create the Development_xx folder) and select New Folder. 15.Name the folder Production_xx, where "xx" stands for your initials. 16.Export your universe to your new Production folder. A warning message appears. 17.Select Move to ensure there is still only one version of your Motors universe. 18.Log into Web Intelligence Rich Client with the sales user. Check with the instructor for the exact user name to use. Use the same user name that was used in step 5. 19.Open your Dev.wid file. Refresh the data, and verify that you can edit the query. Although your universe is in a new location the CUID has been retained and your report can refresh correctly. 20.Log into Universe Designer with the login name used throughout the course (the same login name used in step 1 and step 6), and export your universe to your Development folder. 21.Select the Copy option. The original version of your Motors universe file remains in your Production folder, and a copy of the same universe is created in your Development folder.

Implementing Universe Life Cycle ManagementInstructors Guide

121

22.Import your Motors universe from your Production folder. 23. Click File Export. 24.In the Export Universe menu click Browse. 25.Export your Motors universe file (previously located in your Production folder) to the folder location specified by the instructor. Note: The location the original Motors universe is now exported and is not accessible to the sales user. 26.Log into Web Intelligence Rich Client with the sales user. Check with the instructor for the exact user name to use. Use the same user name that was used in step 5 and step 10. 27.Open your Dev.wid file. Refresh the data, and verify that you can edit the query. The copy of your universe in your Development folder has been given a new CUID. The report can not be refreshed against this universe, and the test sales user has no access to the other universe location.

122

Advanced Universe DesignInstructors Guide

Quiz: Implementing universe life cycle management (LG 116)


1. True or False. When importing documents from a BIAR file, both the universe name and path are used for finding dependent documents. Answer: False. It uses CUID to find the dependencies. 2. True or False. The Import Wizard acts as a bridge between the source repository and target repository, or the CMS database. It can promote content between clusters on the same network (LAN or WAN). Answer: True. 3. True or False. When using the Import Wizard to promote an object from one BusinessObjects Enterprise XI 3.0/3.1 deployment to another, the wizard allows you to use either the objects CUID or its name and path to determine whether the object already exists on the destination environment. It also lets you specify what you want the wizard to do when it finds that an object already exists on the destination environment. Answer: True.

Implementing Universe Life Cycle ManagementInstructors Guide

123

Lesson summary

(LG 117)

Instructor Note: Recap the lesson objectives with the learners to check that all learners have acquired the required skills before moving on to the next section. After completing this lesson, you are now able to: Move content from development to production

124

Advanced Universe DesignInstructors Guide

Lesson 7

Maintaining and Optimizing Universes


Lesson introduction
(LG 119)

After you have completed the universe and then deployed it to the end-user population in your organization for report creation, you must maintain the universe to ensure that it continues to function correctly and provide the reports with accurate results. As a designer you can apply several parameters that are universe based or data access specific in order to maximize the potential of a universe. After completing this lesson, you will be able to: Optimize universes Apply foreign key index awareness Apply best practices for universe design

Maintaining and Optimizing UniversesInstructors Guide

125

Optimizing universes

(LG 120)

As a designer you can apply several parameters that are universe based or data access specific in order to maximize the potential of a universe. In the BusinessObjects XI 3.0/3.1: Universe Design course you looked at how you can set specific parameters when creating a new universe or via File Parameters menu. This unit looks at a more in depth insight into the parameters that can be set in the Universe Parameters Parameters menu, together with a look at other performance enhancing parameters that can be specified in the BusinessObjects product suite. Describe data access files and connection parameters Set up a trace file Use BusinessObjects dynamic SQL parameters

The Connection Server


Instructor Note:

(LG 120)

Provide an overview of the Connection Server, data access drivers and the cs.cfg file. Note: Data access files are explained in further detail in the Data Access Files appendix. Inform students that more information on parameters set in each data access file can be found in the Designer Online Help files and in the BusinessObjects XI 3.0:/3.1 Designer's Guide, and the BusinessObjects XI 3.0/3.1: Data Access Guide guide.

Setting up a trace file


Instructor Note:

(LG 121)

Describe how you can use the BO_trace.ini file to trace errors in Universe Designer and Web Intelligence Rich Client.

To trace the full-client BusinessObjects products Connection configuration parameters


Instructor Note:

(LG 121)

(LG 122)

Describe the parameters you can set in the configuration menu of the connection. Note: In prior versions of BusinessObjects these are referred to as the advanced connection parameters.

Demonstration: To access the connection configuration parameters


Instructor Note:

126

Advanced Universe DesignInstructors Guide

This demonstration is not based on a generic procedure in the Learner's Guide. Demonstrate how to access the connection configuration parameters by using your saved Motors universe and your MotorsOLEDB connection. 1. Open your Motors universe file in Universe Designer. Note: The universe was exported in the previous lesson. Use File Import to open the universe. 2. Select File Parameters. 3. In the Definition tab edit your MotorsOLEDB connection. Click Edit. 4. Click Next. The Configuration Parameters menu opens. Describe the use of the parameters (as outlined in the Learners Guide).

Custom connection parameters


Instructor Note:

(LG 124)

Describe the different custom connection parameters that can be set in the Custom Parameters menu.

Demonstration: To access the custom connection parameters


Instructor Note:

This demonstration is not based on a generic procedure in the Learner's Guide. Demonstrate how to access the custom connection parameters by using your saved Motors universe and your MotorsOLEDB connection. 1. With your Motors universe file opened in Universe Designer, select File Parameters. 2. In the Definition tab edit the MotorsOLEDB connection. Click Edit. 3. Click Next twice. The Custom Parameters menu opens. Describe the ConnectInit parameter shown in this window (as outlined in the Learner's Guide). Note: You can discuss the Hints option which is Oracle specific, and as the connection points to SQL Server, may not appear as an option to use, and cannot be shown as an example. Information on this can be found in the Learner's Guide.

Dynamic SQL parameters


Instructor Note:

(LG 126)

Show students the location of the parameters.

Maintaining and Optimizing UniversesInstructors Guide

127

Inform students that these parameters used to be part of the PRM file and would be applied to all universes that use the same middleware connection. These parameters can now be defined per individual UNV file, making this a more dynamic solution. Note: Information on Dynamic SQL parameters can be found in the BusinessObjects XI 3.0/3.1: Designer's Guide, and in the Online Help option in Universe Designer. Point out the location in the Help menu by selecting Building a universe > Universe SQL parameters reference in the Help menu > Contents tab. Discuss parameters listed in the Help topic.

To edit a dynamic SQL parameter

(LG 126)

Adapting dynamic SQL parameters


Instructor Note:

(LG 127)

Inform students of the dynamic SQL functions that are covered in this lesson.

BEGIN_SQL
Instructor Note:

(LG 127)

Provide an overview of the BEGIN_SQL parameter. This course does not present a direct example of the BEGIN_SQL parameter for SQL Server.

END_SQL

(LG 127)

Instructor Note:

Q & A scenario: Address the following Q & A scenario to the students: As a DBA you are asked to monitor query usage and are tasked to find out which user is running which query. There are some long-running queries detected that need to be terminated due to maintenance and the end users that are running those queries need to be informed. The Enterprise system is configured so that it uses only one generic connection (=generic user login/pw) for all queries using one universe. Question: How do you find out which users are running the long queries? Note: Students may mention using auditor to track all BO activity, but point out that this does not highlight the specific users that are running the queries due to the generic login. Answer: Using the END_SQL parameter. Describe what the END_SQL parameter does.

128

Advanced Universe DesignInstructors Guide

ANSI92 and FILTER_IN_FROM


Instructor Note:

(LG 128)

Describe that conditions/quick filter results, and self-restriction joins still appear in the WHERE clause. Describe that these can also be moved to the FROM clause by applying the FILTER_IN_FROM parameter.

Demonstration: To edit the End_SQL parameter


This demonstration is not based on a generic procedure in the Learner's Guide. Demonstrate how to add the END_SQL parameter by using your saved Motors universe. 1. With your Motors universe file opened in Universe Designer, select File Parameters Parameter. The Parameter dialog box opens. 2. Scroll down to navigate the list of parameters, and select the END_SQL parameter. 3. In the Value box add the following syntax:
/*@variable('BOUSER')*/

4. Click Replace. Note: The End_SQL parameter in universe property allows you to insert a string at the end of the SQL generated by a query. The variables are stated in a comment field and evaluated when running a query. The query is generated with the explicit sentence. 5. Click OK to close the Parameter dialog box. 6. Save your universe locally. 7. Create a new Web Intelligence Rich Client document. 8. Select your Motors universe. 9. Add Showroom and Sales Revenue to the Result Objects pane. 10.Click the View SQL icon. Note: The last line in the SQL contains the syntax added to the END_SQL parameter in the Parameter dialog box. 11.Run the query and return to the Query Panel. 12.View the SQL again and note that the BOUSER variable entry is replaced by your user name.

About ANSI92 SQL syntax


Instructor Note:

(LG 129)

Maintaining and Optimizing UniversesInstructors Guide

129

Describe that the ANSI92 syntax moves join references from the WHERE clause to the FROM clause, which can help decrease the quantity of data parsed by the database. Inform students that ANSI92 syntax is set as a default parameter in the <driver>.prm files for RDBMS that support this type of SQL syntax.

The ANSI92 dynamic SQL parameter


Instructor Note:

(LG 130)

Describe the ANSI92 dynamic SQL parameter, and how changing this parameter impacts the generated SQL.

Demonstration: To edit the ANSI92 parameter


Instructor Note:

Demonstrate the effect the ANSI92 parameter has on the generated SQL. Demonstrate by using your saved Motors universe. 1. Open your Motors universe file in Universe Designer. 2. With your Motors universe file opened in Universe Designer, select File Parameters Parameter. The Parameter dialog box opens. 3. Scroll down to navigate the list of parameters, and select the ANSI92 parameter. 4. Replace the default with Yes. Type Yes in the Value box. 5. Click Replace to apply the changes. 6. Click OK to close the Parameter dialog box. 7. Save the changes in your Motors universe and create a new Web Intelligence Rich Client report using Client Name, Client Country, and Number of Clients. 8. Click View SQL. The structure now shows the join references in the FROM clause (that use INNER JOIN references) rather than in the WHERE clause. 9. Demonstrate that WHERE clause restrictions still appear. Apply a Quick Filter on Region. Select the values East and North. The quick filter restriction for Region shows up in the WHERE clause.

Demonstration: To test the effects of the FILTER_IN_FROM parameter


Instructor Note:

This demonstration is not based on a generic procedure in the Learner's Guide.

130

Advanced Universe DesignInstructors Guide

Demonstrate by using your saved Motors universe. Inform students that by changing the FILTER_IN_FROM parameters to Yes, this parameter is applied to the whole universe. The FILTER_IN_FROM functionality can, however, be applied to individual classes and objects. Note: This functionality is only available if the ANSI92 parameter has been set to Yes or when the PRM file has ANSI92 set as the default. 1. In your Motors universe, set the FILTER_IN_FROM parameter to Yes. 2. Ensure that the ANSI92 parameter is also set to Yes. 3. Save the changes. 4. Create a new Web Intelligence report using Client Name, Region, and Number of Clients in the Result Objects pane. 5. Apply a quick filter to Region. Select the values East and North. 6. Click View SQL. The Region condition now appears as part of the FROM clause and no WHERE clause is generated.

Applying the FILTER_IN_FROM functionality to individual classes and objects (LG 131)
Instructor Note:

Inform students that you can apply the FILTER_IN_FROM functionality to individual classes and objects. Emphasize that in order to apply the FILTER_IN_FROM functionality to individual classes and objects, ANSI92 needs to be set, either as dynamic SQL parameter, or via the PRM file. Explain that in order to apply the FILTER_IN_FROM functionality to individual classes and objects, the FILTER_IN_FROM dynamic SQL parameter needs to be set to No.

To apply FILTER_IN_FROM functionality to individual classes and objects (LG 132) Demonstration: To apply FILTER_IN_FROM functionality to individual classes and objects
Instructor Note:

Demonstrate how to apply FILTER_IN_FROM clause functionality to individual classes and objects. Demonstrate by using your saved Motors universe. Note: To demonstrate this option ensure that the FILTER_IN_FROM parameter is set to NO and the ANSI92 parameter set to YES.

Maintaining and Optimizing UniversesInstructors Guide

131

Steps 1. 2. 3. 4. 5. 6. 7.

Values

Motors

MODEL.MAKER_ID = MAKER.MAKER_ID

Select objects in FROM Car class, Sale Prices subclass, and Day Rental Charges subclass, and all objects in each of these classes.

8.

9. 10.

No other joins need to be edited. Save your changes.

1. Open your universe file in Universe Designer. 2. Select File Parameters Parameter. 3. Change the default value for the ANSI92 parameter to Yes. 4. Ensure the FILTER_IN_FROM parameter is set to No. 5. Double-click a join in the Structure pane. The Edit Join properties open for the selected join.

132

Advanced Universe DesignInstructors Guide

6. Click the Advanced button. Note: This button is active only if the ANSI92 dynamic SQL parameter is set to Yes or when the PRM file has ANSI92 set as the default. The Advanced Join Properties dialog box opens.

Maintaining and Optimizing UniversesInstructors Guide

133

7. Select the appropriate option from the behavior drop-down list.

8. Select the appropriate classes and objects.

134

Advanced Universe DesignInstructors Guide

9. Click OK to apply the changes. 10.Repeat steps for other joins in the schema.

Demonstration: To test FILTER_IN_FROM functionality applied to individual classes and objects


Instructor Note:

Demonstrate how to test FILTER_IN_FROM clause functionality applied to individual classes and objects. Demonstrate by using your saved Motors universe. 1. With your Motors universe file open in Universe Designer, select Tools Query Panel. 2. Add Maker Country, Maker, and Model to the Result Objects pane. 3. Add a filter to the Maker object and add a filter to the Model object. 4. View the SQL. The filter placed on the Model object is added to the FROM clause, as this object was selected in the Advanced Join Editor dialog box. However, the Maker filter still appears in the WHERE clause, because this object was not selected in the Advanced Join Editor dialog box. 5. Change all altered dynamic SQL parameters in your universe back to their default settings (END_SQL, ANSI92, and FILTER_IN_FROM).

The JOIN_BY_SQL parameter


Instructor Note:

(LG 135)

Describe the Join By SQL parameter. Demonstrate adding the JOIN_BY_SQL parameter to the parameters dialog box.

Activity: Using dynamic SQL parameters

(LG 136)

Instructor Note: Allow 10 - 20 minutes for this activity. Explain the activity objective and instructions as a bridge from the lecture to the practice. Review the activity with the learners to ensure that they have acquired the skills outlined in the activity objective. At the end of the activity review the questions raised in the activity. Answers to the questions, substeps, or instructor tips are shown in the table:
Instructions: Apply the JOIN_BY_SQL parameter Step 12. Answer/Result

The SQL is merged into one statement using the COALESCE function.

Maintaining and Optimizing UniversesInstructors Guide

135

Instructions: Apply the ANSI92 and FILTER_IN_FROM parameters Step Answer/Result

12.

Yes, the Region object was checked in the Advanced Join Properties and conditions based on this object appear in the FROM clause. Yes, the Client Name object was checked in the Advanced Join Properties and conditions based on this object appear in the FROM clause. The Area Code object condition shows up in the WHERE clause; the Region condition shows up in the FROM clause.

14.

18.

In step 6 students are asked to check the Region and Client Name dimensions only; the detail objects associated to the Client Name should, therefore, be cleared. Any conditions on those detail objects go in the WHERE clause and not in the FROM clause.

Objectives
Apply the JOIN_BY_SQL parameter Apply the END_SQL parameter Apply the ANSI92 and FILTER_IN_FROM parameters

Instructions: Apply the JOIN_BY_SQL parameter


1. Create a new Web Intelligence Rich Client document based on your Motors universe. Drag the Client Name, Number of Clients, and Number of Cars Sold objects to the Result Objects pane. 2. Click View SQL to see the results. The query generates two statements. 3. Log out of Web Intelligence Rich Client. 4. Launch Universe Designer and open your Motors universe file. Note: The universe was exported in the previous lesson; select FileImport to import your universe. 5. Select File Parameters Parameter. The Parameter dialog box opens. 6. Locate the JOIN_BY_SQL parameter and change this to Yes. 7. Click Replace to apply the changes. 8. Click OK to close the Parameter dialog box.

136

Advanced Universe DesignInstructors Guide

9. Save the changes locally. 10.Launch Web Intelligence Rich Client and create a new document based on your Motors universe. 11.Drag the Client Name, Sales Revenue, and Rental Revenue objects into the Result Objects pane. 12.Click View SQL to see the results. What has happened to the results? 13.Log out of Web Intelligence Rich Client.

Instructions: Apply the END_SQL parameter


1. With your Motors universe open in Universe Designer, select File Parameters Parameter. The Parameter dialog box opens. 2. Locate the END_SQL parameter. 3. In the Value box add the following syntax:
/*@variable('BOUSER'); @variable('UNVNAME'); @variable('DOCNAME'); @variable('DPNAME'); @variable('DPTYPE')*/

4. Click Replace. The parameter syntax for END_SQL is now modified. Note: The END_SQL parameter in the universe properties allows you to insert a string at the end of the SQL generated by a query. The variables are stated in a comment field and evaluated when running a query. The query is generated with the explicit sentence. 5. Click OK to close the Parameter dialog box. 6. Save your universe locally. 7. Test the results in Web Intelligence Rich Client. Run a query with Showroom and Sales Revenue. 8. Click the View SQL icon. The generated SQL appears in the SQL Viewer. The last line in the SQL contains the syntax added to the END_SQL parameter in the Parameter dialog box. 9. Run the query and return to the Query Panel by editing the query. 10.View the SQL. The END_SQL was executed at query run time. When viewing the SQL after running the query, you can see that the variable values are populated.

Instructions: Apply the ANSI92 and FILTER_IN_FROM parameters


1. , select FileParametersParameter and change the ANSI92 parameter to Yes. 2. With your Motors universe open in Universe Designer, select File Parameters Parameter. The Parameter dialog box opens.

Maintaining and Optimizing UniversesInstructors Guide

137

3. Locate the ANSI92 parameter and change this to Yes. 4. Click Replace and then OK. 5. Double-click the join between the CLIENT and the REGION tables. 6. Click Advanced. 7. Choose the Selected objects in FROM option. 8. Select the Region and the Client Name objects only. Note: All detail objects below the Client Name are NOT selected. 9. Click OK twice. 10.Save your universe locally. 11.Create a new Web Intelligence Rich Client report with the Client Name and Region objects. Apply a Quick Filter on the Region object and select a few values from the list. 12.View the SQL. Is the Region object condition showing up in the FROM clause? 13.Remove the filter and apply a Quick Filter on the Client Name object and select a few values from the list. 14.View the SQL. Is the Client Name condition showing up in the FROM clause? 15.Remove the filter and drag in the Area Code detail object. 16.Apply a Quick Filter on the Region object and select the East Coast value. 17.Apply a second Quick Filter on the Area Code object and select the values 10011 and 10012. 18.View the SQL. What is happening with the WHERE and FROM clauses? Why is this happening? 19.Return to Universe Designer and open your Motors universe file. 20.Change the FILTER_IN_FROM parameter to Yes. Click Replace. 21.Click OK to close the Parameter dialog box. 22.Launch Web Intelligence Rich Client and create a new report with Client Name, Region, and Sales Revenue. Add a quick filter on Region, and select the values East and North. 23.Click View SQL to see the results. The SQL statement contains the INNER JOIN statements and there is no longer a WHERE clause generated. 24.Log out of Web Intelligence Rich Client. 25.Change all altered parameters in your universe back to their default settings (END_SQL, JOIN_BY_SQL, ANSI92, and FILTER_IN_FROM).

138

Advanced Universe DesignInstructors Guide

Applying index awareness


Instructor Note: Define unit objectives.

(LG 139)

The BusinessObjects XI 3.0/3.1: Universe Design course looked at applying primary key index. This unit further explores index awareness by setting foreign key awareness, and how Universe Designer takes advantage of primary and foreign keys that may already exist in the data source. After completing this unit, you will be able to: Understand foreign awareness Set up foreign key index awareness

What is index awareness?


Instructor Note:

(LG 139)

Describe index awareness and what it is used for. Provide an overview of both primary and foreign key awareness. Note: Applying primary key index has been covered in the BusinessObjects XI 3.0/3.1: Universe Design course. Note: ANSI92 is automatically applied when using SQL Server. The sqlsvr_prm file contains a parameter that is set to ANSI 92:
<Parameter Name="OUTERJOINS_GENERATION">ANSI_92</Parameter>

Demonstration: To review applied primary key index awareness


Instructor Note:

Note: Applying primary key index has been covered in the BusinessObjects XI 3.0/3.1: Universe Design course. Familiarize the students with the already applied primary key index. Demonstrate this by running a query in Web Intelligence Rich Client based on your saved Motors universe. 1. Run a new query in Web Intelligence Rich Client and drag, Client Name, and into the Result Objects pane. 2. Drag Client Country into the Query Filters pane. 3. Select In List. 4. Select Value(s) from list. 5. Select United Kingdom and USA as values. 6. Click the View SQL icon on the toolbar.

Maintaining and Optimizing UniversesInstructors Guide

139

The name values have been replaced by the primary index key value:
SELECT CLIENT.CLIENT_LASTNAME +', '+ CLIENT.CLIENT_FIRSTNAME, FROM CLIENT INNER JOIN REGION ON (CLIENT.REGION_ID=REGION.REGION_ID) INNER JOIN COUNTRY COUNTRY_REGION ON (COUNTRY_REGION.COUNTRY_ID=REGION.COUNTRY_ID) WHERE ( COUNTRY_REGION.COUNTRY_ID In ( 44,1 ) AND (COUNTRY_REGION.COUNTRY_ID=CLIENT.COUNTRY_ID) )

Note: If the FILTER_IN_FROM parameter is also set for the universe, the index awareness condition appears in the FROM clause, instead of in the WHERE clause.

Avoiding joins in tables


Instructor Note:

(LG 140)

Describe that by applying foreign index awareness, you can avoid joins in query generation.

To set up foreign key index awareness

(LG 141)

Demonstration: To set up foreign key index awareness


Instructor Note:

Demonstrate how to set up foreign key index awareness. Demonstrate this by using your saved Motors universe file.
Steps 1. 2. 3. 4. 5. 6. 7. CLIENT.COUNTRY_ID Values

Client Country

140

Advanced Universe DesignInstructors Guide

Steps

Values

Save your Motors universe file and demonstrate the SQL results in Web Intelligence Rich Client: 1. Run a new query in Web Intelligence Rich Client and dragClient Name into the Result Objects pane. 2. Drag Client Country into the Query Filters pane. 3. Select In List. 4. Select Value(s) from list. 5. Select United Kingdom and USA as values. 6. Click the View SQL icon on the toolbar.
7a.

By defining the foreign key in the Client Country object, the same query returns the following SQL:
SELECT CLIENT.CLIENT_LASTNAME +', '+ CLIENT.CLIENT_FIRSTNAME, FROM CLIENT WHERE ( CLIENT.COUNTRY_ID In ( 44,1 ) )

The Country_Region table is no longer referenced in the SQL. This table no longer appears in the FROM clause, nor in the WHERE clause as a join to the Client table noras a table used to retrieve the condition values from. Note: If the FILTER_IN_FROM parameter is also set for the universe, the index awareness condition appears in the FROM clause, instead of in the WHERE clause.

1. Right-click the object on which you are setting up index awareness and select Object Properties from the shortcut menu. The Edit Properties dialog box displays. 2. Click the Keys tab. 3. Click Insert. A key line is inserted in the list of keys box. 4. To define key awareness for the foreign key: Select Foreign in the Key Type list. Click in the Select field and then click the ... button. In the Edit Select Statement dialog box, use the SQL Editor to build the foreign key SQL SELECT or type it directly. 5. Select Enable. 6. Repeat the steps for all columns in the foreign key and then click OK.

Maintaining and Optimizing UniversesInstructors Guide

141

Multiple foreign key entries


Instructor Note:

(LG 141)

Describe the given scenario where you can have multiple foreign key entries. This scenario is emphasized in the To apply Multiple Foreign Key entries demonstration.

Demonstration: To apply multiple foreign key entries


Instructor Note:

This demonstration is not based on a generic procedure in the Learner's Guide. Note: There is no activity on index awareness in this advanced course. Encourage students to follow along with the demonstration. Demonstrate this by using your saved Motors universe file. 1. Right-click the Client Country object and select Object Properties from the shortcut menu. 2. Click the Keys tab. 3. Ensure the following keys are applied: primary key:
COUNTRY_REGION.COUNTRY_ID

Note: In the Setting up index awareness activity in the BusinessObjects XI 3.0/3.1: Universe Design core course this primary key was already applied. If you have followed all the activities, you do not need to apply this key. foreign key:
CLIENT.COUNTRY _ID

Note: This key is already there, because you added in the To set up foreign key index awareness demonstration. foreign key:
REGION_COUNTRY_ID

4. Save your universe locally. 5. Demonstrate the effect after you have applied multi-key index awareness. View the generated SQL results in Web Intelligence Rich Client: 1. Run a new query and drag Client Name, Region, and Sales Revenue into the Result Objects pane. 2. Drag Client Country into the Query Filters pane. 3. Select In List. 4. Select Value(s) from list. 5. Select United Kingdom and USA as values. 6. Click View SQL.

142

Advanced Universe DesignInstructors Guide

6. In Universe Designer, open your Motors universe and rearrange keys, placing the CLIENT.COUNTRY_ID as the last foreign key entry.

7. Save your universe and demonstrate the SQL results in Web Intelligence Rich Client by using the same query as before. 8. Optional steps: Illustrate that a shortcut join takes precedence using the following steps: a. Open your Motors universe. b. Create a shortcut join between COUNTRY_REGION and CLIENT. c. Edit the Client Country object. d. Rearrange the keys on the Keys tab so that REGION.COUNTRY_ID is the last key in the list. e. Save your universe and show the SQL results in Web Intelligence Rich Client. The SQL does not use the REGION.COUNTRY_ID for the restriction, even though it is the last foreign f=key defined in the Keys tab. The shortcut join takes precedence. f. Remove shortcut join between COUNTRY_REGION and CLIENT from the schema and save your universe file.

SQL Editor dialog box


Instructor Note:

(LG 143)

Describe how you can add text to the keys in the SQL Editor dialog box.

To add a string value in the SQL Editor dialog box

(LG 143)

Demonstration: To add a string value in the SQL Editor dialog box


Instructor Note:

Demonstrate how to add a string value in the SQL Editor dialog box. Demonstrate this by using your saved Motors universe file.
Steps 1. Values

Client Country

Maintaining and Optimizing UniversesInstructors Guide

143

Steps

Values COUNTRY_REGION.COUNTRY_ID

2.

Append the following syntax:


/*Index Awareness Primary Key*/

CLIENT.COUNTRY_ID 3.

Append the following syntax:


/*Index Awareness Foreign Key*/

4.

1. Edit the object that has been made index aware and click the Keys tab. 2. Double-click the primary key select statement and append an appropriate string value. String values need to be appended by "/*" and closed with "*/" 3. Double-click the foreign key select statement and append an appropriate string value. String values need to be appended by "/*" and closed with "*/" 4. Click OK to apply your changes.

Using an index awareness WHERE clause


Instructor Note:

(LG 143)

Describe how you use WHERE clauses in key awareness.

To add a string value in the SQL Editor dialog box

(LG 143)

Demonstration: To add an index awareness WHERE clause


Instructor Note:

Demonstrate how to add an index awareness WHERE clause. Demonstrate this by using your saved Motors universe file. Note: A primary key index awareness WHERE clause condition was already inserted during the core Universe Designer course and needs to be replaced by the value indicated in the corresponding procedure step.
Steps 1. Values

Client Country

144

Advanced Universe DesignInstructors Guide

Steps 2.

Values COUNTRY_REGION.COUNTRY_ID

3.

Remove the existing WHERE clause condition and replace it with the following syntax:
COUNTRY_REGION.COUNTRY_ID in (1, 39, 44)

4.

CLIENT.COUNTRY_ID

5. 6.

CLIENT.COUNTRY_ID in (39, 44, 1)

Save your Motors universe, and demonstrate the SQL results in Web Intelligence Rich Client: 1. Create a new query in Web Intelligence Rich Client 2. Add Region to the Result Objects pane and add Client Country to the Query Filters pane. Select the values USA and United Kingdom. 3. View SQL. The AND clause should refer to the primary key. The order of the IDs (and string value text) should show this.
6a.

4. Close the SQL Viewer. Replace the Region object by the Client Name object in the Result Objects pane. 5. View the SQL. The AND clause should refer to the foreign key. Note: The SQL changes depend on the objects used. If the SQL passes through the foreign key, the foreign key indexing and the foreign key WHERE clause are used . The last listed foreign key entry takes precedence, unless a shortcut key is used in the schema. Shortcut keys take precedence over a listed foreign key index.

1. Double-click the object on which you are setting up index awareness and select the Keys tab. 2. Double-click the primary key Where clause field. 3. Type in the required WHERE clause syntax. 4. Double-click the foreign key Where clause field. 5. Enter the required WHERE clause syntax. 6. Click OK to apply the changes.

Maintaining and Optimizing UniversesInstructors Guide

145

Applying best practices for universe design


Instructor Note: Define unit objectives.

(LG 144)

As with any project you should always base your universe design and implementation on best practices. This unit summarizes some of the recommended guidelines for universe design. After completing this unit, you will be able to: Describe best practices for universe design Trace universe errors

Best practices for designing and optimizing your universe


Instructor Note:

(LG 144)

Describe the best practices for general universe creation, classes and objects, and for joins.

146

Advanced Universe DesignInstructors Guide

Quiz: Maintaining and optimizing universes

(LG 147)

1. True or False. Adding new tables or columns to the database impacts the reports that are already created and refreshed regularly by end users. Answer: False. 2. True or False. In the case of a column name change, you only need to edit all the objects that referred to the original column. Answer: True. 3. True or False. Setting the FILTER_IN_FROM parameter to Yes moves the SELECT clause data of a query to the FROM clause. Answer: False.

Maintaining and Optimizing UniversesInstructors Guide

147

Lesson summary

(LG 148)

Instructor Note: Recap the lesson objectives with the learners to check that all learners have acquired the required skills before moving on to the next section. After completing this lesson, you are now able to: Optimize universes Apply foreign key index awareness Apply best practices for universe design

148

Advanced Universe DesignInstructors Guide

Lesson 8

Creating Universes from Other Data Sources


Lesson introduction
(LG 149)

The universe access list continues to grow as the variety of data sources evolve in customer environments. Using Universe Designer, you can create a universe from a data source, such as XML files or Oracle Analytic Workspaces, OLAP cubes, Stored Procedures, and JavaBeans. After completing this lesson, you will be able to: Create a universe from an XML metadata file Create stored procedure and JavaBeans universes Work with OLAP universes

Creating Universes from Other Data SourcesInstructors Guide

149

Creating a universe from an XML data source


Instructor Note: Describe the unit objectives.

(LG 150)

You can use Universe Designer to create a universe from a XML data source, by using the Metadata Exchange panel. Once the universe has been created it can be exported to the Central Management Server (CMS) as any other universe, and is then available to end users to run queries and create reports on. Note: The Metadata Exchange wizard is also available in stand-alone mode. To access the Metadata Exchange panel in stand-alone mode launch Universe Builder via Start Programs BusinessObjects XI 3.0/3.1 BusinessObjects Enterprise Universe Builder. After completing this unit, you will be able to: List the data sources you can use with the Metadata Exchange panel Describe the Metadata Exchange panel functions Create a new universe from an XML data source

Which data sources are supported in the Metadata Exchange panel? (LG 150)
Instructor Note:

Describe the data sources that can be used in the Metadata Exchange panel. This lesson presents creating universes from the Common Warehouse Model XML data source.

Working with the Metadata Exchange panel


Instructor Note:

(LG 150)

Describe the Metadata Exchange panel, and how it is used.

To create a universe from a CWM Relational 1.0/1.1 metadata file


(LG 151)

Demonstration: To create a universe from a CWM Relational 1.0/1.1 metadata file


Instructor Note:

Demonstrate creating a universe from a CWM Relational 1.0/1.1 metadata file. Be aware that in a CSG environment the use of the Metadata Exchange panel is prohibited. A simulation for creating a universe from an XML data source is supplied in the course resources that can be shown in class to demonstrate this procedure. For a non-CSG

150

Advanced Universe DesignInstructors Guide

environment the same simulation can be used, or step 2 (and substeps) can be followed to demonstrate this procedure. 1. Creating a universe from an XML data source simulation: This simulation can be accessed from the course resources and can be run in Demonstration and Tutorial modes. This simulation is mainly supplied for use in a CSG environment, but can also be used in a non-CSG environment if preferred. a. Launch the CSG simulations navigation page of the course resources, by using one of the following options: On the welcome page click the CSG simulations link, which launches the Simulations navigation page. Explore to the Instructor_Resources CSG_simulations folder and launch the simulations.html page, which opens the Simulations navigation page. b. Select the Creating universes from metadata simulation. c. Select Demonstration or Tutorial mode. Demonstration mode automatically plays the procedure steps. Tutorial mode allows you to click through the steps at your own pace. d. Depending on your settings, allow blocked content, if required. e. If required, adjust the Adobe Flash Player security settings, by selecting OK to play the simulation, or clicking the Settings button to select the appropriate Adobe Flash Player security option. 2. Creating a universe from an XML data source for non-CSG environments: In a non-CSG environment you can either use the simulation file, or demonstrate the steps directly in the environment as outlined below. Students can follow along using the same .xml file on the course resources. a. Copy the sample_cwm_10.xml file from the Demonstration_Resources in the course resources to your local drive. b. From the File menu in Universe Designer, select Metadata Exchange. The Metadata Exchange panel displays. c. In the Metadata Exchange panel, click the drop-down arrow next to the Create a universe from the drop-down list. d. Select the CWM Relational 1.0/1.1 Metadata format. e. Click OK. The CWM Relational 1.0 Universe Builder wizard appears. f. Click Next to continue. g. In the Universe creation - Step 1/5 wizard page, browse to the location of your sample_cwm_10.xml XML metadata file. h. Click Next to continue. i. Select Database1 to highlight it and click Next. j. Expand the PRODUCT table node to view the columns.

Creating Universes from Other Data SourcesInstructors Guide

151

k. Use the >> button to move all the contents of the file. l. Click Next to continue. The Universe creation - Step 4/5 wizard page displays. This page allows you to select the connection the universe uses to connect to the data source. For the purposes of this course, you do not actually connect the universe to a data source, so it is not important which connection is selected here. m. In the Universe name field enter MetaUniv. The universe name must be eight characters or less. n. Click OK to close the Options dialog box, and then click Next to continue The Universe creation - Step 5/5 wizard page appears. This page summarizes the connection and file information that are used to create the universe. o. Click Finish. The universe displays with classes, objects, and joins automatically defined:

Note: You cannot actually check the integrity of this universe, or export the universe to the CMS, because you have not defined a connection to the original data source. p. Save the universe and close Universe Designer.

152

Advanced Universe DesignInstructors Guide

Creating stored procedure and JavaBeans universes (LG 155)


The objective of universes is to provide a seamless access to any underlying source, which then ensures a consistent experience to users. By doing so, users can query, analyze, and report on any data source using universes. The universe access list continues to grow as the variety of data sources evolve in our customer environments; the universe's capabilities are extended to access relational SQL stored procedures and JavaBeans. This unit looks at creating universes using stored procedures and JavaBeans. After completing this unit, you will be able to: Create a universe using a stored procedure Create a universe using JavaBeans

Stored procedure universes


Instructor Note:

(LG 155)

Explain what a stored procedure is.

Creating a universe based on stored procedures


Instructor Note:

(LG 155)

Explain how stored procedures can be used in a universe.

Demonstration: To view existing stored procedures (Optional)


Instructor Note:

The Motors database contains two stored procedures. This optional demonstration shows the students the values of the two stored procedures in SQL Server Management Studio. 1. Launch SQL Server Management Studio and go to the Motors database. 2. Log on with the SQL Server database credentials as provided in the classroom environment. In a non-CSG environment you can also log on using Windows NT authentication. 3. Browse to Databases Motors Programmability Stored Procedures. 4. Click New Query from the Standard toolbar. Enter the following command to run the first sample stored procedure:
exec dbo.TenMostExpensiveModels

5. Click the Execute toolbar button, or select Query Execute from the menubar, or press F5. The stored procedure shows the following results:

Creating Universes from Other Data SourcesInstructors Guide

153

The example illustrated above is a standard (no parameters) stored procedure. 6. Replace the execution syntax in the query with:
exec dbo.CustomerOrderHistory '1001'

7. Click the Execute toolbar button, or select Query Execute from the menubar, or press F5. The stored procedure shows the following results:

Note: The CustomerOrderHistory stored procedure contains an input parameter for the Client ID 1001.

To create a universe based on a simple stored procedure

(LG 156)

Demonstration: To create a universe based on a simple stored procedure


Instructor Note:

Demonstrate creating a new universe with a stored procedure that has no parameters. Be aware that the steps are different in the CSG and non-CSG environment. In the CSG environment all classroom-created universes are stored in the same centralized repository. It is therefore necessary to give a unique name to each connection and universe that are created. The demonstration indicates the different steps required in both environments.
Steps 1. 2. 3. Values

154

Advanced Universe DesignInstructors Guide

Steps

Values

4.

CSG: SimpleSP_Ixx (where "xx" stands for your instructor number, for example I01 or I02). Non-CSG: SimpleSP. CSG: Use the MotorsOLEDB_Ixx connection. Non-CSG: Use the MotorsOLEDB connection.

5.

6.

7.

Expand the Motors and dbo node and select the TenMostExpensiveModels stored procedure.

8. 9. 10.

1. In Universe Designer, click the Quick Design Wizard button on the toolbar. The Welcome dialog box appears. 2. Click the Click here to choose stored procedures universe check box at the bottom of the pane. 3. Click Begin. The Define the Universe Parameter dialog box appears. 4. Type in a universe name in the Enter the universe name field. 5. Choose the database connection from the Select the database connection list or click New to create a new connection. 6. Click Next. The Create initial classes and objects dialog box appears. 7. Expand the database node and the database owner node (for example dbo) to select a stored procedure. 8. Click Add. The stored procedure is created in the Universe pane. 9. Click Next. 10.Click Finish. The Congratulations dialog box appears.

Creating Universes from Other Data SourcesInstructors Guide

155

Stored procedure parameters in the universe


Instructor Note:

(LG 156)

Describe that to improve performance, you can have several stored procedures based on the same universe for the same data source.

To create a universe based on stored procedures with input parameters (LG 156) Demonstration: To create a universe based on stored procedures with input parameters
Instructor Note:

Demonstrate creating a universe based on stored procedures with input parameters. Be aware that the steps are different in the CSG and non-CSG environment. In the CSG environment all classroom-created universes are stored in the same centralized repository. It is therefore necessary to give a unique name to each connection and universe that are created. The demonstration indicates the different steps required in both environments.
Steps 1. 2. 3. Values

4.

CSG: ParamSP_Ixx (where "xx" stands for your instructor number, for example I01 or I02). Non-CSG: ParamSP. CSG: Use the MotorsOLEDB_Ixx connection. Non-CSG: Use the MotorsOLEDB connection.

5.

6.

7.

Expand the Motors and dbo node and select the CustomerOrderHistory stored procedure.

8. 9.

Client ID

156

Advanced Universe DesignInstructors Guide

Steps 10. 11. 12. 13. 14. 15.

Values

1001

1. In Universe Designer, click the Quick Design Wizard button on the toolbar. The Welcome dialog box appears. 2. Click the Click here to choose stored procedures universe check box at the bottom of the dialog box. 3. Click Begin. The Define the Universe Parameter panel appears. 4. Type in a universe name in the Enter the universe name field. 5. Choose the database connection from the Select the database connection list or click New to create a new connection. 6. Click Next. The Create initial classes and objects panel appears. 7. Expand the database node and the database owner node (for example dbo) to select a stored procedure. 8. Click Add. When the stored procedure requires input parameters, the Stored Procedures Editor appears. 9. Select a parameter from the list of parameters. 10.Enter a value for the parameter in the Value field or type in a prompt. 11.Select Use this value or Prompt me for a value. When you enter a value, and when the procedure is executed, the parameter retrieves the columns and the result set structure. This value is passed on to the procedure. 12.If you have selected Prompt me for a value, type in the prompt. You can enter a prompt message or browse to select an existing object (for example, list of subscriber IDs from a table). 13.Click OK. 14.Click Next. 15.Click Finish. The Congratulations dialog box appears.

Creating Universes from Other Data SourcesInstructors Guide

157

Advantages and disadvantages of stored procedure universes (LG 157)


Instructor Note:

Discuss the advantages and disadvantages of stored procedure universes.

JavaBeans and universes


Instructor Note:

(LG 158)

Describe how you can use JavaBeans in a universe.

To create a JavaBean connection

(LG 159)

Activity: Creating stored procedure universes

(LG 160)

Instructor Note: Allow 10 - 20 min for this activity. Explain the activity objective and instructions as a bridge from the lecture to the practice. Be aware that in the CSG environment all classroom-created connections and universes are stored in the same centralized repository. It is therefore necessary to give a unique name to each connection and universe that are created. Be aware that the location for locally saved universes is different in the CSG and the non-CSG environment. Consult the table for the information for each activity step. Review the activity with the learners to ensure that they have acquired the skills outlined in the activity objective. Note: Walk through answers to questions raised in the activity steps. Answers for the steps are outlined in the table below:
Step Details

1.

CSG: Ensure students use their initials (provided they are unique) or their student numbers (for example, "S01", "S02") as a postfix to the SimpleSP universe and MotorsOLEDB connection names to ensure a unique naming convention. Non-CSG: It is not essential to use a postfix for the universe or connection name. CSG: Ensure students use their initials (provided they are unique) or their student numbers (for example, "S01", "S02") as a postfix to the ParamSP universe and MotorsOLEDB connection names to ensure a unique naming convention.

2.

158

Advanced Universe DesignInstructors Guide

Step

Details

Non-CSG: It is not essential to use a postfix for the universe or connection name. CSG: Universes are saved in: \\My Documents\My Business Objects Universes.
3.

Non-CSG: The default location is in: \\Documents and


Settings\<user>\Application Data\Business Objects\Business Objects 12.0\Universes\<universe>.unv.

Objective
Create universes from stored procedures.

Instructions
There are two stored procedures available in the Motors database: TenMostExpensiveModels

CustomerOrderHistory

Tip: The CustomerOrderHistory stored procedure contains an input parameter for the Client ID 1001. 1. Using the TenMostExpensiveModels stored procedure, create a new universe called SimpleSP_xx (where "xx" stands for your initials). Use your MotorsOLEDB_xx (where "xx" stands for your initials) connection to connect to the Motors database. 2. Using the CustomerOrderHistory stored procedure, create a new universe called ParamSP_xx (where "xx" stands for your initials).

Creating Universes from Other Data SourcesInstructors Guide

159

Use your MotorsOLEDB_xx (where "xx" stands for your initials) connection to connect to the Motors database. 3. Save your universes locally and test them in Web Intelligence Rich Client.

160

Advanced Universe DesignInstructors Guide

Working with OLAP universes

(LG 162)

An OLAP universe is a BusinessObjects universe that has been generated from an OLAP cube or query. The universe is created automatically from a selected connection to an OLAP data source using an OLAP query flattening driver that is installed as an add in to Universe Designer. Once the universe has been created it can be exported to the Central Management System (CMS) as any other universe, and is then available to Web Intelligence users to run queries and create reports. After completing this unit, you will be able to: Describe what an OLAP cube is Create and maintain an OLAP universe

Understanding the OLAP cube


Instructor Note:

(LG 162)

Describe what OLAP stands for, and how OLAP cubes are used. Describe the concepts of dimensions and measures in an OLAP cube.

Generating universes from OLAP cube sources


Instructor Note:

(LG 164)

Describe how you can generate universes from OLAP cube sources.

To create a universe from an OLAP cube

(LG 164)

Demonstration: To create a universe from an OLAP cube


Instructor Note:

Demonstrate how to create a universe from a Microsoft Analysis Server OLAP cube. Be aware that in the CSG environment all classroom-created connections and universes are stored in the same centralized repository.It is therefore necessary to give a unique name to each connection and universe that are created. The demonstration indicates the different steps required in both environments. Be aware that the login credentials for creating an OLAP connection are different in the CSG and non-CSG environments. The demonstration indicates the different steps required in both environments. Note: Versions of the Motors database are supplied in DB2, Oracle, and MySQL, however, the OLAP cube supplied on the course resources only applies to Microsoft Analysis Server 2005. No alternative RDBMS OLAP cube version is supplied. 1. Open Universe Designer. 2. Go to Tools Connections, click Add, and then click Next.

Creating Universes from Other Data SourcesInstructors Guide

161

3. Add a new connection name in the Connection Name field. CSG: OLAP_Ixx (where "xx" stands for your instructor number, for example I01 or I02). Non-CSG: OLAP. 4. For the middleware select Microsoft MS Analysis Services 2005 OLE DB for OLAP Providers. 5. Add the appropriate connection parameters in the Login Parameters dialog box. If you are working in a CSG environment enter the following parameters: Use specified username and password. SQL Server login name as provided for the class (same account as the one used to create the MotorsOLEDB connection). SQL Server password as provided for the class (same password as the one used to create the MotorsOLEDB connection). Server name where SQL Server is installed. If you are working in a non-CSG environment enter the following parameters: Use specified username and password. Administrator (windows account). Password for Administrator windows account. Server name where Microsoft Analysis Server (MSAS) is installed.

6. Click Next. The Catalog/Database parameters window displays the available OLAP cubes. 7. Select OLAP Cubes Motors (Motors) Motors (Motors), and click Test Connection. If the connection is valid, a message dialog box appears, indicating that the connection is correct. If you receive an error message, check that you entered all the parameters correctly. 8. Click Next and click Finish twice to complete defining the OLAP connection. 9. Create a new universe. CSG: MotorsOLAP_Ixx (where "xx" stands for your instructor number, for example I01 or I02). Non-CSG: MotorsOLAP. 10.Select the your MotorsOLAP connection from the Connection drop-down list, and click OK. The OLAP universe gets generated. The universe generation may take a few minutes depending on the cube size.

162

Advanced Universe DesignInstructors Guide

An OLAP universe does not display any tables in the Structure pane. All OLAP cube components are mapped directly to classes, measures, dimensions, details, and filters in the Universe pane. 11.(Optional) Expand some of the dimension/ measure classes and view the generated SQL for some of the created objects.

Modifying and updating an OLAP universe


Instructor Note:

(LG 165)

Describe to students that an important objective for BusinessObjects is to provide a common user experience for all query and reporting needs in the organization, whatever the data sources. (Positioning of OLAP universe features.) Discuss the OLAP support enhancements that have been implemented. BusinessObjects Universe Designer includes the following improvements for OLAP support: Simplified OLAP universe maintenance, which reduces the overall cost of ownership and enables you to deploy and administer OLAP universes more efficiently. By adding support for delegated measures, Web Intelligence reporting and layout workflows now work seamlessly on OLAP sources regardless of the nature of the measure. This greatly eases the user experience by simplifying workflows and reducing inconsistent results. OLAP universe optional prompts. OLAP universes allow the definition of prompts which do not strictly require an answer. SAP BW enhanced support. Universe Designer includes support of SAP BW metadata organization, compulsory filters, optional variables, and key figures and units. Describe the delegated measures feature.

Creating Universes from Other Data SourcesInstructors Guide

163

Note: Delegate measures have been covered in the BusinessObjects XI 3.0/3.1: Universe Design course. The Motors universe file used by students contains an Average Total Sales delegated measure. Describe what calculated measures are. Describe the Update OLAP Universes wizard.

To refresh the structure of an OLAP universe

(LG 167)

Demonstration: To refresh the structure of an OLAP universe


Instructor Note:

Demonstrate refreshing an OLAP universe. Demonstrate by using the universe created in the To create a universe from an OLAP cube demonstration.
Steps Values

1.

CSG: MotorsOLAP_Ixx (where "xx" stands for your instructor number, for example I01 or I02). Non-CSG: MotorsOLAP.

2. 3. 4.

All options by default OK

5.

1. In Universe Designer, open the universe you want to update. 2. Select View Refresh Structure. The Update OLAP Universe Wizard appears. 3. Click Begin. The universe update option page appears. 4. Select keep options when you want to preserve modifications to objects in the universe that were made manually. All keep options are selected by default. Select the desired options and click Finish. The Change Management Results page appears showing added/deleted/hidden objects. Hidden objects are moved to a separate class in the universe and appear in italic font preceded by /##/. 5. On the Change Management results page, select OK, Export or Check Integrity.

164

Advanced Universe DesignInstructors Guide

OK: If you are not satisfied with the results, you can click OK, then close the Universe without saving or exporting. Export: If you are satisfied with the changes, click Export to save and export the updated universe to the CMS. Check Integrity: Click Check Integrity to perform an integrity check. It checks the structure, parses objects, parses joins, parses conditions, and checks cardinality. When the check is complete, the Integrity Check Results page appears. From this page you can print the results of the check.

Activity: Creating an OLAP universe

(LG 168)

Instructor Note: Allow 10 - 20 min for this activity. Explain the activity objective and instructions as a bridge from the lecture to the practice. Be aware that in the CSG environment all classroom-created connections and universes are stored in the same centralized repository. It is therefore necessary to give a unique name to each connection and universe that are created. Be aware that the login credentials for creating an OLAP connection are different in the CSG and non-CSG environments. Consult the table for the information for each activity step. Be aware that the location for locally saved universes is different in the CSG and the non-CSG environment. Consult the table for the information for each activity step. Review the activity with the learners to ensure that they have acquired the skills outlined in the activity objective. Note: Walk through answers to questions raised in the activity steps. Answers for the steps are outlined in the table below:
Step Details

1.

CSG: Ensure students use their initials (provided they are unique) or their student numbers (for example, "S01", "S02") as a postfix to the OLAP connection name to ensure a unique naming convention. Non-CSG: It is not essential to use a postfix for the connection name. CSG: Provide students with the SQL Server login credentials (these are the same as the credentials used for the MotorsOLEDB connection). Non-CSG: Students use the Windows NT login credentials; Administrator and associated password. CSG: Ensure students use their initials (provided they are unique) or their student numbers (for example, "S01", "S02") as a postfix to the MotorsOLAP universe name to ensure a unique naming convention. Non-CSG: It is not essential to use a postfix for the universe name.

2.

5.

Creating Universes from Other Data SourcesInstructors Guide

165

Step

Details

CSG: Universes are saved in: \\My Documents\My Business Objects Universes.
6.

Non-CSG: The default location is in: \\Documents and


Settings\<user>\Application Data\Business Objects\Business Objects 12.0\Universes\<universe>.unv.

Objective
Create a universe from an OLAP cube

Instructions
1. Open Universe Designer. Create a new OLAP_xx connection, where "xx" stands for your initials, with the following parameters: Connection Type: Secured Connection Name: OLAP_xx (where "xx" stands for your initials) Database middleware: Microsoft MS Analysis Services 2005 OLE DB for OLAP Providers 2. In the connection Login Parameters window enter the following parameters: Use specified username and password. For user name and password, use the credentials as provided by the instructor. Enter the server name as provided by the instructor. 3. Click Next. The Catalog/Database parameters window displays the available OLAP cubes. 4. Select OLAP Cubes Motors (Motors) Motors (Motors), and click Test Connection. 5. Create a new MotorsOLAP_xx universe, (where "xx" stands for your initials), using your created secured OLAP connection. 6. Save your universe locally and test it in Web Intelligence Rich Client.

166

Advanced Universe DesignInstructors Guide

Quiz: Creating universes from other data sources


1. What three tasks can you perform in the Metadata Exchange panel? Answer: Create a new universe from a metadata file. Update an existing universe when the metadata has been updated. Export a universe to a metadata format.

(LG 169)

2. True or False. A stored procedure is a compiled SQL program, consisting of one or more SQL statements, which resides and runs on the target database. Answer: True. 3. True or False. When creating an OLAP universe, no tables are generated in the Structure pane. Answer: True. 4. True or False. Stored procedures are represented as Derived Tables, thus they benefit from Derived Table mechanisms and concepts. Answer: True.

Creating Universes from Other Data SourcesInstructors Guide

167

Lesson summary

(LG 170)

Instructor Note: Recap the lesson objectives with the learners to check that all learners have acquired the required skills before moving on to the next section. After completing this lesson, you are now able to: Create a universe from an XML metadata file Create stored procedure and JavaBeans universes Work with OLAP universes

168

Advanced Universe DesignInstructors Guide

Appendix A

End of Course Challenge


Activity: Completing the end of course challenge
(LG 171)

Instructor Note: Allow 1 hour and 30 minutes for this end of course activity. Explain the activity objective and instructions as a bridge from the lecture to the practice. Review the activity with the learners to ensure that they have acquired the skills outlined in the activity objective. Note: Walk through answers to questions raised in the activity steps. Answers for the steps are outlined in the table below:
Step Details

Objects to change: Sales Revenue


@aggregate_aware(sum(ANNUAL_FIGURES.ANNUAL_SALE_VALUE), sum(QUARTER_FIGURES.QTR_SALE_VALUE), sum(Monthly_Figures.Monthly_Sales_Revenue), sum(SALE_MODEL.SALE_QTY *MODEL.MODEL_PRICE * ((100 - SALE.SALE_DISCOUNT)/100)))

5.

Financial Year
@aggregate_aware(ANNUAL_FIGURES.FP_YEAR,QUARTER_FIGURES.FP_YEAR)

Financial Month
@aggregate_aware(Monthly_Figures.Month,FINANCE_PERIOD.FP_MONTH)

6.

The Monthly Figures table should be made incompatible with the following classes: Client Showroom Rentals Where Restriction Objects Staff YTD Objects Derived Objects

End of Course ChallengeInstructors Guide

169

Step

Details

To test open the Universe Designer Query Panel and view the SQL of the following combination of objects: Financial Year and Sales Revenue:
SELECT DISTINCT ANNUAL_FIGURES.FP_YEAR, sum(ANNUAL_FIGURES.ANNUAL_SALE_VALUE) FROM ANNUAL_FIGURES GROUP BY ANNUAL_FIGURES.FP_YEAR

Financial Year, Financial Quarter, and Sales Revenue:


SELECT DISTINCT QUARTER_FIGURES.FP_YEAR, sum(QUARTER_FIGURES.QTR_SALE_VALUE), QUARTER_FIGURES.FP_QUARTER FROM QUARTER_FIGURES GROUP BY QUARTER_FIGURES.FP_YEAR, QUARTER_FIGURES.FP_QUARTER

Financial Year, Financial Quarter, Financial Month, and Sales Revenue:


SELECT DISTINCT FINANCE_PERIOD.FP_YEAR, sum(SALE_MODEL.SALE_QTY * MODEL.MODEL_PRICE * ((100 - SALE.SALE_DISCOUNT) / 100)), FINANCE_PERIOD.FP_QUARTER, FINANCE_PERIOD.FP_MONTH FROM FINANCE_PERIOD, MODEL,SALE,SALE_MODEL WHERE (SALE.SALE_DATE between FINANCE_PERIOD.FP_START and FINANCE_PERIOD.FP_END) AND (SALE.SALE_ID=SALE_MODEL.SALE_ID) AND (SALE_MODEL.MODEL_ID=MODEL.MODEL_ID) AND (SALE.SALE_TYPE='S') GROUP BY FINANCE_PERIOD.FP_YEAR,FINANCE_PERIOD.FP_QUARTER, FINANCE_PERIOD.FP_MONTH

7.

Financial Year, Financial Month, and Sales Revenue:


SELECT DISTINCT Monthly_Figures.year, sum(Monthly_Figures.Monthly_Sales_Revenue), Monthly_Figures.Month FROM ( SELECT MODEL.MAKER_ID,SALE.SHOWROOM_ID,DATEPART(m,SALE.SALE_ DATE) AS Month, DATEPART(yy,SALE.SALE_DATE) AS Year, SUM(SALE.SALE_TOTAL) AS Monthly_Sales, SUM(SALE_MODEL.SALE_QTY * MODEL.MODEL_PRICE* ((100-SALE.SALE_DISCOUNT)/100)) AS Monthly_Sales_Revenue FROM SALE_MODEL, MODEL, SALE WHERE (SALE.SALE_ID=SALE_MODEL.SALE_ID) AND (SALE_MODEL.MODEL_ID=MODEL.MODEL_ID)

170

Advanced Universe DesignInstructors Guide

Step

Details AND (SALE.SALE_TYPE = 'S') GROUP BY DATEPART(yy,SALE.SALE_DATE),DATEPART(mm,SALE.SALE_DATE), SALE.SHOWROOM_ID,MODEL.MAKER_ID)Monthly_Figures GROUP BY Monthly_Figures.year,Monthly_Figures.Month

Financial Month and Sales Revenue:


SELECT DISTINCT sum(Monthly_Figures.Monthly_Sales_Revenue), Monthly_Figures.Month FROM ( SELECT MODEL.MAKER_ID,SALE.SHOWROOM_ID,DATEPART(m,SALE.SALE_DATE) AS Month, DATEPART(yy,SALE.SALE_DATE) AS Year,SUM(SALE.SALE_TOTAL) AS Monthly_Sales, SUM(SALE_MODEL.SALE_QTY * MODEL.MODEL_PRICE* ((100-SALE.SALE_DISCOUNT)/100)) AS Monthly_Sales_Revenue FROM SALE_MODEL, MODEL, SALE WHERE (SALE.SALE_ID=SALE_MODEL.SALE_ID) AND (SALE_MODEL.MODEL_ID=MODEL.MODEL_ID) AND (SALE.SALE_TYPE = 'S') GROUP BY DATEPART(yy,SALE.SALE_DATE),DATEPART(mm,SALE.SALE_DATE), SALE.SHOWROOM_ID,MODEL.MAKER_ID) Monthly_Figures GROUP BY Monthly_Figures.Month

Consult the table for activity review steps:

Objectives
Build YTD objects in the Motors universe Use aggregate awareness to optimize the universe Prestige Motors management is finding that their monthly reports take a long time to run. They have requested that these reports be produced without any noticeable processing delay, however, no changes can be made to the existing data store structure. In addition they would like to review the universes for possible optimization. Year to date data needs to be implemented to get up to today's sales revenue data. 1. Open your Motors universe file in Universe Designer. 2. Create a new derived table called DT_Monthly_Figures. Add the following SQL Syntax for the table:
SELECT MODEL.MAKER_ID, SALE.SHOWROOM_ID, datepart(m,SALE.SALE_DATE) as Month,datepart(yy,SALE.SALE_DATE) as Year,sum(SALE.SALE_TOTAL) as Monthly_Sales, sum(SALE_MODEL.SALE_QTY * MODEL.MODEL_PRICE * ((100 -SALE.SALE_DISCOUNT) / 100)) as Monthly_Sales_Revenue FROM SALE_MODEL, MODEL, SALE

End of Course ChallengeInstructors Guide

171

WHERE (SALE.SALE_ID=SALE_MODEL.SALE_ID) AND ( SALE_MODEL.MODEL_ID= MODEL.MODEL_ID ) AND ( SALE.SALE_TYPE='S' ) GROUP BY datepart(yy,SALE.SALE_DATE),datepart(mm,SALE.SALE_DATE),SALE.SHOWROOM_ID,MODEL.MAKER_ID

3. Create a new Monthly Figures class to contain the following monthly figures objects, based on the DT_Monthly_Figures table: Month Year Monthly Sales Revenue 4. Join the derived table with the MAKER and SHOWROOM tables using the appropriate foreign keys and update the Sales context as required. 5. Update the existing Sales Revenue measure SQL syntax to include a month value aggregation level. Tip: Check other objects that reference the monthly aggregate, for example year object in the Financial Period class. 6. Set incompatibilities where required. 7. Test the aggregation level generations by running test queries in the Universe Designer Query Panel. Use the View SQL button to verify if the generated SQL is correct. Alternatively save the universe and test in Web Intelligence Rich Client. 8. Create a new class called Current Dates and insert the following objects:
Date Object Current Date Current Year Current Month SELECT syntax getdate() Description Returns the current date and time. Returns the current year. Type Date

datepart(yyyy,getdate())

Number

datepart(mm,getdate())

Returns the current month

Number

Note: These objects are not based on any database columns and do not parse as they are lacking a reference table. To check if the syntax is correct click Tables, select the SALE table, apply the changes and click Parse. 9. There are no current date values in the Motors database. To ensure that you can create YTD objects, create a new derived table. Select Insert Derived Tables from the toolbar menu. 10.Name the table DT_Sale_YTD.

172

Advanced Universe DesignInstructors Guide

11.Add the following syntax to the derived table SELECT statement:


SELECT CLIENT_ID,SALE_ID, FROM SALE WHERE CLIENT_ID = (1089) UNION SELECT CLIENT_ID,SALE_ID, FROM SALE WHERE CLIENT_ID = (1088) UNION SELECT CLIENT_ID,SALE_ID, FROM SALE WHERE CLIENT_ID = (1087) UNION SELECT CLIENT_ID,SALE_ID, FROM SALE WHERE CLIENT_ID = (1086) SALE_TOTAL, getdate() as SALE_DATE

SALE_TOTAL, dateadd(mm,-1,getdate()) as SALE_DATE

SALE_TOTAL, dateadd(mm,-2,getdate()) as SALE_DATE

SALE_TOTAL, dateadd(yy,-1,getdate()) AS SALE_DATE

12.Check the syntax and click OK. 13.As you need to ensure that all tables are part of a context you need to join the DT_Sale_YTD table to the CLIENT table via the CLIENT_ID. 14.Detect the cardinality and create a new context for the join between the DT_Sale_YTD and CLIENT tables. Name the context SALE_YTD. 15.Create a YTD Objects class, and add the following objects based on the SALE_YTD derived table:
Object Sales Total (SALE_YTD table) Sale Date (SALE_YTD table) SELECT Syntax sum(DT_Sale_YTD.SALE_TOTAL) DT_Sale_YTD.SALE_DATE

16.Double-click the Sale Date (SALE_YTD table) object and click on the Properties tab. 17.Select the Automatic Time Hierarchy button and create a year and month object. 18.Create the following indicator or boolean flag objects in the YTD Objects class that are used to create YTD measure objects in the remaining activity steps:

End of Course ChallengeInstructors Guide

173

Boolean Flag Object

SELECT Syntax

Sales in YTD flag

CASE WHEN THEN ELSE

@select(YTD Objects\Year of Sale Date (SALE_YTD table)) @select(Current Dates\Current Year) 1 0 END

Sales in YTD flag - current month

CASE @select(YTD Objects\Year of Sale Date (SALE_YTD table)) WHEN @select(Current Dates\Current Year) THEN 1 ELSE 0 END * CASE sign(@select(Current Dates\Current Month)@select(YTD Objects\Month of Sale Date (SALE_YTD table))) WHEN 1 THEN 1 ELSE 0 END

19.Create the following relative date-time measure objects in the YTD Objects class:
Measure Object SELECT syntax sum((DT_Sale_YTD.SALE_TOTAL)* @select(YTD Objects\Sales in YTD flag))

Total Sales YTD

Total Sales YTD - current month

sum((DT_Sale_YTD.SALE_TOTAL)* @select(YTD Objects\Sales in YTD flag - current month))

20.Save the changes and test the results in Web Intelligence Rich Client. 21.Run a new query using the Sale Date (SALE_YTD table), Sale_Total (SALE_YTD table), Total Sales YTD and the Total Sales YTD - current month objects.

174

Advanced Universe DesignInstructors Guide

Appendix B

Data Access Files


BusinessObjects data access files
(LG 175)

Data Access FilesInstructors Guide

175

The PRM file

(LG 181)

176

Advanced Universe DesignInstructors Guide

Appendix C

External Strategies
Using external strategies in Universe Designer
(LG 185)

External StrategiesInstructors Guide

177

Types of strategies

(LG 187)

178

Advanced Universe DesignInstructors Guide

Appendix D

SQL syntaxes for other RDBMS


Alternative SQL syntaxes for other RDBMS
(LG 189)

SQL syntaxes for other RDBMSInstructors Guide

179

ORACLE

(LG 190)

180

Advanced Universe DesignInstructors Guide

MySQL

(LG 194)

SQL syntaxes for other RDBMSInstructors Guide

181

DB2

(LG 197)

182

Advanced Universe DesignInstructors Guide

Вам также может понравиться