bou320 en col91 fv part ltr

232
BusinessObjects XI 3.0/3.1: Advanced Universe Design Learner’s Guide BOU320

Upload: amondaca

Post on 27-Oct-2014

367 views

Category:

Documents


24 download

TRANSCRIPT

Page 1: Bou320 en Col91 Fv Part Ltr

BusinessObjects XI 3.0/3.1: AdvancedUniverse Design

Learner’s GuideBOU320

Page 2: Bou320 en Col91 Fv Part Ltr

Copyright© 2009 SAP® BusinessObjects™. All rights reserved. SAPBusinessObjects owns the followingUnited States patents,whichmay cover products that are offered and licensed by SAPBusinessObjects 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. SAPBusinessObjects and its logos, BusinessObjects, Crystal Reports®,Rapid Mart™, Data Insight™, Desktop Intelligence™, RapidMarts®, Watchlist Security™, Web Intelligence®, and Xcelsius®are trademarks or registered trademarks of Business Objects,an SAP company and/or affiliated companies in the UnitedStates and/or other countries. SAP® is a registered trademarkof SAPAG inGermany and/or other countries. All other namesmentioned hereinmay be trademarks of their respective owners.

Page 3: Bou320 en Col91 Fv Part Ltr

C O N T E N T S

About this CourseCourse introduction.....................................................................................................xiCourse description......................................................................................................xiiCourse audience..........................................................................................................xiiPrerequisites.................................................................................................................xiiLevel, delivery, and duration....................................................................................xiiApplicable certifications and designations..............................................................xiiCourse success factors...............................................................................................xiiiCourse setup...............................................................................................................xiiiCourse materials.........................................................................................................xiiiLearning process.........................................................................................................xiii

Lesson 1Reviewing Universe Design ConceptsLesson introduction.......................................................................................................1Using your BusinessObjects Universe Designer knowledge..................................2

Review: Using universe design concepts............................................................2Activity: Implementing a universe......................................................................3

Reviewing the course database and universe............................................................6The course database...............................................................................................6An overview of the Motors universe...................................................................6Activity: To deploy the Motors universe (Optional).........................................7

Lesson summary............................................................................................................9

Lesson 2Working with Aggregate AwarenessLesson introduction.....................................................................................................11Defining aggregate awareness...................................................................................12

What is aggregate awareness?............................................................................12Summary tables....................................................................................................12Summary tables and SQL ...................................................................................13

Applying aggregate awareness.................................................................................15Setting up aggregate awareness.........................................................................15Redefine the objects .............................................................................................16Applying aggregate awareness to objects........................................................16Define incompatible objects................................................................................17

iiiTable of Contents—Learner’s Guide

Page 4: Bou320 en Col91 Fv Part Ltr

Activity: Setting up aggregate awareness - part 1...........................................20Activity: Setting up aggregate awareness - part 2...........................................22Using aggregate awareness to resolve fan traps..............................................23Outer joins and aggregate awareness...............................................................25

Quiz: Working with aggregate awareness...............................................................28Lesson summary..........................................................................................................29

Lesson 3Designing Advanced ObjectsLesson introduction.....................................................................................................31Combining database functions in objects.................................................................32

Using database functions in objects...................................................................32Activity: Combining database functions in objects ........................................36Working with analytic functions.......................................................................38What are analytic functions?..............................................................................38

Constructing relative date-time objects....................................................................41Date functions in objects.....................................................................................41Relative date-time objects ..................................................................................43CASE statements in measure objects ................................................................44Activity: Constructing relative date-time objects ...........................................46Moving averages..................................................................................................50Activity: Creating a moving average.................................................................53

Quiz: Designing advanced objects............................................................................57Lesson summary..........................................................................................................58

Lesson 4Creating Complex Predefined Conditions,LOVs, and JoinsLesson introduction.....................................................................................................59Creating complex predefined conditions.................................................................60

Subqueries in predefined conditions.................................................................60Activity: Creating subqueries in predefined conditions................................62@Prompt scenarios in predefined conditions...................................................64Activity: Using @prompt in predefined conditions........................................66

Working with advanced LOVs..................................................................................68Customizing LOVs...............................................................................................68Activity: Modifying LOVs..................................................................................69Arranging LOV data as an A-Z index...............................................................71Activity: Arranging LOVs...................................................................................73

Working with advanced join syntaxes......................................................................74Defining @prompt functions in a join...............................................................74Defining conditional join paths..........................................................................75Using joins to construct relative date-time objects..........................................76

Advanced Universe Design—Learner’s Guideiv

Page 5: Bou320 en Col91 Fv Part Ltr

Conditional joins and running calculations.....................................................78Activity: Using complex joins.............................................................................80

Quiz: Creating complex predefined conditions and LOVs...................................84Lesson summary..........................................................................................................85

Lesson 5Securing UniversesLesson introduction.....................................................................................................87Defining connection and user credential parameters.............................................88

About security and universes ............................................................................88User credentials for the connection ..................................................................88

Working with Central Management Server (CMS) universe security.................90Organizing universes in secured folder structures ........................................90

Working with table mapping in restriction sets......................................................92About restriction sets...........................................................................................92Working with table mapping.............................................................................93Activity: Working with table mapping in a restriction set.............................96

Quiz: Securing universes............................................................................................99Lesson summary........................................................................................................100

Lesson 6ImplementingUniverse Life CycleManagementLesson introduction...................................................................................................101Moving content from development to production...............................................102

Life cycle management......................................................................................102Using the Import Wizard..................................................................................103Universes and universe connections...............................................................107Working with Business Intelligence Archive Resource (BIAR) files .........108Using test folders................................................................................................112Life cycle management recommendations.....................................................113Activity: Moving content from development to production.......................114

Quiz: Implementing universe life cycle management..........................................116Lesson summary........................................................................................................117

Lesson 7Maintaining and Optimizing UniversesLesson introduction...................................................................................................119Optimizing universes................................................................................................120

The Connection Server......................................................................................120Setting up a trace file.........................................................................................121Connection configuration parameters.............................................................122Custom connection parameters........................................................................124

vTable of Contents—Learner’s Guide

Page 6: Bou320 en Col91 Fv Part Ltr

Dynamic SQL parameters.................................................................................126Adapting dynamic SQL parameters................................................................127BEGIN_SQL........................................................................................................127END_SQL............................................................................................................127ANSI92 and FILTER_IN_FROM .....................................................................128About ANSI92 SQL syntax ..............................................................................129The ANSI92 dynamic SQL parameter.............................................................130Applying the FILTER_IN_FROMfunctionality to individual classes andobjects...................................................................................................................131The JOIN_BY_SQL parameter..........................................................................135Activity: Using dynamic SQL parameters......................................................136

Applying index awareness ......................................................................................139What is index awareness? ................................................................................139Avoiding joins in tables.....................................................................................140Multiple foreign key entries.............................................................................141SQL Editor dialog box ......................................................................................143Using an index awareness WHERE clause.....................................................143

Applying best practices for universe design.........................................................144Best practices for designing and optimizing your universe........................144

Quiz: Maintaining and optimizing universes........................................................147Lesson summary........................................................................................................148

Lesson 8Creating Universes from Other Data SourcesLesson introduction...................................................................................................149Creating a universe from an XML data source......................................................150

Which data sources are supported in the Metadata Exchange panel?.......150Working with the Metadata Exchange panel.................................................150

Creating stored procedure and JavaBeans universes...........................................155Stored procedure universes..............................................................................155Creating a universe based on stored procedures..........................................155Stored procedure parameters in the universe................................................156Advantages and disadvantages of stored procedure universes.................157JavaBeans and universes...................................................................................158Activity: Creating stored procedure universes .............................................160

Working with OLAP universes...............................................................................162Understanding the OLAP cube........................................................................162Generating universes from OLAP cube sources............................................164Modifying and updating an OLAP universe.................................................165Activity: Creating an OLAP universe.............................................................168

Quiz: Creating universes from other data sources...............................................169Lesson summary........................................................................................................170

Advanced Universe Design—Learner’s Guidevi

Page 7: Bou320 en Col91 Fv Part Ltr

Appendix AEnd of Course ChallengeActivity: Completing the end of course challenge................................................171

Appendix BData Access FilesBusinessObjects data access files.............................................................................175The PRM file...............................................................................................................181

Appendix CExternal StrategiesUsing external strategies in Universe Designer....................................................185Types of strategies.....................................................................................................187

Appendix DSQL syntaxes for other RDBMSAlternative SQL syntaxes for other RDBMS..........................................................189ORACLE......................................................................................................................190MySQL.........................................................................................................................194DB2...............................................................................................................................197

Answer KeyReview: Using universe design concepts...............................................................203Quiz: Working with aggregate awareness.............................................................207Quiz: Designing advanced objects..........................................................................208Quiz: Creating complex predefined conditions and LOVs.................................209Quiz: Securing universes..........................................................................................210Quiz: Implementing universe life cycle management..........................................211Quiz: Maintaining and optimizing universes........................................................212Quiz: Creating universes from other data sources...............................................213

viiTable of Contents—Learner’s Guide

Page 8: Bou320 en Col91 Fv Part Ltr

Advanced Universe Design—Learner’s Guideviii

Page 9: Bou320 en Col91 Fv Part Ltr

A G E N D AAdvanced Universe Design

Introductions, Course Overview...........................................30 minutes

Lesson 1Reviewing Universe Design Concepts........................................1 hour❒ Using your BusinessObjects Universe Designer knowledge

Lesson 2Working with Aggregate Awareness..........................................2 hours❒ Defining aggregate awareness❒ Applying aggregate awareness

Lesson 3Designing Advanced Objects.................................................2.25 hours❒ Combining database functions in objects❒ Constructing relative date-time objects

Lesson 4Creating Complex Predefined Conditions, LOVs, andJoins.....................................................................................................2 hours❒ Creating complex predefined conditions❒ Working with advanced LOVs❒ Working with advanced join syntaxes

Lesson 5Securing Universes...................................................................45 minutes❒ Defining connection and user credential parameters❒ Working with Central Management Server (CMS) universe security

Lesson 6Implementing Universe Life Cycle Management.............45 minutes❒ Moving content from development to production

ixAgenda—Learner’s Guide

Page 10: Bou320 en Col91 Fv Part Ltr

Lesson 7Maintaining and Optimizing Universes.....................................2 hours❒ Optimizing universes❒ Applying best practices for universe design

Lesson 8Creating 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 Design—Learner’s Guidex

Page 11: Bou320 en Col91 Fv Part Ltr

About this Course

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

xiAbout this Course—Learner’s Guide

Page 12: Bou320 en Col91 Fv Part Ltr

Course descriptionThis two-day instructor-led advanced course is designed to give you the comprehensive skillsand in-depth knowledge needed to design universes in BusinessObjects™ Universe Designer.

The business benefit of this course is that youwill learn best-practicemethodology for creatinguniverses that respond to your reporting requirements. Through well-designed universes,report designers and business users will be able to create reports without having to knowanything about the underlying data source or structure.

Course audience

The target audience for this course is anyone responsible for creating and designing universesusing Universe Designer, using BusinessObjects XI 3.0/3.1.

The learners who attend the course will be most successful if they have experience in workingwith Business Objects Universe Designer.

New features covered in the XI 3.0/3.1 course that are not applicable to BusinessObjects XIR1/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

To be successful, learnerswho attend this course should have attended the following offerings:• BusinessObjects XI R2: UniverseDesign, and/or BusinessObjects XI 3.0/3.1: UniverseDesign• 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

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

Applicable certifications and designations

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

Advanced Universe Design—Learner’s Guidexii

Page 13: Bou320 en Col91 Fv Part Ltr

Course success factors

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

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

Course materials

The materials included with the course materials are:• Name card• Learner’s Guide

The Learner’s Guide contains an agenda, learner materials, and practice activities.

The Learner’s Guide is designed to assist students who attend the classroom-based courseand 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 ourevaluation process. Provide feedback on the course content, instructor, and facility. Yourcomments 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 supplementalcontent to the training guide.

• OnlineHelp

Retrieve information and find answers to questions using the onlineHelp and/or user’sguide that are included with the product.

Learning process

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

Introduction

Why am I here? What’s in it for me?

The learners will be clear about what they are getting out of each lesson.

xiiiAbout this Course—Learner’s Guide

Page 14: Bou320 en Col91 Fv Part Ltr

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 theactivities.

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.

Advanced Universe Design—Learner’s Guidexiv

Page 15: Bou320 en Col91 Fv Part Ltr

Lesson 1Reviewing Universe Design Concepts

Lesson introductionDuring this lesson you review your existing universe design and BusinessObjects UniverseDesigner knowledge, and review key concepts from the BusinessObjects XI 3.0/3.1: UniverseDesign course.

After completing this lesson, you will be able to:

• Use your universe design and BusinessObjects Universe Designer knowledge to solvebusiness problems

• Describe the course universe, database data, and structure

1Reviewing Universe Design Concepts—Learner’s Guide

Page 16: Bou320 en Col91 Fv Part Ltr

Using yourBusinessObjectsUniverseDesigner knowledgeThe interactive review in this lesson asks you to use your BusinessObjects Universe Designerknowledge 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

Objective

• Review your knowledge of Universe Designer

Instructions

1. What is a universe?

2. Does a universe store data?

3. What are the main advantages of a universe?

4. Describe the connection types and their purposes.

5. What are the types of objects that can be created in a universe? Provide a brief descriptionof each type.

6. What are the different join types allowed in the universe structure. Provide a short descriptionof each type.

7. What are the different types of SQL traps that can be found in a schema? How can each ofthese types be identified? How can each type be resolved in the universe schema?

8. What are loops and how can they be resolved?

9. Describe how you would test a measure to make sure the aggregation levels are projectedcorrectly.

10.Explain two drawbacks of using restrictions at the object level.

11.Describe the use of the @select function.

12.What is a hierarchy?

13.Describe what a derived table is and how it is generally used in a universe schema.

14.Describe what index awareness is, and how it is used in a universe schema.

15.What are the pros and cons of delegated functionality in a universe-based reporting structure?

Advanced Universe Design—Learner’s Guide2

Page 17: Bou320 en Col91 Fv Part Ltr

Activity: Implementing a universe

Objective

• Implement a universe using Universe Designer

Instructions

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

The Island Resorts Company requires an ad-hoc reporting system for their resort locations.There are five holiday destinations; Royal Caribbean,HawaiianClub, FrenchRiviera, BahamasBeach, 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 forreservations.

• 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 aUniverseDesigner 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 newOLEDB connection calledClubOLEDB_xx, where "xx" stands for your initials.a. Select File ➤ Parameters ➤ Definition, and then clickNew below the Connection field.b. ClickNext.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 theMicrosoft node, which is the target database for the connection.f. Expand theMSSQLServer 2005 node,which is the targetmiddleware for the connection.g. Select theOLE DB Providers driver name and clickNext.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.

3Reviewing Universe Design Concepts—Learner’s Guide

Page 18: Bou320 en Col91 Fv Part Ltr

j. In the Server field, select or enter the appropriate SQL Server name to connect to, asprovided to you by the instructor.

k. In the Database field, enter Club, the name of the database you are connecting to.l. ClickNext twice, and click Finish.m. In theWizard Connection dialog box, click Test to test the connection.

If the connection is valid, a message dialog box appears, indicating that the connectionis correct. If you receive an error message, check that you entered all the parameterscorrectly.

n. Click Finish to exit the wizard.

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 forpersonal 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 clickNext.f. Select your TravelClub universe, and clickOK.

Advanced Universe Design—Learner’s Guide4

Page 19: Bou320 en Col91 Fv Part Ltr

g. Build a new query using the objects you have created. Drag and drop the objects into theResult 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 guestswho have stayed by time period aswell 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 fromother guests.

• Identify the different services available at each location. The services could beaccommodation, 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.

5Reviewing Universe Design Concepts—Learner’s Guide

Page 20: Bou320 en Col91 Fv Part Ltr

Reviewing the course database and universeIn order to create a BusinessObjects universe, you must first be familiar with the data andstructure 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: UniverseDesign 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

Two universes have been created during the BusinessObjects XI 3.0/3.1: Universe Design course,Motors and Staff, that report on a database for a fictional car sales and rentals organizationcalled Prestige Motors. The database has the following characteristics:• There are three showrooms, two in the US and one in the UK.

• Each showroomhas the franchise for a number of different carmakers, who allmanufacturea 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 notalways the case.

• The database contains data for two financial years 2003/2004 and 2004/2005. Each yearbegins on April 6 and ends on April 5 in the subsequent year.

• Information about employees who work within the organization is also available in thedatabase.

• There are summary tables for quarterly and annual revenue and numbers to speed upqueries.

• The data is stored in a SQL Server 2005 database.

• Connections to the database are to be made using OLE DB.

Assumptions

• There has been no inflation over the different years for which data is held.

• There is no stock data. All manufacturers are able to supply on demand.

• Users in all countries use the same currency (the US dollar).

• No new models have been brought out during the period.

An overview of the Motors universe

The Motors universe was created during the BusinessObjects XI 3.0/3.1: Universe Design course,and the final version of the Motors universe from the core course, is further extended duringthis advanced course.

Advanced Universe Design—Learner’s Guide6

Page 21: Bou320 en Col91 Fv Part Ltr

In theBusinessObjects XI 3.0/3.1: Universe Design course, the MotorsOLEDB connectionwas createdto connect to the Motors SQL Server 2005 database.

The Motors universe file was initially populated only with sales data, and further extended torental data later on in the course. The rental data was brought in based on a sale alias table.Adding the rental data created loops in the schema that were resolved using contexts andaliases.

Dimension and measure objects were created for sales and rental reporting needs. Hierarchieswere established to allow end user to drill in reports.

To cross reference objects, @functions were used to reuse existing objects, and avoid creatingthe same object requirements in the universe.

Condition objects and restrictions sets were defined to restrict data returned in reports, and toadd security to the universe.

Primary key indexes were applied and some derived tables were introduced into the universestructure.

A Staff universe was developed to comply with reporting needs to report on employee andmanager data. To merge the staff and motors data into one universe schema, the Motors andStaff universes were linked. The dynamic link was broken to embed the Staff data into theMotors universe structure.

Activity: To deploy the Motors universe (Optional)

Objective

• Deploy the Motors universe

7Reviewing Universe Design Concepts—Learner’s Guide

Page 22: Bou320 en Col91 Fv Part Ltr

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 Designcourse.

If this course is taught separate from the core Universe Design course, the final version of theBusinessObjects XI 3.0/3.1: Universe Design course needs to be deployed using the steps outlinedin this activity.1. In Universe Designer, open the Motors universe file provided in theActivity_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 calledMotorsOLEDB_xx, where "xx" stands for yourinitials.a. Select File ➤ Parameters ➤ Definition, and then clickNew below the Connection field.b. ClickNext.c. Select Secured from the Connection Type drop-down list.d. In the Connection Name field, type MotorsOLEDB_xx, where "xx" stands for your initials.e. Expand theMicrosoft node, which is the target database for the connection.f. Expand theMSSQLServer 2005 node,which is the targetmiddleware for the connection.g. Select theOLE DB Providers driver name and clickNext.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. ClickNext twice, and click Finish.m. In theWizard Connection dialog box, click Test to test the connection.

If the connection is valid, a message dialog box appears indicating that the connectionis correct. If you receive an error message, check that you entered all the parameterscorrectly.

n. Click Finish to exit the wizard.

4. Select File ➤ Save As to save your Motors universe version locally.

Advanced Universe Design—Learner’s Guide8

Page 23: Bou320 en Col91 Fv Part Ltr

Lesson summaryAfter completing this lesson, you are now able to:

• Use your universe design and BusinessObjects Universe Designer knowledge to solvebusiness problems

• Describe the course universe, database data, and structure

9Reviewing Universe Design Concepts—Learner’s Guide

Page 24: Bou320 en Col91 Fv Part Ltr

Advanced Universe Design—Learner’s Guide10

Page 25: Bou320 en Col91 Fv Part Ltr

Lesson 2Working with Aggregate Awareness

Lesson introductionThis lesson describes howyou can use features inUniverseDesigner to define an object’s SELECTstatement so that you can run a query against aggregate tables in the database instead of againstthe base tables.

You can set conditions so that a query runs against aggregate tables if doing so optimizes thequery. 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

11Working with Aggregate Awareness—Learner’s Guide

Page 26: Bou320 en Col91 Fv Part Ltr

Defining aggregate awarenessAggregate awareness is a term that describes the ability of a universe to make use of aggregatetables in a database. Using aggregate tables speeds up the execution of queries, improving theperformance of SQL transactions.

The reliability and usefulness of aggregate awareness in a universe depends on the accuracyof 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• Understandwhyuniverses that are aggregate aware allowqueries to processmore efficiently

What is aggregate awareness?

Somedatabases contain summary tables. These tables are created by theDatabaseAdministrator(DBA) and contain figures such as revenue aggregated to a high level (year, for example) ratherthan to the fact/event level. The summary tables are usually populated and updated regularlyby an automated program that runs SQL against the fact or event data at transaction level.

This means that there are two methods that you can use to return aggregated data:• Run a SELECT statement for the fact or event data.

• Run a SELECT statement for the summary data.

Where possible, it is best to choose the latter method as the statement processes quicker.

In Universe Designer, you can use a function called @aggregate_aware in the SELECT statementfor an object, so that both methods are referenced. This function directs a query to run againstaggregate tables whenever possible. If the data in the aggregate table is not calculated at thelevel of granularity required to run the query, the object directs the query to run against thetables containing the non-aggregated data.

A universe that has one or more objects with alternative definitions based on aggregate tablesis said to be aggregate aware. These definitions correspond to levels of aggregation. For example,an object called Profit can be aggregated by month, by quarter, or by year.

The reliability and usefulness of aggregate awareness in a universe depends on the accuracyof the aggregate tables. They must be refreshed at the same time as all fact tables.

Summary tables

Each row in a summary table is made up of columns containing:• Aggregated data: Numeric event data aggregated to a higher level.

In the example table image, columns containing aggregated data are Annual_Sale_Value,Annual_Sale_Cost,Annual_Sale_Number,Annual_Rent_Value, andAnnual_Rent_Number.

• Dimension data: Attributes defining the level of the aggregated data.

Advanced Universe Design—Learner’s Guide12

Page 27: Bou320 en Col91 Fv Part Ltr

In this example, there is only one column containing dimension data: FP_Year.

• Foreign keys (optional): Joins to other tables. If these exist, queries can be made usingsummary table aggregated data on the basis of dimension objects held in other tables of thedatabase, as opposed to just those contained within the summary table itself.

Within BusinessObjects end-user querying tools, columns containing aggregated anddimensiondata are incorporated into objects using the @function called @aggregate_aware. Foreign keysare used to set joins in the structure of the universe.

Note: Aggregate awareness works on all tables, not just fact tables. It can also be applied toall object types with all data types, not just numbers and measures.

Summary tables and SQL

Where possible, it is prudent to use summary table data because the processing required toreturn the aggregated data is far quicker.

You can see in the example diagram that making a query based on event data at a transactionlevel requires a more complex SELECT statement and the processing of more database rowsthan one based on summary data.• Aggregates of a normalized database are based on event/fact level data:

13Working with Aggregate Awareness—Learner’s Guide

Page 28: Bou320 en Col91 Fv Part Ltr

• Summary tables can be added to a database that hold data at a higher level of aggregate:

Making use of summary table data speeds up response times because:• There are fewer rows to process.

• Fewer, if any, joins are required.

Advanced Universe Design—Learner’s Guide14

Page 29: Bou320 en Col91 Fv Part Ltr

Applying aggregate awarenessThe first step in setting up aggregate awareness in a universe is to determine which objects areto 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

Applying aggregate awareness to objects in a BusinessObjects universe involves a four-stepprocedure:

Step 1: Insert one or more summary tables in the universe structure. Set joins and cardinality.

Step 2: Set the contexts.

Step 3: Redefine the objects using @aggregate_aware.

Step 4: Define incompatible objects using Aggregate Navigation.

Note: Part of step 1 (setting joins and cardinality) and step 2 are not required if the summarytable does not contain foreign keys.

To insert a summary table

Step 1 of the aggregate awareness process is to insert one ormore summary tables to the universestructure.

The procedure for inserting a summary table in the structure of the universe is the same as forany other table or view.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 tablecan be joined to the universe.

4. Set cardinality for the new joins.

To detect contexts

Step 2 of the aggregate awareness process is to detect contexts.

15Working with Aggregate Awareness—Learner’s Guide

Page 30: Bou320 en Col91 Fv Part Ltr

After you add the summary table, several new loopsmay exist. You need to resolve these usingcontexts.1. ClickDetect Contexts on the toolbar.

2. Accept the new contexts and rename them if required.

Redefine the objects

The columns in the summary table containing aggregated and dimension data can be used todefine object SELECT properties.

In our example, the summary table columns can be used in the SELECTproperties of the followingobjects:• Sales Revenue• Rental Revenue• Number of Cars Sold• Cost of Cars Sold• Financial Year

When you have added the summary table, each of these objects has two possible sources forreturning data:• A SELECT statement consisting of Table_Name.Column_Name from the summary table.

Specify which of these methods to use when a query is run using these objects. You do thisby modifying the SELECT properties for the affected objects using the @aggregate_awarefunction. This represents step 3 in the aggregate awareness process.

• The original SELECT statement in the existing object.

Note: After redefining, remember to parse the objects.

Applying aggregate awareness to objects

Before editing any objects, confirm exactly what levels of aggregation are available. In ourexample, we have the basic aggregation calculation and the precalculated annual data fromthe summary table.

If you also have summary tables for quarterly figures and monthly figures, you would havefour possible levels altogether.

When you apply the @aggregate_aware function, be aware of the available levels, and beclear about the descending order of aggregation, for example, Annual Figures, QuarterlyFigures, Monthly Figures, and basic aggregation calculation.

The syntax of the @aggregate_aware function

@aggregate_aware(<SELECT statement for highest agg level>,<SELECT statement for second highest agg level>, .. <SELECT statement for second lowest agg level>, <original SELECT statement for basic agg calculation>)

Advanced Universe Design—Learner’s Guide16

Page 31: Bou320 en Col91 Fv Part Ltr

Each aggregation level SELECT statement is separated by a comma, and the entire expressionis enclosed in brackets. The final SELECT statement must be valid for all queries.

The @aggregate_aware function is directing the query engine to use the sum of the measurevalue taken from the summary table where possible and, where not possible, to use the nextsegment in the SELECT statement. The last segment in the @aggregate_aware function is alwaysthe original SELECT that does not use the summary tables. For example:@aggregate_aware(sum(ANNUAL_FIGURES.ANNUAL_SALE_COST),sum(SALE_MODEL.SALE_QTY*MODEL.MODEL_COST))

Similarly, for dimension objects in the summary tables, the @aggregate_aware function simplyselects the column from the summary tables first (in descending order of aggregation), andthen from the normal source. For example:@aggregate_aware(ANNUAL_FIGURES.FP_YEAR, FINANCE_PERIOD.FP_YEAR)

When you have redefined all the objects, the next step is to set when Web Intelligence or WebIntelligence Rich Client can use the summary tables, by definingwhich dimension andmeasureobjects are, or are not compatible with the summary tables.

To apply the @aggregate_aware function

1. Double-click the object whose properties you want to edit, or click Insert Object on thetoolbar 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 dialogbox.

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 orderof highest to lowest level of aggregation data. Separate each action with a comma.

6. Parse the redefined objects.

7. ClickOK to accept the SELECT statement.

8. ClickOK to close the Edit Properties dialog box.

9. Repeat the process for all the appropriate objects.

Define incompatible objects

When all objects requiring @aggregate_aware are correctly set, the final step in the process isto define object compatibility with each table in the universe structure.

17Working with Aggregate Awareness—Learner’s Guide

Page 32: Bou320 en Col91 Fv Part Ltr

All objects that infer columns from tables in the same context as the summary table canautomatically be deemed compatible with the summary table.

However, a summary table that does not contain any foreign keys cannot be joined to othertables and cannot be part of a context. In that case, any query that contains objects from thesummary table and from other tables produces a Cartesian product. Therefore, all objects basedon columns from any other table are deemed incompatible.

You set incompatible objects using the Aggregate Navigation tool.

The Aggregate Navigation automatic detection tool

To set incompatibilities, you can use an automatic detection tool available in the AggregateNavigation dialog box.While theDetect Incompatibility tool checks for incompatible objects,it isn’t restricted to the table that is selected.

TheDetect Incompatibility tool sets objects to be incompatible throughout the whole tablestructure. Therefore, there are some objects that are incompatible with objects in other tables.This could result in queries that would normally return valid results returning instead anIncompatible combination of objects error message or returning a Cartesian product. Theautomatic detection tool detects incompatibilities on every table in the universe, and thereforemay stop some legitimate queries from working.

It is therefore recommended that you check each of the incompatible settings manually usingthe Aggregate Navigation tool.

To use the Aggregate Navigation tool

1. Identify all objects that reference the summary table(s) and associated tables included in thenew 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 thetables 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 theView Associated Objects option, because Universe Designer detection tools cannot lookinside the parenthesis of an @function. You must use your knowledge of the universe orrefer to universe documentation to identify if any of these objects need to be madeincompatible/compatible. It is better to leave an object incompatible if you are not sure.

4. Select Tools ➤ Aggregate Navigation.

Advanced Universe Design—Learner’s Guide18

Page 33: Bou320 en Col91 Fv Part Ltr

The Aggregate Navigation dialog box displays.

In the Aggregate Navigation dialog box you can set the objects and conditions identifiedin 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 compatibilityfor the summary table you selected.

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

19Working with Aggregate Awareness—Learner’s Guide

Page 34: Bou320 en Col91 Fv Part Ltr

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 incompatiblecombination of objects.

7. If an object is set incorrectly, clear the object by clicking it.

8. When you are satisfied with all incompatibility settings, clickOK to close the AggregateNavigation dialog box.

Activity: Setting up aggregate awareness - part 1

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 timeto run. They have requested that these reports be produced without any noticeable processingdelay.

Insert the ANNUAL_FIGURES and QUARTER_FIGURES summary tables into your Motorsuniverse and make the universe aggregate aware.

Note: The steps in the activity represent some of the steps demonstrated by the instructor inthe classroom.

1. In Universe Designer, open your Motors universe file.

2. Incorporate the ANNUAL_FIGURES summary table in your Motors universe and applyaggregate 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 notdelete 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)))

Advanced Universe Design—Learner’s Guide20

Page 35: Bou320 en Col91 Fv Part Ltr

• 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 objectsmanually by usingAggregateNavigation 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 queriesin 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.

4. Incorporate theQUARTER_FIGURES summary table in the Motors universe and applyaggregate awareness.

Tip: You need to edit the @aggregate_aware syntax in the objects listed in step 2 to includethe quarter level. In addition you need to apply the @aggregate_aware function to theFinancial 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 morequeries 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 andQUARTER_FIGURES summary tables infer SQL at the fact table level.

21Working with Aggregate Awareness—Learner’s Guide

Page 36: Bou320 en Col91 Fv Part Ltr

Activity: Setting up aggregate awareness - part 2

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 ofViews. The Views are to demonstrate the concept of Data Warehouse aggregate tables. Applyan aggregate awareness solution in your Motors universe, using the Views provided. Thesetables are incorporated into the schema as standalone tables.1. In Universe Designer, open your Motors universe.

2. Incorporate the three summary tables (Views) in yourMotors universe as standalone tables.View table values to verify that data is returned.

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

4. Implement aggregate awareness to the objects in the Sales Dates class.Open the Sales YearObject. Modify the SELECT statement, applying the @aggregate_awarefunction:@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.

Advanced Universe Design—Learner’s Guide22

Page 37: Bou320 en Col91 Fv Part Ltr

6. Apply aggregate awareness to the Sales Quarter and Sales Month objects. The SQL usedreflects similar syntax as applied in the Sales Year object. Parse themodified objects to verifythat there are no errors in the SQL syntax.

7. Implement aggregate awareness to theOrder Count object created in the SalesDetails class.Parse the modified object syntax to ensure that there are no errors.

8. Set incompatibilities.

9. From the Toolsmenu launch theQuery Panel.Run a query with Sales Year andOrder Count.

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 DesignerQuery Panel, using the Sale Date andOrderCount objects. Check the generated SQL.What is the result? Is this as expected, and why?

Using aggregate awareness to resolve fan traps

The aggregate awareness functionality within BusinessObjects universe design can be viewedsimply as a method for specifying preferential coding based on the other objects containedwithin a query.

When viewed from this perspective, it becomes apparent that aggregate awareness can be usedto resolve issues other than those for which it was originally intended.

For instance, there is a particular fan trap scenario that, while it can be resolved using the classicfan trap solution, results in certain inefficiencies.

The fan trap scenario

Unlike the classic fan trap, the structure shown here involves two tables instead of three:

23Working with Aggregate Awareness—Learner’s Guide

Page 38: Bou320 en Col91 Fv Part Ltr

The standard fan trap resolution

Using the standard method for resolving a fan trap, you would:• Create an alias of table A.

• Create a join from the alias An to table A and set cardinalities.

• Set contexts B and An.

• Edit object Y so that it refers to columns in the alias An rather than table A.

The efficiency problem

This standard fan trap solution resolves the fan trap solution if objects Y and Z are used in thesame query. However, if a query involves only objects X and Y, then no fan trap exists, and yettable 1 is still processed twice (once as the alias An).

You can overcome this inefficiency by applying aggregate awareness to the problem.

The solution makes use of aggregate awareness functionality despite the fact that it does notinvolve a summary or aggregate table.

Advanced Universe Design—Learner’s Guide24

Page 39: Bou320 en Col91 Fv Part Ltr

After you have modified the universe bymaking one or more objects aggregate aware, as withany universe element, you must always test the results by building queries.

To test the universe, build a query that uses the aggregated measures from table A. Use bothcompatible objects and incompatible objects in different queries to make sure all levels ofaggregate awareness are operating correctly.

To resolve a two-table fan trap using @aggregate_aware

1. Create an alias of table A.

2. Create a join between the alias An and table A.

3. Set cardinality.

4. Set contexts An and B.

5. Apply the @aggregate_aware function to the Y object (the first choice referring to table Aand then the alias An).

6. Make the Z object incompatible with table A.

Outer joins and aggregate awareness

A universe is a way to empower the users to create ad hoc queries to answer their businessquestions. The problemwith this is youdo not knowwhat questions the user has, so the universeneeds to be set up to take into account almost limitless possibilities.

In this scenario, we have four tables joined with two equi joins and one outer join.

25Working with Aggregate Awareness—Learner’s Guide

Page 40: Bou320 en Col91 Fv Part Ltr

Initially, this appears to be perfectly in order, if the user creates a query using the Region andClient tables, they get back a list of Regions and Clients. The outer join specifies that the queryreturns all regions, even if there are no clients.

The problem arises if the Sale table is included in the query. Effectively, the user asks the queryto generate SQL joining an equi-join (from Sale) to a potentially blank row (no Client for anexisting Region).

The SQL may look correct, but depending on the RDBMS, the BusinessObjects querying toolmay generate an error or produce incorrect results. In SQL Server the correct results are returned,however in Oracle no null values are retrieved, and in some databases,MSAccess for example,an ambiguous join error is produced at query level.

If this issue occurs with the RDBMS used, then there are two ways of solving this:

1. Do not use outer joins in your universe.

This would not be practical if the users require blank rows to be returned.

2. Create an alias of the table where the outer join is required, and use aggregate aware in therelevant object(s) to identify which route to take when the user creates the query.

Note: Depending on the RDBMS, the outer join placement may be different.

In this example, the Client table is aliased, and the outer join is placed between the Region andthe Client alias table. The outer join is now at the end of the path. The Region table has anequi-join to the original Client table.

Advanced Universe Design—Learner’s Guide26

Page 41: Bou320 en Col91 Fv Part Ltr

This is only half of the solution; the object needs to be changed, so that when the user createsthe query and places, for example, the Client name object in the query, Universe Designerknows it has a choice of tables to get the information from - Client or Client2.

@aggregate_aware(CLIENT2.CLIENT_NAME,CLIENT.CLIENT_NAME)

Having told the object that it has two tables to get the same information from, the final step isto tell Universe Designer when to use which table - the Client or the Client2 alias.

Using the Aggregate Navigation tool, the Client2 table needs to be made incompatible withany objects from the Sale table.

By setting this, whenever a query is created using the Sale Type or Sale Total objects, UniverseDesigner cannot use the Client2 table (and therefore the outer join). However, if these objectsare not included, then the Client2 table (and the outer join) is used.

27Working with Aggregate Awareness—Learner’s Guide

Page 42: Bou320 en Col91 Fv Part Ltr

Quiz: Working with aggregate awareness1. How does the @aggregate_aware function improve query performance?

2. Why does using summary table data speed up response times?

3. The tool you use in Universe Designer to set incompatibilities between objects and tablesin the structure of the universe is called the ___________________ tool.

Advanced Universe Design—Learner’s Guide28

Page 43: Bou320 en Col91 Fv Part Ltr

Lesson summaryAfter completing this lesson, you are now able to:

• Define aggregate awareness• Apply aggregate awareness to objects

29Working with Aggregate Awareness—Learner’s Guide

Page 44: Bou320 en Col91 Fv Part Ltr

Advanced Universe Design—Learner’s Guide30

Page 45: Bou320 en Col91 Fv Part Ltr

Lesson 3Designing Advanced Objects

Lesson introductionYou can create advanced objects that aid users in answering more specific questions in theirreports.

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 tothe SQL syntaxes for other RDBMS appendix for the equivalent functions and syntaxes inOracle,DB2, or MySQL.

After completing this lesson, you will be able to:

• Combine database functions in objects• Construct relative date-time objects

31Designing Advanced Objects—Learner’s Guide

Page 46: Bou320 en Col91 Fv Part Ltr

Combining database functions in objectsInitially, universes may only contain the basic dimension and detail objects that reflect thetables and columnnames in the universe structure, togetherwith somemore advancedmeasureobjects that combine columns for aggregation of revenue or cost.

When end users start building reports based on this universe, it may turn out that severalbusiness questions cannot be answered using the available objects.

This often results in having end users define variables and complex formulas in their reportsto get the required information shown.

As a designer, it is important to identify what type of additional object functionality is neededto allow end users to generate the data in their report. In many cases instead of using reportvariables and functions, these reporting needs can be added in the universe in the form ofmoreadvanced 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

When connecting your universe to a specific RDBMS, the <driver>.PRM file makes a list ofdatabase functions available in the universe. The PRM file, a connection parameter file, containsdefault SQL parameters used for query generation, date and other operators, and functions.

The function list shown in the PRM file never includes a complete list of available functionsfor the designated RDBMS. The list of default functions made available in the PRM file for theused RDBMS is shown in Universe Designer, divided intoNumber, Character, andDate types.

When working in Universe Designer, besides from selecting functions from the list, you canadd SQL functions directly into the Select field of an object, provided that the underlying datasource supports the SQL function used.

This section looks at some of the most commonly used numeric and character functions thatcan be used for complex dimension and detail objects.

The list of numeric functions consists of a number of aggregate functions that can be used inmeasure objects, and severalmathematical and statistical functions. The list of character functionsconsists of several functions that allow you to extract data-parts, and some conversion functions.

Advanced Universe Design—Learner’s Guide32

Page 47: Bou320 en Col91 Fv Part Ltr

On their own each function may give limited functionality, but when combining two or morefunctions in a SELECT statement, they allow designers to construct complex objects that maybenefit the end users in their report creation.

CharIndex, Length, Left, Right, and Substring functions

Note: The SQL statements in this table are for SQL Server 2005. Alternative SQL syntaxes forOracle, MySQL, and DB2 are available in the SQL syntaxes for other RDBMS appendix.

DescriptionFunction

Returns a number of character values from the left-handside of a string.Fn_Left (or Left)

Returns a number of character values from the right-handside of a string.Fn_Right (or Right)

Returns the position of an expression in a character string.Charindex

Returns the length of a character string.Fn_Length

Returns part of a character string. The substring starts at aspecified character position and has a specified length.Substring

These functions can be used to establish a character string length by using the length function.The substring, left and right functions can allow extracting values of a specified length fromeither the start or end part of a character string. Charindex can establish the position of acharacter value in a string.

Combining these functions can allow designers to extract string values from any part of a tablecolumn. For example, if for a Zoning Improvement Plan (ZIP) code, or Postal Code, only thefirst group of values, representing the local Area Code are required. 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 unknownhow many character values need to be extracted.

The common delimiter is the space or hyphen that separates the first part of the ZIP code, orPostal Code, from the second. If the position of the space is known, then this can be the decidingfactor of howmany values to extract from the left-hand side. Charindex can be used to establishthe position of the space in this string:charindex(' ',CLIENT.CLIENT_AREA_CODE)

You can nowdefine data up to the space from either left or right. The following syntax providesthe first digits of the ZIP code, or Postal Code, up to the dividing space:rtrim(substring(CLIENT.CLIENT_AREA_CODE,1,charindex(' ',CLIENT.CLIENT_AREA_CODE)))

33Designing Advanced Objects—Learner’s Guide

Page 48: Bou320 en Col91 Fv Part Ltr

Note: The rtrim function is used to remove the space (on the right) from the substring.

Ceiling, Floor, Round, and CAST functions

These functions can be used to round down or round up to a last digit or integer of a numbervalue. The CAST function is a conversion function that can be used to convert number valuesto strings.

DescriptionFunction

Returns the smallest integer greater than or equal to n. It returns thedecimal value rounded up to the next integer value. For example,Ceiling(2.3) returns a value of 3.

Ceiling

Returns the largest integer less than or equal to n. It returns thedecimal value rounded down to the next integer value. For example,Floor(6.987) returns a value of 6.

Floor

Returns a number rounded to n decimal places.Round

Converts data from one data type to another.CAST

Rounding up and rounding down of values can be useful to make sure that number formatsdo not have unnecessary decimal places. This can be useful for object formatting, and for certainmeasure calculations. These functions can also be used in creating data range objects.

In the Client table there is a value for Client_Age, and the end user likes to be able to run aquery showing the customer age and the age range the customer falls into. For example, 10-19,20-29, 30-39, and so forth.

You can use the CAST function to convert and combine the two strings. The formula becomes:CAST((floor(CLIENT.CLIENT_AGE/10)*10) as varchar)+'-'+CAST((((floor(CLIENT.CLIENT_AGE/10)+1)*10)-1) as varchar)

This allows end users to run an age range object with a range increment of 10, in their reports.

Advanced Universe Design—Learner’s Guide34

Page 49: Bou320 en Col91 Fv Part Ltr

CASE WHEN THEN ELSE END

The CASE statement allows designers to locate a value and replace it by something else. This isa powerful SQL syntax function that can aid in complex conditional syntaxes. In theBusinessObjects XI 3.0/3.1: Universe Design course, the CASE statementwas used to allow creatingsales revenue by year if the year is a certain value.

DescriptionFunction element

The input_expression is any valid expression.

CASE input expression For example:CASE CLIENT.CLIENT_LASTNAME

The when_expression is a simple expression to which theinput_expression is compared. The data types of

WHEN when_expressioninput_expression and each when_expression must be thesame.

For example:CASE CLIENT.CLIENT_LASTNAME WHEN 'Brent'

The result_expression is the expression returned when theinput_expression equalswhen_expression evaluates TRUE,

THEN result_expressionor Boolean_expression evaluates to TRUE. Theresult_expression is any valid expression.

For example:CASE CLIENT.CLIENT_LASTNAME WHEN 'Brent' THEN 1

The else_result_expression is the expression returned if nocomparison operation evaluate to TRUE. If this argument

ELSE

else_result_expression

is omitted and no comparison operation evaluates to TRUE,CASE returnsNULL. The else_result_expression is any validexpression, however the data types of theelse_result_expression and any result_expression must bethe same or must be an implicit conversion.

For example:CASE CLIENT.CLIENT_LASTNAME WHEN 'Brent' THEN 1 ELSE 0

35Designing Advanced Objects—Learner’s Guide

Page 50: Bou320 en Col91 Fv Part Ltr

DescriptionFunction element

The END component ends the CASE statement syntax.

END

For example:CASE CLIENT.CLIENT_LASTNAME WHEN 'Brent' THEN 1 ELSE 0 END

Any additional CASE statements can be placed before theEND syntax to evaluate a further list of conditions. An ENDsyntax for each additional CASE statement is required. Forexample:CASE CLIENT.CLIENT_LASTNAME WHEN 'Brent' THEN 1 ELSE 0(CASE CLIENT.CLIENT_LASTNAME WHEN 'Cooley' THEN 1 ELSE 0 END) END

The CASE statement can be used in objects, conditions, joins and derived tables allowing forgreat flexibility in universe design.

An example syntax for the CASE statement is:

Note: The CASE statement is not a condition in itself. It is only a value assignment. This meansthat it allows you to combine as many CASE statements (nested within each other) as you want.On the other hand you need to add extra conditions to ensure the restriction actually worksand no empty rows are created.

Activity: Combining database functions in objects

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 rangethe 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.

Advanced Universe Design—Learner’s Guide36

Page 51: Bou320 en Col91 Fv Part Ltr

For example, the range object needs to show the lower range value of 40, and the upperrange 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 andOK 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 objectDynamicAge Range.

6. Edit theDynamic 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 userknowwhat type of value they are expected to fill into the prompt. For example, in this caseit can be noted that the end user can enter into the prompt values like 5, 10, 15, 20, and soforth.

7. Click Apply andOK to save the object changes.

8. As the universe hasAggregate Awareness assigned, it is good practice to set any new objectsto be either compatible or incompatible with these tables. In this instance, Age Range is anew object in the client class. Ensure that the client class is incompatible with the annualfigures, quarter figures, year order count, year quarter order count, and year quarter monthorder 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 thePhone NO.If there is no area code value ensure the entire Phone NO is displayed.

2. As the universe hasAggregate Awareness assigned, it is good practice to set any new objectsto be either compatible or incompatible with the summary tables used in your schema.Save the change to your universe.

37Designing Advanced Objects—Learner’s Guide

Page 52: Bou320 en Col91 Fv Part Ltr

Working with analytic functions

UniverseDesigner supports the use of analytic functions for specific RDBMS.Analytic functionsare called RISQL functions in RedBrick, OLAP functions in Teradata, and are known asTransact_SQL functions in SQL Server. You can use Universe Designer to define analyticfunctions for objects in a universe.

End users can use analytic functions to perform data analysis that is not normally possiblewithin the reporting capabilities of the BusinessObjects reporting tools.

What are analytic functions?

An analytic function is a function that performs an analytical task on a result set that can bedivided into ordered groups of rows or partitions. Analytic functions compute an aggregatevalue based on a group of rows. They differ from aggregate functions in that they returnmultiple rows for each group. The group of rows is called a window and is defined by theanalytic_clause. For each row, a sliding window of rows is defined. The window determinesthe range of rows used to perform the calculations for the current row. Window sizes can bebased on either a physical number of rows or a logical interval such as time.

DescriptionFunction element

Use OVER analytic_clause to indicate that the functionoperates on a query result set. That is, it is computed after

analytic_clause

the FROM, WHERE, GROUP BY, and HAVING clauses. You canspecify analytic functions with this clause in the select listor ORDER BY clause.

Note: You cannot specify any analytic function in any part of theanalytic_clause. That is, you cannot nest analytic functions.

Advanced Universe Design—Learner’s Guide38

Page 53: Bou320 en Col91 Fv Part Ltr

DescriptionFunction element

Use the PARTITION BY clause to partition the query resultset into groups based on one or more value_expr. If you

query_partition_clauseomit this clause, then the function treats all rows of the queryresult set as a single group. Valid values of value_expr areconstants, columns, non-analytic functions, functionexpressions.

Use the order_by_clause to specify how data is orderedwithin a partition. you can order the values in a partition

order_by_clause

on multiple keys, each defined by a value_expr and eachqualified by an ordering sequence.

Note: Aggregate analytic (Transact_SQL) functions for SQL Serverdo not allow the use of the ORDER BY. This may differ with otherRDBMS that support these type of functions.

Analytic functions are the last set of operations performed in a query except for the final ORDERBY clause. All joins and all WHERE, GROUP BY, and HAVING clauses are completed before the analyticfunctions are processed. Therefore, analytic functions can appear only in the select list or ORDERBY clause.

In Universe Designer you can define objects with analytic functions to calculate rankings,cumulative aggregates, and ratios within one or more partitions. Depending on your RDBMS,you can also define the range of rows on which you want to apply the analysis within thepartition.

Note: For a full description of analytic functions refer to your RDBMS documentation.

ROW_NUMBER

The most basic ranking function is ROW_NUMBER. ROW_NUMBER returns a column as an expressionthat contains the row’s number within the result set. This is only a number used in the contextof the result set, if the result changes, the ROW_NUMBER value changes.

The ROW_NUMBER expression is used with the following additional clauses:• OVER: Determines the partitioning and ordering of the rowset before the associatedwindow

function is applied.• PARTITION BY: Divides the result set into partitions. Thewindow function is applied to each

partition separately and computation restarts for each partition.• ORDER BY: Specifies the sort order used on columns returned in a SELECT statement.

Note: If you choose the ROW_NUMBER function to run against a non-unique column, it breaksthe tie and still produces a running count so no rows have the same number.

An example ROW_NUMBER SQL Statement is as follows:SELECT ROW_NUMBER() OVER (PARTITION BY 1 ORDER BYCLIENT_ID) AS SURROGATE, * FROM CLIENT

39Designing Advanced Objects—Learner’s Guide

Page 54: Bou320 en Col91 Fv Part Ltr

RANK

RANKworks a lot like ROW_NUMBER and uses the same expression clauses as described in theROW_NUMBER section.

Themain difference is that the RANK function does not break ties, you do not get a unique valuefor ties. The RANK function assigns the same key if the value is the same.

Aggregate analytic functions

In addition to the ranking options, you can use the OVER and PARTITION BY elements incombination with aggregate functions like Count, Sum, Min, Max, and Average.

Note: Analytic functions can be added directly to the Select field if the RDBMS allows theiruse. However, to ensure correct use of the aggregate analytic functions, the RISQL functionsparameter, and Over Clause parameter need to be enabled in the PRM file. For most RDBMSthis has been set as standard, but this is not the case for SQL Server.

The PRM file is a system file and a backup of the file needs to bemade prior tomaking changes.

For aggregate analytic functions, the following two parameters need to be added to the PRMfile configuration section:<Parameter Name="RISQL_FUNCTIONS">RANK,SUM,AVG,COUNT,MIN,MAX,DENSE_RANK,NTILE,ROW_NUMBER</Parameter>

<Parameter Name="OVER_CLAUSE">Y</Parameter>

The RISQL functions parameter lists the supported by the database, and this list is differentfor each RDBMS. The Over Clause parameter allows BusinessObjects products to includeaggregate analytic functions (for example, SUM() OVER (PARTITION BY))when generating SQL.Depending on the database used, in the PRM file you may also need to apply parameter rulesfor the GROUP BY clause. Consult the BusinessObjects XI 3.0/3.1: Designer's Guide for moreinformation on analytic functions and the PRM file.

Advanced Universe Design—Learner’s Guide40

Page 55: Bou320 en Col91 Fv Part Ltr

Constructing relative date-time objectsDiscuss the unit objectives.

Every universe has a need for relative time objects that end users can use to make calculationsbased on current dates or based on a prompted dynamic period. This unit looks at how youcan 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

Every now and then, you need to take the current date and calculate some other date. Forexample, end users might need to determine what date is the first day of the month, or needto know the last day of the month. There are a number of functions listed in the Number listthat can apply to these needs. The examples listed below are for SQL Server, and may differfor other Relational Database Management Systems (RDBMS):• fn_year:

This function returns the year values of a date object. For example:{fn year(FINANCE_PERIOD.FP_START)}

This example returns the values 2003, 2004, and 2005 in numeric format.

• fn_month:

This function returns the month values of a date object. For example:{fn month(FINANCE_PERIOD.FP_START)}

This example returns the values 1-12 in numeric format.

Note: If there is no date value in the database Fp_Start column for a particular month, thismonth value is not included in the LOV.

• fn_week:

This function returns the week values of a date object. For example:{fn week(FINANCE_PERIOD.FP_START)}

This returns the values 1-52 in numeric format.

Note: If there is no date value in the database Fp_Start column for a particular week, thisweek value is not included in the LOV.

• datepart(qq, ):

This function returns the quarter values of a date object. For example:Datepart(qq, FINANCE _PERIOD.FP_START)

This example returns the values 1-4 in numeric format.

41Designing Advanced Objects—Learner’s Guide

Page 56: Bou320 en Col91 Fv Part Ltr

Note: The datepart function can also be used to extract year,month,week, and day numericvalues.

You can also use the dateadd and datediff functions to calculate a number of different datesyou might need to use in your applications. And for a current date value the function getdate

can be used.

Note: If database functions are typed in directly, do ensure that the object parses and run test queriesto ensure the object does not cause any errors.

The datediff function calculates the amount of time between two dates, where the time partis based on an interval of time, such as hours, days, weeks, months, or years.

The dateadd function calculates a date by taking an interval of time, and adding it to a date,where the interval of time is the same as those used by the datediff function.

Combining these two functions and getdate, a SQL Server function that returns the currentdate and time, can aid retrieving first and last day of themonth or year information, for example:• First Day of Month:

dateadd(mm,datediff(mm,0,getdate()), 0)

The datediff(mm,0,getdate()) section of the syntax above calculates the number ofmonthsbetween the current date and the date "1900-01-01 00:00:00.000". In SQL Server date andtime variables are stored as the number of milliseconds since "1900-01-01 00:00:00.000". Thisis why you can specify the first date-time expression of the datediff function as "0." Thedateadd function adds the number of months between the current date and '1900-01-01".By adding the number of months between our predetermined date '1900-01-01' and thecurrent date it is possible to arrive at the first day of the current month. In addition, the timeportion of the calculated date becomes "00:00:00.000."

• Monday of the Current Week:

dateadd(wk,datediff(wk,0,getdate()),0)

Note: This example assumes Sunday is the first day of the week.

• First Day of the Year

dateadd(yy,datediff(yy,0,getdate()),0)

• First Day of the Quarter

Dateadd(qq,datediff(qq,0,getdate()),0)

By using this simple dateadd and datediff calculation you can come up with many differentdates that might be valuable.

Here are some examples that add an additional dateadd function to calculate the last day datesfor both the current and prior intervals.• Last Day of Prior Month

dateadd(ms,-3,dateadd(mm,datediff(mm,0,getdate()),0))

Advanced Universe Design—Learner’s Guide42

Page 57: Bou320 en Col91 Fv Part Ltr

• Last Day of Prior Year

dateadd(ms,-3,dateadd(yy,datediff(yy,0,getdate()),0))

• First Monday of the Month

dateadd(wk,datediff(wk,0,dateadd(dd,6-datepart(day,getdate()),getdate())),0)

Using the sixth day of the month instead of the current date in the formula allows thiscalculation to return the first Monday of the current month.

Relative date-time objects

In many instances universes are designed that only directly reflect the contents and structureof the underlying database. When building a report based on this universe, it turns out thatmany questions cannot be answered using the simple objects that are available. Examples ofthese questions are:• What is the sales revenue from January 1st up to today?• How does this quarter's sales revenue compare to the same quarter last year?

Web Intelligence Rich Client enables a user to answer these questions by using advancedformulas and calculations. If these report-based formulas are required by many users, insteadof having each individual user apply themyou can extend the universewith additional complexobjects and predefined conditions.

Each database has a number of date functions that give you the base syntaxes for a currentdate, current year, current month, and by adding, or subtracting numbers you can createprevious and future date syntaxes. For example in SQL Server you can use the following SQLsyntaxes:

TypeDescriptionSELECT syntaxDate Object

DateReturns the current dateand time.

getdate()CurrentDate

NumberReturns the current year.datepart(yyyy,getdate())CurrentYear

NumberReturns the currentmonth.datepart(mm,getdate())CurrentMonth

DateReturns today's date a yearahead.

dateadd(mm,12,getdate())Next Year

Adding date objects based on database date functions to the universe gives end users moreflexibility in their reporting requirements.

43Designing Advanced Objects—Learner’s Guide

Page 58: Bou320 en Col91 Fv Part Ltr

Note: Date function syntaxes can be used in predefined conditions as well as in objects.

CASE statements in measure objects

Creating universe objects that compare date function syntaxeswith existing database columns,extends further reporting functionality. To accomplish this, you can use the CASE statement toconstruct "If Then Else" logic. For example:CASE WHEN (datepart(yyyy,getdate())-1)= {fn_year(FINANCE_PERIOD.FP_START)}THEN 1ELSE 0END

CASE statements can be further extended by using @functions:• @prompt

• @select

The @prompt function in CASE statements

In addition to the date function syntaxes, you may need to have specific date-time promptsthat allow users to input a date of their choice. The prompt can be referenced in objects tocompare a user input date with an existing date in the database.

The CASE statement can be used to combine the database functions and the @prompt functionality.For example:CASE WHEN {fn_year(FINANCE_PERIOD.FP_START)}= @prompt('Select year','N',,mono,free)AND{fn_month(FINANCE_PERIOD.FP_START)}= @prompt('Select month','N',,mono,free)THEN 1ELSE 0END

The @select function in CASE statements

The example CASE statement shows the use of the fn_year and fn_month functions to formata date column to a year or month. If your universe already contains a financial year and afinancial month object, these objects can be referenced in the CASE statement using the @selectfunctionality.

The @select function is an internal function that allows you, as the designer, to reuse universeobjects without forcing you to repeat the entire SQL syntax. The @select function comes invery handy when building complex objects.

For our previous CASE statement example you can use @select to substitute the database columnFp_Start if this already exists as an object in the universe:CASE WHEN @select(Financial Period\Financial Year)= @prompt('Select year','N',,mono,free)AND@select(Financial Period\Financial Month)= @prompt('Select month','N',,mono,free)THEN 1ELSE 0END

Advanced Universe Design—Learner’s Guide44

Page 59: Bou320 en Col91 Fv Part Ltr

Re-use of prompt syntaxes can be handled in the same way. You can create base date promptobjects, that can be hidden to end users if needed, and use these as reference in other objects.For example:

SELECT syntaxPrompt Object

@prompt('Select date','D','Financial Period\FP Start',mono,free)Date Prompt

@prompt('Select year','N','Financial Period\FinancialYear',mono,free)Year Prompt

@prompt('Select month','N','Financial Period\FinancialMonth',mono,free)Month Prompt

For our previous CASE statement example you can use @select to substitute the database columnand the prompt syntax if both already exist as objects in the universe:CASE WHEN @select(Financial Period\Financial Year)= @select(Prompt Objects\Year Prompt)AND@select(Financial Period\Financial Month)= @select(Prompt Objects\Month Prompt)THEN 1ELSE 0END

The advantage of the @select function is that it allows you to specify SQL code only once. Ifyou change a database column in the RDBMS you only need to modify the SQL of the baseobject; Universe Designer automatically updates the SQL for all other objects that use the basecolumn.

Tip: When using @select, you can still see the full SQL statement by enabling the check boxShow Object SQL in the SQL Editor.

When all base syntax components have been constructed, a CASE statement can be used tocombine the functions and build boolean "reference" objects, or "flags" that can be used to buildrelative-time measures objects.

Note: You can also construct the CASE statement , using boolean logic, separating statementsusing an asterisk; the asterisk ensures that both CASE statements return a 1 value:CASE @select(Financial Period\Financial Year) WHEN @select(Prompt Objects\Year Prompt) THEN 1 ELSE 0 END *CASE @select(Financial Period\Financial Month) WHEN @select(Prompt Objects\Month Prompt) THEN 1 ELSE 0 END

45Designing Advanced Objects—Learner’s Guide

Page 60: Bou320 en Col91 Fv Part Ltr

Activity: Constructing relative date-time objects

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 endusers to enter a year, month, or a full date value.

These prompted values are compared to the actual database date column (or datepart), forexample SALE.SALE_DATE.

A CASE statement can be used to compare the prompted periodwith the actual database columnperiod, and build boolean "reference" objects, or "flags" that can be used to build relativedate-time measures objects. If the prompted period input value matches the actual databasecolumn period, the CASE statement returns a 1 value.

After creating the boolean flags, the final stage is to build the relative date-timemeasure 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 @selectfunction is an internal function that allows you, as the designer, to reuse universe objectswithout forcing you to repeat the entire SQL syntax. The @select syntax used in this activitycan be generated by selecting the objects and functions in the Edit Selectmenu.

1. In Universe Designer, open your Motors universe file.

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 SELECTclause. Normally an @prompt is handled in the WHERE clause and the SELECTcontains the table.column reference. For the purpose of feeding through theprompted value into other object SELECT clauses using the @select function,the@prompt requires to be placed in theSalesDate Prompt objectSELECT clause.The table reference is set via the Tables button. The @prompt syntax only parseswhen it is set to a Character type. It is viewed as constant, as there is no datecolumn referenced. Setting the object to Character type does not affect the outcomeof the activity.

Prompts the user to choose a sales date from the list of values ormanually type in a date value (YYYYMM).Description:

Advanced Universe Design—Learner’s Guide46

Page 61: Bou320 en Col91 Fv Part Ltr

Character (see Note above for details).Type:

Select SALE as the reference table.Tablesbutton:

• Sales Year Prompt:

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

syntax:

Subtracts the year from the entered sales date prompt value.Description:

NumberType:

• Sales Month Prompt:

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

syntax:

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

NumberType:

4. In theYTDDateObjects subclass, create the following indicator or boolean flag objects thatare 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 asobjects on their own.

Tip: The @select statements shown in the table can be generated by selecting the objectsand functions in the Edit Selectmenu.

Sales Date in Prompt flag

DescriptionSELECT syntax

Indicator that returns 1 if boththe year and the month of the

CASE WHEN @select(Sales Dates\Sales Year) = @select(YTD Date Objects\Sales Year Prompt)

sales date are equal to the yearAND @select(Sales Dates\Sales Month) =

and month in the entered@select(YTD Date Objects\Sales Month Prompt)

47Designing Advanced Objects—Learner’s Guide

Page 62: Bou320 en Col91 Fv Part Ltr

DescriptionSELECT syntax

THEN 1ELSE 0 END

prompt date. Otherwise itreturns 0.

Sales Month in Prompt flag

DescriptionSELECT syntax

Indicator that returns 1 if theyear of the sales date equals the

CASE WHEN sign(@select(Sales Dates\Sales Year)+1 - @select(YTD Date Objects\Sales Year Prompt)) = 0 year in the entered promptAND sign(@select(Sales Dates\Sales Month) - date minus one year, and the@select(YTD Date Objects\Sales Month Prompt)) = 0 month of the sales date equalsTHEN 1ELSE 0 END

the month of the referenceperiod. Otherwise it returns 0.

Sales Year in Prompt flag

DescriptionSELECT syntax

Indicator that returns 1 if themonth of the sales date <=

CASE WHEN @select(Sales Dates\Sales Year) = @select(YTD Date Objects\Sales Year Prompt)AND sign(@select(Sales Dates\Sales Month) - sales month prompt, and the(@select(YTD Date Objects\Sales Month Prompt)-1) year of the sales date is equal = 1THEN 1ELSE 0 END

to the sales year prompt.Otherwise it returns 0.

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 saledate values for those rows. The second part of the statements subtracts the month valueselected 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 positivevalue, it returns 1.

If a sale date of 4/3/2004 is selected in the prompt, the datepart(mm) changes this to a valueof 4. The -1 part of the formula changes this value to 3 as the prompt input value. When theprompted period value (3) is subtracted from themonth value (4) a positive value is returnedand ends in 1. With the CASE statement this ensures that month 4 is included in the valuesreturned.

5. Hide the entire YTD Date Objects subclass.

6. Create a new YTDMeasure Objects subclass in the Sales class.

7. Create the following relative date-timemeasure objects in theYTDMeasureObjects subclass:

Advanced Universe Design—Learner’s Guide48

Page 63: Bou320 en Col91 Fv Part Ltr

Tip: The @select statements shown in the table can be generated by selecting the objectsand functions in the Edit Selectmenu.

SELECT SyntaxMeasure Object

sum(SALE.SALE_TOTAL)Sales Total

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

Total Sales inpromptedyyyy-mm period

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

Total Sales inprompted yearperiod

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

Total Sales inprompted yearperiod - 1yr

8. As the universe has aggregate awareness assigned, it is good practice to set any new objectsto 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 theannual figures, quarter figures, year order count, year quarter order count, and year quartermonth order count tables.Save the change to your universe.

9. Save the changes and test your universe using Web Intelligence Rich Client.

10.Create a new query using Sale Date, Sales Total, and Total Sales in prompted yyyy-mmperiod.

11.Select a date from the LOV.The Total Sales in prompted yyyy-mm period object returns only sales data for the monthand year values that equal the month and year values entered in the prompt, all other rowsreturn 0. This way end users can compare the total sales revenue for all dates to the salesrevenue returned for the selected yyyy-mm period.

12.Run a second query using the Sale Date, Sales Total, and Total Sales in prompted yearperiod 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 lastyear values.

The Total Sales in prompted year period object returns only sales data for the month andyear values that equal the month and year values entered in the prompt. All other rowsreturn 0.

49Designing Advanced Objects—Learner’s Guide

Page 64: Bou320 en Col91 Fv Part Ltr

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 lastyear values.

The Total Sales in prompted year period - 1yr object returns only sales data for the monthand year values that equal the month and year values entered in the prompt minus 1 year.All other rows return 0.

Moving averages

In statistics, a moving average or rolling average is one of a family of similar techniques usedto analyze time series data.

Amoving average series can be calculated for any time series. In finance it is most often appliedto stock prices, returns, or trading volumes.Moving averages are used to smooth out short-termfluctuations, thus highlighting longer-term trends or cycles. The threshold between short-termand long-term depends on the application, and the parameters of the moving average are setaccordingly.

A moving average through time is the unweighted mean of the previous N data points. Forexample, a 10-day simple moving average of closing price is the mean of the previous 10 days'closing prices. If those prices are pN,pN − 1... pN − 9 then the formula is:

This type of average is also referred to as a moving average through time, or MAT.

In theMotors universe you do not have a day level of granularity, but can calculate themovingaverage using the time periods from the Financial Period table, usingmonth as the granularitylevel. In the example shown, a derived table and an alias have been added to the structure.

Advanced Universe Design—Learner’s Guide50

Page 65: Bou320 en Col91 Fv Part Ltr

To create a moving average in a universe you require the following:• A derived table with @prompt or @variable.• A fact table.• An alias of the fact table.• A time period (dimension) table.• Contexts.

The derived table acts as the N time period input via the Start_N_Periods column. This is doneusing the @prompt function in the table SQL syntax. For example:SELECT DistinctFINANCE_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_ENDFROMFINANCE_PERIOD

Note: For some RDBMS the @prompt function needs to be substituted by @variable. For moreinformation on the use of @variable consult the BusinessObjects Designer's Guide.

The Sale table alias is the source for the MAT measure data, based on the prompted N timeperiod value that is fed through the join between the alias and the derived table. Contexts arerequired to separate the Sale and Sale_MAT fact tables, otherwise you would have a potentialSQL Trap in your schema.• A Sale_MAT context:

• A Sale context:

51Designing Advanced Objects—Learner’s Guide

Page 66: Bou320 en Col91 Fv Part Ltr

The final stage is to create the actual objects that the user can run to display the Sale Total MATvalues. In this example the Sale Total MAT object consists of the Sale_Total column from theSale_MAT table and the @prompt syntax used to get the number of periods:sum(SALE_MAT.SALE_TOTAL)/@prompt('how many periods?','N',,,,)

When a user runs a querywith Financial Year, FinancialMonth, the Sales Total from the originalSale table, the Sales Total N Period (Sale_Total from the alias table), and Sales Total MAT, theuser is prompted for the number of periods required for the moving average.

The report displays the sales total values. The Sales Total N Periods column shows theaccumulated values based on the number of periods (in our example 2), and the Sales TotalMAT column shows the accumulated values divided by the number of periods.

Advanced Universe Design—Learner’s Guide52

Page 67: Bou320 en Col91 Fv Part Ltr

Activity: Creating a moving average

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 bemanually createdfor the SALE_MAT alias table.

2. Create a new Derived Table, calledDT_Date_N_Periods, using the following syntax:SELECT DistinctFINANCE_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_ENDFROMFINANCE_PERIOD

3. Join theDT_Date_N_Periods table to the SALE_MAT table using a theta-join; using theSTART_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)

53Designing Advanced Objects—Learner’s Guide

Page 68: Bou320 en Col91 Fv Part Ltr

4. Join theDT_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. TheNew Contextwindow appears, with all joins from the original SALES contextselected.

4. Name the contextSALES_MAT and remove all joins referring to the original SALE table:CLIENT.CLIENT_ID = SALE.CLIENT_IDSHOWROOM.SHOWROOM_ID = SALE.SHOWROOM_IDSALE.SALE_ID = SALE_MODEL.SALE_IDSALE.SALE_TYPE = 'S'SALE.SALE_DATE between FINANCE.FP_START and FINANCE.FP_END

5. Replace the removed joinswith theSALE_MAT alias table joins. Ensure all newly createdjoins 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 YTDMeasure 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 SalesTotal object using the @select function.@select(YTD Measure Objects\Sales Total)

• 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

Advanced Universe Design—Learner’s Guide54

Page 69: Bou320 en Col91 Fv Part Ltr

Note: Either use the syntax shown above, or use the @select function to reference theexisting 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 theexisting Financial Month object in the Finance Period class.@select(Finance Period\Financial Month)

8. As the universe hasAggregate Awareness assigned, it is good practice to set any new objectsto 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 querywith all objects in the SalesMAT class, Test the report using different numberof periods. Your report should look similar to this:

The report displays the Sales Total column, which references the original SALE table. TheSales Total N Periods column shows the accumulated sales total values based on the numberof periods (for example Sales Total from Month 01 and Month 02), the Sales Total MATcolumn shows the accumulated values divided by the number of periods (for example SalesTotal 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:

55Designing Advanced Objects—Learner’s Guide

Page 70: Bou320 en Col91 Fv Part Ltr

Advanced Universe Design—Learner’s Guide56

Page 71: Bou320 en Col91 Fv Part Ltr

Quiz: Designing advanced objects1. 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.

2. List three different analytic(Transact-SQL) functions.

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.

57Designing Advanced Objects—Learner’s Guide

Page 72: Bou320 en Col91 Fv Part Ltr

Lesson summaryAfter completing this lesson, you are now able to:

• Combine database functions in objects• Construct relative date-time objects

Advanced Universe Design—Learner’s Guide58

Page 73: Bou320 en Col91 Fv Part Ltr

Lesson 4Creating Complex Predefined Conditions, LOVs,and Joins

Lesson introductionThis lesson looks at how you can create complex predefined conditions, that can aid users toanswer more specific questions in their reports. This lesson also looks at how LOVs can becustomized 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 tothe SQL syntaxes for other RDBMS appendix for the equivalent functions and syntaxes inOracle,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

59Creating Complex Predefined Conditions, LOVs, and Joins—Learner’s Guide

Page 74: Bou320 en Col91 Fv Part Ltr

Creating complex predefined conditionsThis unit looks at howyou canmake use of a subquerywithin a condition and build subqueriesvia 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

End users may wish to see the most recent sale details, for example the most recent sale dateand the revenue that was made on that date as a summary table in the document.

InWeb Intelligence Rich Client the end user can run a report with Sale Date and Sales Revenue,and apply amaximum for the Sale Date. However, as shown in the example below (containinga sample set of sale dates), the Sales Revenue that gets returned for the maximum date in thesummary table is not the correct value.

The maximum Sale Date is the 31st of March 2005, and the Sales Revenue for that date is 17,505.When adding a new tablewith =Max([Sale Date]) and another columnwith Sales Revenue,notice that the Sales Revenue showing for the maximum Sale Date is actually the total revenuefor all sale dates.

The correct results can be obtained by using a subquery at report level. However, instead ofhaving the end user struggle with the appropriate subquery syntax, this can also be done atuniverse level as a predefined condition.

For example:SALE.SALE_DATE = ALL(SELECTmax(SALE.SALE_DATE)FROMSALEWHERE

Advanced Universe Design—Learner’s Guide60

Page 75: Bou320 en Col91 Fv Part Ltr

(SALE.SALE_TYPE='S'))

The example predefined condition syntax ensures that the result inWeb Intelligence RichClientappears correct.When the end user creates a newWeb Intelligence RichClient document usingSale Date and Sales Revenue in the Result Objects pane, and the new condition in theQueryFilter pane, the end result shows the maximum Sale Date and the correct Sales Revenue valueof 17,505.

The benefit of using this method is that it allows the end user to combine several objects in areport and get the correct maximum Sale Date and Sales Revenue values.

Using subqueries this way allows designers to use aggregate functions in the WHERE clause. Itis also possible to extend this syntax and generate a condition that allows end users to retrievethe maximum Sale Date for each Client together with the corresponding Sales Revenue.

In the Motors database there are a number of clients that have more than one sale date record.

Using a predefined condition with a subquery allows end users to return the maximum saledate per client. For example:( CLIENT.CLIENT_ID=SALE.CLIENT_ID )AND (SALE.SALE_DATE = ALL(SELECTmax( SALE.SALE_DATE )FROMSALE,CLIENT SubAlias__1WHERE(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))

61Creating Complex Predefined Conditions, LOVs, and Joins—Learner’s Guide

Page 76: Bou320 en Col91 Fv Part Ltr

Note: Universe Designer, uses SubAlias_1, and subsequent numbering, to replace the tablenames.

When the end user creates a newWeb Intelligence Rich Client document using Client Name,Sale Date and Sales Revenue in the Result Objects pane, and the new condition in theQueryFilterpane, the end result shows themaximumSaleDate and the corresponding Sales Revenuevalue for each Client Name.

Activity: Creating subqueries in predefined conditions

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 SalesDates subclass, create a newMax SalesDate condition, and add an appropriatedescription.

3. The subquery to insert into the Where field is as follows:SALE.SALE_DATE = ALL(SELECTmax(SALE.SALE_DATE)FROMSALEWHERE(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 newMax 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(SELECTmax( SALE.SALE_DATE )FROM

Advanced Universe Design—Learner’s Guide62

Page 77: Bou320 en Col91 Fv Part Ltr

SALE,CLIENT SubAlias__1WHERE(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 tablesused 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 newMax Sales Date in theQuery Filter pane.

The result now shows themaximumSaleDate 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 combineseveral objects in a report and get the correctmaximumSale Date and Sales Revenue values.

9. Edit the query and add Invoice ID Number,Model and Showroom.

The maximum date and correspondingmeasure and dimension values are correctly shownin the report:

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

63Creating Complex Predefined Conditions, LOVs, and Joins—Learner’s Guide

Page 78: Bou320 en Col91 Fv Part Ltr

11.Run a new query, using Sale Date, Client Name, and Sales Revenue in the Result Objectspane, and the newMax Sales Date for each Client Name condition in theQuery Filterpane.The result now shows the maximum Sale Date and the correct Sales Revenue value perClient Name.

@Prompt scenarios in predefined conditions

In many cases prompts are needed to restrict the data or to make large value objects more userfriendly to work with. For example, a prompt can be used to get an end user to select a valuepattern, rather than having to look for the value in a long list. It is also possible to create an"All Values" option that allows end users to select values from the list or use the all valuesoption.

To create an “ALL Values” prompt in a predefined 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.

5. Insert a new condition using the Insert Condition button on the toolbar, or by selectingInsert ➤ 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 anyeffect it has on queries they make.

8. Enter the condition directly in theWhere field or via the EditWhere Clause box by selectingthe >> 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?

Advanced Universe Design—Learner’s Guide64

Page 79: Bou320 en Col91 Fv Part Ltr

• When the user selects a value from the LOV or enters a value directly in the box, the firstpart of the condition is valid. The second part is not valid at this point. However, due tothe 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 theuse of the OR statement, the condition is always valid (* = *) and all values are returned.

10.Click Parse.

11.ClickOK.

12.Save the changes in the universe.

13.When using the new prompt condition in theQuery Filter pane in a new report, it allowsend users to select one or more values from the list or type * in the Type a value box. Thisreturns all values of the object.

To create a predefined condition that returns a pattern selection

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 selectingInsert ➤ 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 anyeffect it has on queries they make.

8. Enter the condition directly in theWhere field or via the EditWhere Clause box by selectingthe >> button.

9. The syntax to insert is as follows:((TABLENAME.COLUMN_NAME) LIKE(@prompt('message','type',,,)+'%')

10.Click Parse.

11.ClickOK.

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 getusers to select one value or use the pattern, but in reality this does not work out very wellin Web Intelligence Rich Client. It is best to ensure that there is no LOV referenced in the@prompt function syntax.

65Creating Complex Predefined Conditions, LOVs, and Joins—Learner’s Guide

Page 80: Bou320 en Col91 Fv Part Ltr

Activity: Using @prompt in predefined conditions

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 anyeffect it has on queries they make, for example: "Select one or more values from thelist, enter asterisk (*) to return all values."

4. Enter the condition directly in theWhere field or via the EditWhere Clause box by selectingthe >> button.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, andOK.

6. Save changes and create a newWeb Intelligence Rich Client report using Client Name andthe 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 selectmultiple 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. InUniverseDesigner, create a new condition in theClient class, calledClientNamePatternPrompt.

2. In the Description field, enter a help message for users describing the condition and anyeffect it has on queries they make, for example:This prompt allows you to:

• Enter the first letter of the surname.

Advanced Universe Design—Learner’s Guide66

Page 81: Bou320 en Col91 Fv Part Ltr

• Enter one or more starting letters followed by the % sign.

• Enter a pattern like: B%, J%

3. Enter the condition directly in theWhere field or via the EditWhere Clause box by selectingthe >> button.The syntax to insert is as follows:@select(Client\Client Name)LIKE (@prompt('Enter a name pattern','A',,,)+'%')

4. Click Parse andOK.

5. Save the changes and create a newWeb Intelligence Rich Client report usingRegion,ClientName, 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 startingwith "J".

67Creating Complex Predefined Conditions, LOVs, and Joins—Learner’s Guide

Page 82: Bou320 en Col91 Fv Part Ltr

Working with advanced LOVsThis 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

As shown in the predefined conditions unit you can create prompts that allows users to enteran asterisk (*) to return all values. You can alsomodify the LOV to show an "ALL values" entry.When selecting this it will also return the full list of values of the object.

To modify an LOV to have an ALL values entry

1. In Universe Designer, create a new object.

Note: This object only serves as an ALL values object for use in an ALL values promptsyntax.

2. Use the following SELECT syntax for this object:CASE WHEN TABLENAME.COLUMN_NAME = TABLENAME.COLUMN_NAMETHEN 'ALL' ELSE TABLENAME.COLUMN_NAME END

The same TABLENAME.COLUMN_NAME is referenced in all sections of the CASE statement. Thissyntax converts each of the column values to a generic 'ALL' value.

3. Click the Properties tab.

4. Click Edit.

5. In theQuery Panel select theCombineQueries toolbar icon. This generates a second querytab with the UNION symbol.

6. In theQuery 2 tab, remove the newly created ALL values object and drag in the originalobject used in the ALL values prompt.

7. ClickView SQL. The SQL shows the UNION between the ALL values object and the originalprompt object.SELECT DistinctCASE WHEN TABLENAME.COLUMN_NAME = TABLENAME.COLUMN_NAMETHEN 'ALL' ELSE TABLENAME.COLUMN_NAME ENDFROM TABLENAMEUNIONSELECT Distinct TABLENAME.COLUMN_NAMEFROM TABLENAME

8. ClickOK to close the SQL Viewer.

Advanced Universe Design—Learner’s Guide68

Page 83: Bou320 en Col91 Fv Part Ltr

9. Click Run.

10.ClickDisplay. The LOV contains a list of all individual column values and the value 'ALL'.

11.ClickOK twice.

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 valuesobject.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' andthe query returns all object values.

When used in a query, the end user sees the value ALL as part of the LOV of the promptedobject. Selecting this returns all values.

Activity: Modifying LOVs

Objectives

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

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.

69Creating Complex Predefined Conditions, LOVs, and Joins—Learner’s Guide

Page 84: Bou320 en Col91 Fv Part Ltr

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 theQuery Panel select theCombineQueries toolbar icon. This generates a second querytab with the UNION symbol.

9. In theQuery 2 tab, remove the Client_ALL object and drag in the Client Name objectinstead.

10.Click View SQL. The SQL shows the UNION between the Client Name object and theClient_ALL object. ClickOK to close the SQL Viewer.

11.Click Run.

12.ClickDisplay. The LOV now contains a list of all individual client names and the value'ALL'.

13.ClickOK.

14.Select the Export with universe option.

15.ClickOK.

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)

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' andthe 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)

Advanced Universe Design—Learner’s Guide70

Page 85: Bou320 en Col91 Fv Part Ltr

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 theClient ALL values Prompt condition in theQuery Filter pane.

24.Click Run Query.

25.The ALL value now shows up in the available list of values. Select the ALL value and clickthe 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 statementcan also be added directly to the LOV with theDo not regenerate SQL before runningoption ticked.

Arranging LOV data as an A-Z index

Large LOVs can become difficult to navigate through for end users. Use an index to make thelist smaller and easier to navigate.

In Universe Designer, an LOV can be viewed as tabular, or hierarchical. However, thehierarchical option is not available for Web Intelligence or Web Intelligence Rich Client endusers. The same list hierarchy can be achieved in Web Intelligence or Web Intelligence RichClient by using a cascading LOV.

71Creating Complex Predefined Conditions, LOVs, and Joins—Learner’s Guide

Page 86: Bou320 en Col91 Fv Part Ltr

To create an A-Z index in a cascading 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. ClickOK.

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 valuesmenu, followed by the original object.

8. Verify that theHierarchical View check box is selected.

9. ClickGenerate LOVs.As the selected objects may already contains LOVs, a message appears asking whether youwant to overwrite the existing values.

10.ClickOK.

11.Save the changes in the universe.

Advanced Universe Design—Learner’s Guide72

Page 87: Bou320 en Col91 Fv Part Ltr

Activity: Arranging LOVs

Objective

• Create a cascading A-Z index LOV

Instructions

1. Create a new object called First Letter of Manager Lastname in the hidden LOV Objectsclass

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 originalManager object.

5. Verify that theHierarchical 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 theManager LOV using the following steps:• Edit theManager object and select the Properties tab.• Click Edit.• Remove the cascading LOV generated condition.• Click Run to restore the LOV.

73Creating Complex Predefined Conditions, LOVs, and Joins—Learner’s Guide

Page 88: Bou320 en Col91 Fv Part Ltr

Working with advanced join syntaxesThis unit looks at prompts and conditional uses in joins, and how joins can be modified toaccomplish 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

Just as you can use prompts in object definitions and in predefined conditions you can defineprompts in joins. If a prompt has to be applied to all objects for that table you can define aself-referencing join containing a prompt. Sometimes you want a prompt to limit the result setwhen joining two tables.

For instance you want to prompt for selecting a calender range (begin date, end date prompt)when someone wants sales data through time.

By including objects in the query that cause the join to be included into the generated SQL youcan test whether the prompt in the join definition appears and works correctly.

Running the query causes the prompt of the join definition to pop up, just as it would forprompts in objects or predefined conditions.

In the Motors universe, the Sale table contains rows for sales and rental data. Instead of usingself-restricting joins to filter out the data, an @prompt syntax can be placed on the Sale table.This method could eliminate the requirement for aliases and additional contexts.

Advanced Universe Design—Learner’s Guide74

Page 89: Bou320 en Col91 Fv Part Ltr

Note: You cannot use the @select and @where functions in join definitions.

Defining conditional join paths

In some cases designers might want to define conditional joins. Some tables may have severalidentification categories keys for products.

For example, a complex join can be defined between a Product table and the different levels ofcategories.

75Creating Complex Predefined Conditions, LOVs, and Joins—Learner’s Guide

Page 90: Bou320 en Col91 Fv Part Ltr

The prompt gets end users to select the category they need to query on and depending on theselection the CASE statement links the relevant joins.

Note: The above example is not part of the Motors database schema.

Using joins to construct relative date-time objects

Relative date-time objects can be createdusing CASE statements anddatabase date-time functions.

Another way to construct relative date-time objects is to use a separate alias of the fact tableand connect it to a time dimension table with a conditional join. The conditional join acts asthe CASE statement.

For example, an end user wants to create separate measures for the current and the previousyears, but wants to link them to the same time period. The end user wants to display a tablefor January periods over a number of years.

Last YearThis yearPeriod

-161803200701

Advanced Universe Design—Learner’s Guide76

Page 91: Bou320 en Col91 Fv Part Ltr

161803314159200801

314159271803200901

271803141421201001

141421-201101

To achieve this, you need to link the data of 200701 to the month 200801 as the previous year'svalue, which can be done via a conditional join in the universe.

In the Motors universe similar results can be achieved by using the Sale fact table, an alias ofthe Sale fact table, and the Finance_Period time dimension table. The conditional join is placedbetween the alias table and the Finance_Period table. The conditional join uses a database datefunction to extract the year, minus 1 to retrieve the previous year.

Data can, for example, be returned per quarter of the FY04-05 period and per quarter of theprevious FY03-04 period.

77Creating Complex Predefined Conditions, LOVs, and Joins—Learner’s Guide

Page 92: Bou320 en Col91 Fv Part Ltr

The advantage of this solution is that it is an easier method to handle if you want to create ahuge amount of measures for the previous year. Instead of creating several CASE objects, youjust need to create the objects directly based on the new alias, and you only need to create onespecial join condition.

The disadvantage of this method is that you need to have a date dimension table in the schemato make it work correctly. Secondly, by using this method, separate SQL queries need to becarried out which can cause performance issues.

Conditional joins and running calculations

Conditional joins can also be used to create running calculations. When using a fact table anda time dimension table you can create running sum and average calculations, however, theconditional join only works for clearly ordered time criteria.

Advanced Universe Design—Learner’s Guide78

Page 93: Bou320 en Col91 Fv Part Ltr

The disadvantage of this method is that users need to run these running calculation objectstogether with a time dimension to return the correct results. Secondly, the ">=" join has anegative impact on performance for big amounts of data. A real life database fact table normallycontains severalmillion rows of data, and internally the join creates a partial Cartesian product.

Therefore, when having to deal with running calculation requirements, consider the followingalternatives:• Use analytic database functions (Transact_SQL).

Note: These functions can also have a performance impact.

• Ask the ETL person to create extra columns for the running sums and pre-populate them.That saves a lot of complication and is much faster.

• Use report functionalities. At the end of the day, that is what functions like runningsum aredesigned for.

79Creating Complex Predefined Conditions, LOVs, and Joins—Learner’s Guide

Page 94: Bou320 en Col91 Fv Part Ltr

Activity: Using complex joins

Objectives

• Create relative date-time calculations• Create running calculations

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 bemanually createdfor 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, andSALE_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 SALEScontext 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.

TheNew Contextwindow appears, with all joins from the original SALES contextselected.

d. Name the contextSALE_PREVIOUS_YEAR and remove all joins referring to the originalSALE table:CLIENT.CLIENT_ID = SALE.CLIENT_IDSHOWROOM.SHOWROOM_ID = SALE.SHOWROOM_IDSALE.SALE_ID = SALE_MODEL.SALE_IDSALE.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. Ensureall 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 followingobjects:• Sales Total this year:

sum(SALE.SALE_TOTAL)

Note: A Sales Total object, with the same SELECT syntax, already exists in the YTDMeasure Objects class (subclass of Sales). Instead of creating a new object with the same

Advanced Universe Design—Learner’s Guide80

Page 95: Bou320 en Col91 Fv Part Ltr

syntax, you can create a new object in the SalesMAT subclass that references the existingSales Total object using the @select function.@select(YTD Measure Objects\Sales Total)

• Sale Total previous year:sum(SALE_PREVIOUS_YEAR.SALE_TOTAL)

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 aFINANCE_PERIOD_RUNNING_SUM (FINANCE_PERIOD) alias table.

Note: The self-restricting join for the SALE.SALE_TYPE column needs to bemanually createdfor 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, andSALE_MODEL tables.

4. Set the appropriate cardinalities.

81Creating Complex Predefined Conditions, LOVs, and Joins—Learner’s Guide

Page 96: Bou320 en Col91 Fv Part Ltr

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 followingobjects:• Sales Total:

sum(SALE.SALE_TOTAL)

Note: Either use the syntax shown above or use the @select function to reference theexisting Sales Total object in the YTDMeasure 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 theexisting 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 theMonth Number object.

8. Save your changes and test the new objects in Web Intelligence Rich Client.

Run a report with FinancialMonth, Sales Total, Sales Total Running Sum, and Sales TotalRunning Average.

The Sales Total Running Sum column displays a cumulative aggregation of each Sales Totalcell plus the previous period cell value, so the row at Month 02 displays the Sales Total ofMonth 01 + Sales Total of Month 02, the row at Month 03 displays the Sales Total of Month01 + Sales Total of Month 02 + Sales Total of Month 03, and so on. The Sales Total RunningAverage column calculates a cumulative aggregation of each Sales Total cell plus the previousperiod 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:

Advanced Universe Design—Learner’s Guide82

Page 97: Bou320 en Col91 Fv Part Ltr

83Creating Complex Predefined Conditions, LOVs, and Joins—Learner’s Guide

Page 98: Bou320 en Col91 Fv Part Ltr

Quiz: Creating complex predefined conditions and LOVs1. True or false? Using subqueries allows you to use aggregate functions in the WHERE clause.

2. When setting up a predefined condition that returns a pattern,what two important syntaxesare required to achieve this?

3. What functions cannot be used in a join definition?

Advanced Universe Design—Learner’s Guide84

Page 99: Bou320 en Col91 Fv Part Ltr

Lesson summaryAfter completing this lesson, you are now able to:

• Create complex predefined conditions• Work with advanced LOVs• Work with advanced join syntaxes

85Creating Complex Predefined Conditions, LOVs, and Joins—Learner’s Guide

Page 100: Bou320 en Col91 Fv Part Ltr

Advanced Universe Design—Learner’s Guide86

Page 101: Bou320 en Col91 Fv Part Ltr

Lesson 5Securing Universes

Lesson introductionDifferent aspects of universe security can be managed at different levels: in the universeconnection; in the Central Management Server (CMS); and directly at universe level. Universelevel security, in the form of restriction sets, is covered in the BusinessObjects XI 3.0/3.1: UniverseDesign course.

This lesson looks at security at connection and CMS level, combined with the use of universerestriction 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

87Securing Universes—Learner’s Guide

Page 102: Bou320 en Col91 Fv Part Ltr

Defining connection and user credential parametersThe universe connection determines how users connect to the data source and access thedatabase. A number of connection options can be set up to either use an explicit database useraccount or delegate the authentication to user specific credentials. Universe designers cansecure universes by setting different authentication options in the universe connection. Thisunit 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

In BusinessObjects, universe security can be managed at these levels:• Connection credentials and data source

The universe connection determines how users connect to the data source and access thedatabase. Universe designers can secure universes by setting different authentication optionsin the universe connection that corresponds back to security set at data source level.

• Central Management Server

The BusinessObjects system administrator can authorize or deny access to universes storedin 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 restrictviewing, editing, deleting, and other actions in a universe.

• Universe

As universe designer, you can define restrictions for users who are authorized to use auniverse. 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. This unit describes the types of restriction sets you can define ona universe.

User credentials for the connection

In the connection Login Parameters there are three options that can be specified for passinguser credential data through the universe connection.

• Use specified user name and password: The user name and password for the data sourceauthentication are used.

• Use Single Sign-On when refreshing reports at view time:

Advanced Universe Design—Learner’s Guide88

Page 103: Bou320 en Col91 Fv Part Ltr

When selected, the user name and password used to access the CMS are automatically usedas database login parameters. Once users are logged onto BusinessObjects Enterprise, singlesign-on to the database enables them to perform actions that require database access, forexample, viewing and refreshing Web Intelligence documents without having to providetheir logon credentials again.

See the Business Objects Enterprise Administration guide for information on setting SingleSign-On (SSO).

• Use BusinessObjects credential mapping:

The user is prompted for a database user password associated with their BusinessObjectsaccount to refresh a report. This is set using the parameters dbuser and dbpass. These areset at the administrative level. Refer to Business Objects Enterprise Administrator's Guide forinformation on setting up this option.

This option is used in a deployment where each Enterprise user is bound to a Database userto enforce Database security and monitoring on all users.

When this option is selected for a connection, all users in the CMS that need to use thisconnection require having their database user credentials set in the CMS. Those credentialsare known as dbuser and dbpass variables and can also be usedwith the @variable function.

89Securing Universes—Learner’s Guide

Page 104: Bou320 en Col91 Fv Part Ltr

Working with Central Management Server (CMS) universesecurityThe BusinessObjects system administrator can authorize or deny access to universes stored inthe CMS. The administrator can define which universes users are authorized to access, anddepending 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

The Central Management Server (CMS) manages security information, such as user accounts,group memberships, and object rights that define user and group privileges.

When users log on, the CMS coordinates the authentication process with security plug-ins; theCMS then grants the user a logon token and an active session on the system. The CMS alsoresponds to authorization requestsmade by the rest of the system.When a user requests accessto a universe in a particular folder, the CMS authorizes the request only after it verifies theuser's account or group membership has sufficient privileges.

The BusinessObjects system administrator can authorize or deny access to universes stored inthe CMS. The administrator can define which universes users are authorized to access, anddepending on the rights defined for a user group, the administrator can also restrict viewing,editing, deleting, and other actions in a universe.

Note: Formore information on the access levels for users and groups, consult theBusinessObjectsEnterprise Administrator's Guide.

Universes can be separated into folder or category structures instead, to provide a logicalgrouping of universes within one CMS. These folders can be created in Universe Designer orin the Central Management Console.

Instead of denying access per universe file, you can group universes in folders and setappropriate access rights per folder. For example, you need an HR folder in which you havegrouped universes that are only to be accessed by the HR group. Access to the HR universefolder can be set in the Central Management Console.

Advanced Universe Design—Learner’s Guide90

Page 105: Bou320 en Col91 Fv Part Ltr

91Securing Universes—Learner’s Guide

Page 106: Bou320 en Col91 Fv Part Ltr

Working with table mapping in restriction setsAs universe designer, you can define restrictions for userswho 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, andconnection controls. Thesewere covered in theBusinessObjects 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 usetable mapping to substitute one database table for another, and ensure that some users onlyhave 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

Access restrictions that apply to a user or group are defined in a restriction set. You can definemultiple restriction sets for a universe. Restriction sets can be edited, or deleted at any time.

The following types of restrictions can be included in a restriction set:

DescriptionType of restriction

The universe connection to the data source.You can select an alternative connection forthe universe.

Connection

Options to limit the size of the result set andquery execution time.Query controls

Options to control the SQL generated forqueries.SQL generation options

You can apply column-level security.Object access

You can define a WHERE clause that restrictsaccess to row and limits the result setreturned by a query.

Row access

You can replace a table referenced in theuniverse by another table in the database.Alternative table access

Advanced Universe Design—Learner’s Guide92

Page 107: Bou320 en Col91 Fv Part Ltr

How are restriction sets managed?

InUniverseDesigner, youmanage restriction sets using theManageAccess Restrictionsdialogbox, which you access by selecting theManage Security option on the Toolsmenu.

TheAvailable Restrictions pane in the left-hand side of theManageAccess Restrictionsdialogbox lists all the restriction sets currently available to the universe.

The users and groups defined for each restriction set are listed in the Available Groups andUsers pane, in the right-hand side of the dialog box.

You can create, edit, and delete a restriction set at any time once the universe has been exportedto the CMS. You can create multiple restrictions depending on the query needs of a target usergroup.

Working with table mapping

Tablemapping is a security restriction feature that allows the universe to substitute one databasetable for another table when the SQL for an ad-hoc query is written. The table name in the SQLis replaced leaving all of the joins intact.

For example, when an object requires data from the Annual_Figures table, you can apply atable mapping restriction to require specific users to obtain this data from another table, evena table from a different database such as the Annual_Figures_Euro from the MotorsEurodatabase.

Here is the SQL created for a simple query using Showroom and Sales Revenue. The SQL usesthe Annual_Figures table.SELECTSHOWROOM.SHOWROOM_NAME,sum(ANNUAL_FIGURES.ANNUAL_SALE_VALUE)FROMSHOWROOM INNER JOIN ANNUAL_FIGURES ON (SHOWROOM.SHOWROOM_ID=ANNUAL_FIGURES.SHOWROOM_ID)

93Securing Universes—Learner’s Guide

Page 108: Bou320 en Col91 Fv Part Ltr

GROUP BYSHOWROOM.SHOWROOM_NAME

Here is the SQL created for the same simple query after a table mapping restriction has beenapplied. All references to the Annual_Figures table have been replaced with theAnnual_Figures_Euro table.SELECTSHOWROOM.SHOWROOM_NAME,sum(MotorsEURO.dbo.ANNUAL_FIGURES_EURO.ANNUAL_SALE_VALUE)FROMSHOWROOM INNER JOIN MotorsEURO.dbo.ANNUAL_FIGURES_EURO ON (SHOWROOM.SHOWROOM_ID=MotorsEURO.dbo.ANNUAL_FIGURES_EURO.SHOWROOM_ID)GROUP BYSHOWROOM.SHOWROOM_NAME

Note: All database tables in a universe must be on the same RDBMS platform. For example,you cannot include tables from a SQL Server database and an Oracle database in the sameuniverse.

To map one table to another

1. From theToolsmenu, selectManage security..., and then clickManageAccessRestrictions...

Note: If you have not yet exported the universe, a message box appears to indicate that youmust export the universe before you can create security restrictions.

2. TheManage Access Restrictions box displays.

3. In theManage Access Restrictions dialog box, clickNew.

Advanced Universe Design—Learner’s Guide94

Page 109: Bou320 en Col91 Fv Part Ltr

The Edit Restriction Set dialog box displays.

The six tabs in this dialog box allow you to define the type of restriction youwant to includein this restriction set.

Caution: The Reset button at the lower left corner resets every change made in any tab. Itresets all options back to the defaults.

4. In the Restriction Name field, type the name you want to apply to the restriction.

5. In the Edit Restriction dialog box, click the Table Mapping tab.

95Securing Universes—Learner’s Guide

Page 110: Bou320 en Col91 Fv Part Ltr

The Table Mapping tab displays.

In this tab, you can define the replacement of a table referenced by an object in the universeby another table for a specific user or group of users.

6. Click Add in the Table Mapping tab.TheNew Table Mapping dialog box appears.

7. If you know the exact names of the tables, you can type them in the text boxes.Otherwise, use the Select button to select the original and replacement tables.

8. When you have selected the tables, click the Check All button to validate the status of themapping settings.

9. If you have completed your restriction set, clickOK to save the changes, otherwise navigatethe remaining tabs to apply further restrictions.

Activity: Working with table mapping in a restriction set

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 Eurosinstead of US dollars.

Advanced Universe Design—Learner’s Guide96

Page 111: Bou320 en Col91 Fv Part Ltr

In addition you use the table mapping feature in a restriction set to substitute four tables fromthe 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 theManage Access Restrictionsmenu you need to export your universe.A CUID is assigned, when you export your universe, allowing you to apply security to youruniverse file.

4. Go toTools➤Manage Security➤ManageAccess Restrictions and create a tablemappingrestriction set called Sales_Euro.

5. In the Table Mapping tab click Add.

6. In theOriginal Table field selectANNUAL_FIGURES. In the Replacement Table field, selectANNUAL_FIGURES_EURO from the MotorsEURO database and clickOK.Repeat the for the remaining MotorsEURO tables:• QUARTER_FIGURES_EURO• SALE_EURO• MODEL_EURO

7. Select Check All and clickOK.

8. Apply this restriction set to the sales user. Check with the instructor for the exact user nameto 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 ontoWeb Intelligence Rich Clientwith the sales user account. Checkwith the instructorfor 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.

97Securing Universes—Learner’s Guide

Page 112: Bou320 en Col91 Fv Part Ltr

The SALE and SALE_MODEL tables are replaced by the SALE_EURO andMODEL_EUROtables.

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 WebIntelligence Rich Client.

16.Run a query with Showroom and Sales Revenue.View the SQL. TheANNUAL_FIGURES table is replacedby theANNUAL_FIGURES_EUROtable.

Advanced Universe Design—Learner’s Guide98

Page 113: Bou320 en Col91 Fv Part Ltr

Quiz: Securing universes1. Universe security can be managed at which levels?

2. True or False. Instead of denying access per universe file, you can group universes in foldersand set appropriate access rights per folder.

3. True or False. When theUse Single Sign-On when refreshing reports at view time optionis selected for a connection, all users in the CMS that need to use this connectionwill requirehaving their database user credentials set in the CMS.

99Securing Universes—Learner’s Guide

Page 114: Bou320 en Col91 Fv Part Ltr

Lesson summaryAfter 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

Advanced Universe Design—Learner’s Guide100

Page 115: Bou320 en Col91 Fv Part Ltr

Lesson 6Implementing Universe Life Cycle Management

Lesson introductionThis lesson describes how to move content from a development environment to a productionenvironment.

After completing this lesson, you will be able to:

• Move content from development to production

101Implementing Universe Life Cycle Management—Learner’s Guide

Page 116: Bou320 en Col91 Fv Part Ltr

Moving content from development to productionAfter completing this unit, you will be able to:

• Describe life cycle management• Use the Import Wizard• Move content from a development environment to production

Life cycle management

Life cyclemanagement promotes Business Intelligence (BI) content fromdevelopment to qualityassurance, and to production stages.

Manydeployments of BusinessObjects Enterprise contain different stages such as a development,quality assurance, and production within the same version. Reports and other BusinessIntelligence objects often require modification or enhancement as a result of changinginformation needs.

Part of the life cycle management requirement is to be able tomove different subsets of contentat different times through a cycle. For example, a customer can have independent BI applicationsin a shared cluster system, potentially one for a Sales team and one for a HR team, that needto be successfully change-managed at different cycles from one another.

The real challenge of moving content in a life cycle, is not the initial deployment of the codefrom development, quality assurance, and production, but to successfully manage subsequentupdates to content. Content is inter-dependant on one another and you need to successfullyimpact all of the inter-dependant objects when going through a life cycle management.Administrators must control how BI objects are promoted through these stages, whether theobjects are completely new or whether they overwrite or update objects that already exist inthe destination environment.

Component Unique IDs

All objects have a unique ID, called aComponentUnique ID (CUID). This ID retains the uniqueidentity of objects during move, even between clusters. The assigned CUID remains with theobject as it goes through life cycle management stages. A CUID:• Possesses a unique ID in a cluster.• Maintains a unique ID for each InfoObject.

Note: Each BI object is stored in the CMS as an InfoObject. InfoObjects are systemmetadataobjects that contain index information, and the actual documents or objects are stored in afile store.

• Permits object changes, location changes, and even name changes without breakingdependencies.

For example, a report can be renamed, moved to a different folder, and can use a differentlocale setting that affects the names of the objects. None of these actions affects the assignedCUID.

Advanced Universe Design—Learner’s Guide102

Page 117: Bou320 en Col91 Fv Part Ltr

Also, if you modify the name and contents of several classes within a single universe thatmultiple reports are dependent on, you canmove the changeduniverse into production togetherwith all dependant reports.

Using the Import Wizard

BusinessObjects XI 3.0/3.1 imports most of the source environment using a single tool calledthe Import Wizard. The Import Wizard is a locally installed Windows application that allowsyou to importmost objects in the repository (including user accounts, groups, folders, universes,documents, and objects stored in Inbox and personal folders on a cluster server) to the newBusinessObjects Enterprise system.

The ImportWizard acts as a bridge between the source repository and target repository, or theCMS database. It can promote content between clusters on the same network (LAN or WAN).

In addition to importing objects from previous versions to XI 3.0/3.1, the Import Wizard alsoenables you to manage the life cycle of a deployment by moving assets from one XI 3.0/3.1deployment to another XI 3.0/3.1 deployment. This allows you to modify and enhance reportsand other objects on a development environment, and thenpromote those objects to a productionenvironment.

The Import Wizard:• Acts as a migration tool.• Imports content from the source repository.• Updates content (for example, universe IDs).• Exports content to the target repository and physical storage area.

The ImportWizard provides a series of screens that guide you through the process of importingand exporting Business Intelligence content such as user accounts, groups, folders, reports,universes, security, servers, and other objects. Various dialog boxes may appear depending onthe source environment and the types of information that you choose to import.

You can use the Import Wizard to import content from BusinessObjects, Crystal Enterprise, orBusinessObjects Enterprise into your current BusinessObjects Enterprise deployment. You canalso export content from a BusinessObjects Enterprise XI 3.0/3.1 deployment to a BusinessIntelligence Archive Resource (BIAR) file, or import content from a BIAR file to yourBusinessObjects Enterprise XI 3.0/3.1 deployment.

An important consideration in life cycle management within the same version, is how theobjects exist in the new environment. Are the promoted objects completely new objects in thenew environment, or do the promoted objects overwrite similarly named objects in the newenvironment, or do the promoted objects simply update existing objects in the newenvironment?

Import Wizard retains object links, original CUID and handles all dependencies, when youmove from development to production. For example, if you select a set of three reports, theImport Wizard automatically searches for the interlinked dependencies, and includes all thesubfolders the reports are in, the universewhere they are based on and the universe connection.

103Implementing Universe Life Cycle Management—Learner’s Guide

Page 118: Bou320 en Col91 Fv Part Ltr

In BusinessObjects Enterprise XI 3.0/3.1 there are new import scenario options, and a featurecalled incremental importing, which greatly enhance the administrators choices for contentpromotion.

Import scenarios

When using the Import Wizard to promote an object from one BusinessObjects Enterprise XI3.0/3.1 deployment to another, the wizard allows you to use either the objects CUID or itsname 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 alreadyexists on the destination environment.

When you are matching objects by CUID, and the Import Wizard finds a matching object onthe destination environment, you have three options:

DescriptionScenario option

If the Import Wizard finds an object in thedestination environment with the sameCUID, it updates the destination's object.Update the destination. In case of name

conflict, rename the object. If the Import Wizard does not find an objectin the destination environmentwith the sameCUID, but it finds an object with the same

Advanced Universe Design—Learner’s Guide104

Page 119: Bou320 en Col91 Fv Part Ltr

DescriptionScenario option

name, it imports the object from the sourceenvironment and then renames that object.

If the Import Wizard finds an object in thedestination environment with the sameCUID, it updates the destination's object.

Update the object. In case of name conflict,do not import it. If the Import Wizard finds an object on the

destination environmentwith the samenamebut different CUID, it does not import theobject from the source environment.

If Import Wizard finds an object on thedestination environment with the sameCUID, it does not import the object.

Do not import the object.

When you are matching objects by name and path, and the Import Wizard finds a matchingobject on the destination environment, you have three options:

DescriptionScenario option

If ImportWizard finds that an object alreadyexists on the destination environment withKeep the destination object and import a

renamed copy of the object. the same name and path, it imports thesource's object and renames it.

If ImportWizard finds that an object alreadyexists on the destination environment with

Update the destination object. the same name and path, it updates thedestination environment's version with thesource's.

If ImportWizard finds that an object alreadyexists on the destination environment withDo not import the object. the same name and path, it does not importthe source's version.

Note: Matching objects by name and path is not an option when importing content from aBIAR file. When you import from Business Intelligence Archive Resource (BIAR) files, objectsare matched by CUID.

105Implementing Universe Life Cycle Management—Learner’s Guide

Page 120: Bou320 en Col91 Fv Part Ltr

Incremental import

By default, the Import Wizard automatically imports dependent objects. For example, whenyou import report objects, the Import Wizard also imports the universes and universeconnections that the reports use.

If you are updating objects that already exist on the destination environment, the Incrementalimport screen appears. This screen prompts you to specify what type of objects and rights towant to overwrite on the destination environmentwith the objects from the source environment,when there is a match found. These options are safeguards that override what you selected onthe Import scenarios screen.

The Incremental import screen allows you to import objects without overwriting dependentobjects that already exist on the destination environment. If you want to import report objectswithout importing a universe or connection that would overwrite a universe or connection onthe destination environment, you can specify this on the Incremental import screen.

Note: An object refers to any type of object except universes, universe connections, and groups.

Advanced Universe Design—Learner’s Guide106

Page 121: Bou320 en Col91 Fv Part Ltr

Universes and universe connections

When you import a universe the Import Wizard imports any associated connection objects.The connection is saved in the File Repository Server (FRS) and an InfoObject is created in theCMS. The universe and its linked documents are copied into the FRS.

The Import Wizard has three modes for importing universes:

What it doesMode

Imports all universes and all connectionobjects. You cannot select individualuniverses or connections.

Import all universes and all connectionobjects.

Imports all universes, and only connectionobjects used by those universes.

Import all universes and only connectionobjects used by these universes.

Imports all universes and connections usedby the selected documents. This option alsoImport the universes and connections that

the selected Web Intelligence andBusinessObjects documents use directly.

enables you to select additional universes toimport, even if they are not used by anydocument.

107Implementing Universe Life Cycle Management—Learner’s Guide

Page 122: Bou320 en Col91 Fv Part Ltr

If you selected the third option, you are asked to choose which universes you want to move toproduction.

The eFashion and Island Resort Marketing check boxes are grayed out. The import wizardselected these two universes by default, as certain reports use it. Additional universes can beselected, or if you select aWeb Intelligence document to import, the ImportWizard automaticallyselects the associated universes for import.

If a universe is a derived universe, then all relevant core universes and their connections arealso imported.

Working with Business Intelligence Archive Resource (BIAR) files

Using the ImportWizard, content can bemoved directly from source CMS to destination CMS.You can also export content from a BusinessObjects Enterprise deployment to a BusinessIntelligence Archive Resource (BIAR) file. The Import Wizard lets you to backup your sourceCMS content to a Business Intelligence Archive Resource (BIAR) file, and then use that BIARfile to import this data into the destination server.

What is a BIAR file?

Business Intelligence Archive Resource (BIAR) files are a packaging tool for managed contentin a BusinessObjects Enterprise system. They can be used to archive folders and objects in theEnterprise repository so that they can be easily transferred to a different location. This is usefulfor making a system backup, and moving BI applications from a development environment toa production environment.

Advanced Universe Design—Learner’s Guide108

Page 123: Bou320 en Col91 Fv Part Ltr

BIAR files can be used to export BI object content to XML for deployments without networkaccess to the source repository. This can help customers that have stringent firewall requirementsaround their different development and production deployments, or customers that haveseparate geographic deployments that do not have connectivity between them.

By using a BIAR file, there is no direct contact from one environment to another, and it canhelp efficiently propagate incremental moves from development to quality assurance, toproduction.

Note: This requires additional steps to move between environments, and BIAR files can belarge.

XML files

Essentially the BIAR file is a binary zip file that contains a collection of XML files for individualdocuments and universes. Every BIAR file has at least one single specific XML file(BusinessObjects.xml) that acts as the root deployment descriptor. This file tells the deploymentengine in what order to deploy the object so that the dependency and security model can bedeployed correctly.

For example, connection objects must be created with the correct CUID before universes canrefer to them, anduniversesmust be deployedwith the correct CUIDbefore reports can referencethem.

Version Control

Using the BIAR file method also provides a file based archive that can be placed in version, orsource control system.

Universes and reports have an individual XML file representation in the BIAR file, allowingfor version control.

For example, the content creator creates a set of reports and a universe that are tested in thedevelopment system. When the development tests are complete, the reports and universe areexported to a BIAR file. The tester that has direct access to the QA staging area checks in theBIAR file directly, or unzips the BIAR file to a specific folder structure.

Note: A BIAR file is a standard zip file and can be unzipped accordingly; it acts similar to aWAR or JAR file.

Individual documents and universes can be checked in and out of this structure in a granularfashion. Testers can change the label in the Version Control System to "ready for production"after testing, and the administrator can import the BIAR into the production area.

This can be useful in an environment where deployment to quality assurance, to productionis done by different people with different security rights, andwhere there is a requirement thatcode comes through a version control system prior to going into production. Using the BIARfile functionality in this way can provide an audit history of who changed what and when.

Universes and report dependencies in the BIAR file can be granularly, and individually versioncontrolled in your choice of VersionControl Systems, for example Perforce, PVCS, or SourceSafe.

109Implementing Universe Life Cycle Management—Learner’s Guide

Page 124: Bou320 en Col91 Fv Part Ltr

To export data to a BIAR file

1. Start the Import Wizard. Select Start ➤ Programs ➤ BusinessObjects XI 3.0/3.1 ➤

BusinessObjects Enterprise ➤ Import Wizard.

2. Specify the BusinessObjects Enterprise XI 3.0/3.1 system as the source environment.Enter the name of the CMS and user authentication.

3. ClickNext.

4. Specify Business Intelligence Archive Resource (BIAR) File as the destination environment.

5. Type in the location and BIAR file name in the BIAR file box. Alternatively select the ellipsebutton to browse to a location, and enter the name of the BIAR file.

6. ClickNext.

7. Specify the objects that youwish to copy from the test environment to production. By defaultall objects are selected.Each selected option is presented in a later wizard screen. For example, when you select"Import folders and objects" in this step, you are later able to refine your selection to justcertain folders or reports.

Note: When using a BIAR file as a destination, your selected options are stored into the file,and can be later imported into production.

8. Follow the wizard instructions, making the required selections, and clickNext until theReady to Import screen appears.

Advanced Universe Design—Learner’s Guide110

Page 125: Bou320 en Col91 Fv Part Ltr

9. The wizard provides a summary of the elements you intend to import to the BIAR file. Ifthese settings appear correct, click Finish to generate the BIAR file. If your selections appearincorrect, click Back to modify your selections.The Import Progress screen appears. After the import is complete, the dialog box displaysa summary of the import.

10.ClickDone to close the Import Wizard.

To import data from a BIAR file into the destination CMS

1. Start the Import Wizard. Select Start ➤ Programs ➤ BusinessObjects XI 3.0/3.1 ➤

BusinessObjects Enterprise ➤ Import Wizard.

2. Specify Business Intelligence Archive Resource (BIAR) File as the source environment.Click the ellipse button to browse to the location of the BIAR file and clickOpen.

3. ClickNext.

4. Specify the BusinessObjects Enterprise XI 3.0/3.1 system as the destination environment.Enter the name of the CMS and user authentication.

5. ClickNext.

6. Specify the objects that you wish to copy from the test environment to production.Understand that the Import Wizard does not first read the contents of the BIAR file andthen ask you the appropriate options. So, for example, if your BIAR file only contains oneuniverse, you are still prompted to choose whether or not and which users you want toimport.

7. Follow the wizard instructions, making the required selections, and clickNext until theReady to Import screen appears.

8. Thewizard provides a summary of the elements you intend to import to the BIAR file. ClickFinish.The Import Progress screen appears. After the import is complete, the dialog box displaysa summary of the import.

9. ClickDone to close the Import Wizard.

To promote universes and universe connections from adevelopment environment to a production environment

This scenario describes promoting universe objects from one BusinessObjects Enterprise XI3.0/3.1 deployment to another XI 3.0/3.1 deployment.

By default, the Import Wizard imports any universe connections that the universes that youselected rely on. If you want to promote a universe to the destination, and do not want tooverwrite the universe connection on the destination environment, ensure that you clear theOverwrite connection contents checkbox on the Incremental import screen.

111Implementing Universe Life Cycle Management—Learner’s Guide

Page 126: Bou320 en Col91 Fv Part Ltr

1. Start the Import Wizard. Select Start ➤ Programs ➤ BusinessObjects XI 3.0/3.1 ➤

BusinessObjects Enterprise ➤ Import Wizard.

2. Specify the source and destination environments.

3. On the Select objects to import screen, select Import universes.

4. On the Import scenario screen, specify whether you want to match by CUID or name andpath, and what you want the Import Wizard to do if it finds an object that already exists onthe destination environment.

5. On the Increment import screen:a. If you want to update a universe that already exists on the destination environment,

select theOverwrite universe contents check box.b. Specify whether you want to overwrite the universe connections on the destination. If

you want to update universe connections that already exist on the destinationenvironment, select theOverwrite connection contents check box.

c. To ensure that you don't overwrite any objects or object rights, clear theOverwrite objectcontents andOverwrite object rights check boxes.

d. If theOverwrite group and usermembership check box appears, ensure that it is cleared.e. ClickNext to continue.

6. On the Import options for universes and connections screen, select Import all universesand only connection objects used by these universes.

7. Complete the import process.

The Import Wizard imports the universes that you selected to the destination environment. Ifyou choose to not overwrite universes connections, the connections that the selected universesrely on are not imported, and the universe connections that exist on the destination environmentare not touched. The relationships between the universes and the universe connections aremaintained.

Using test folders

In previous versions of BusinessObjects, an administrator was able to create separate domainsfor development, quality assurance, and production. Domains could be located on differentrepository systems. The XI architecture no longer workswith the concept of universe domains.Universes can be separated into folder or category structures instead, to provide a logicalgrouping of universes within one CMS.

Folders are a lower-cost alternative tomultiple CMSdeployments, but using the folder structuremethod does have its limitations, and is not widely seen as a best practice.

Lets take the following scenario. The Motors universe has been saved and exported to adevelopment folder: \Development\Motors.unv. A number of reports have been created basedon theMotors universe in the Development folder. When development of theMotors universeis complete, the designer moves the universe to production: \Production\Motors.unv.

Advanced Universe Design—Learner’s Guide112

Page 127: Bou320 en Col91 Fv Part Ltr

When a user accesses a report, the document looks for the correct data provider using a uniqueID assigned to the universe. It looks for the universe initially stored in the Development folder.If the users do not have access to the Development folder, but do have access to the Productionfolder, then the universe from the Production folder is used. They can edit and refresh thereport.

It is important to ensure that the designer moves, not copies, the universe from developmentto production. Copying a universe provides it with its own CUID, and produces two differentversions of the universe in production and development. Reports created against thedevelopment universe can not be refreshed against the production universe. The end usermayreceive an error message.

Use test folders only if:

• It is not possible to implement multiple CMS environments.• Security to universes is applied at folder level rather than per individual universe file.

Life cycle management recommendations

Recommended industry best practices are to use separate repositories and servers fordevelopment, quality assurance, and production systems.

If youwant to retain the CUIDs and have separation between development, quality assurance,and production, each have to use separate repositories. This is due to the rule that there canonly be a single instance of an object with its CUID in a repository at one time. This way youcannot have development, quality assurance, and production in the same repository with thesame CUID in different locations.

Separate servers are also recommended as life cycle management is not only based on changesin the BI content, but also relates to changes in the O/S, security patches, and other servermaintenance changes that have to be tested prior to going into production.

113Implementing Universe Life Cycle Management—Learner’s Guide

Page 128: Bou320 en Col91 Fv Part Ltr

Use the BIAR file to move all, or incremental loads from one environment to another.

Activity: Moving content from development to production

Objective

• Use test folders

Instructions

Create two new folders: Development and Production. Folders can be created directly inUniverse Designer, as well as in the Central Management Console. In this activity the foldersare created in Universe Designer.

Create a Web Intelligence Rich Client report based on your Motors universe and explore whathappens when the universe is moved and/or copied from the development folder to theproduction folder.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 Universemenu click Browse.

4. Right-click the folder specified by the instructor and selectNew Folder.Name the folder Development_xx, where "xx" stands for your initials.

5. Select your newDevelopment folder and clickOK twice to export your Motors universeto this new folder.As your universe was exported in the previous activity, a warning message appears.

6. SelectMove 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 theexact user name to use.

8. Create a newWeb Intelligence Rich Client document using yourMotors universe fromyourDevelopment 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 intoUniverseDesignerwith the login name used throughout the course (the same loginname used in step 1), and import your Motors universe from yourDevelopment folder.

12.Click File ➤ Export.

13.In the Export Universemenu click Browse.

14.Right-click the folder specified by the instructor (same location used to create theDevelopment_xx folder) and selectNew Folder.

15.Name the folder Production_xx, where "xx" stands for your initials.

Advanced Universe Design—Learner’s Guide114

Page 129: Bou320 en Col91 Fv Part Ltr

16.Export your universe to your new Production folder.A warning message appears.

17.SelectMove 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 theexact 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 reportcan refresh correctly.

20.Log intoUniverseDesignerwith the login name used throughout the course (the same loginname used in step 1 and step 6), and export your universe to yourDevelopment folder.

21.Select the Copy option.The original version of your Motors universe file remains in your Production folder, and acopy of the same universe is created in yourDevelopment folder.

22.Import your Motors universe from your Production folder.

23.Click File ➤ Export.

24.In the Export Universemenu click Browse.

25.Export yourMotors universe file (previously located in your Production folder) to the folderlocation specified by the instructor.

Note: The location the original Motors universe is now exported and is not accessible tothe sales user.

26.Log into Web Intelligence Rich Client with the sales user. Check with the instructor for theexact 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. Thereport can not be refreshed against this universe, and the test sales user has no access to theother universe location.

115Implementing Universe Life Cycle Management—Learner’s Guide

Page 130: Bou320 en Col91 Fv Part Ltr

Quiz: Implementing universe life cycle management1. True or False. When importing documents from a BIAR file, both the universe name and

path are used for finding dependent documents.

2. True or False. The Import Wizard acts as a bridge between the source repository and targetrepository, or the CMS database. It can promote content between clusters on the samenetwork (LAN or WAN).

3. True or False.When using the ImportWizard to promote an object fromone BusinessObjectsEnterprise XI 3.0/3.1 deployment to another, the wizard allows you to use either the objectsCUID or its name and path to determinewhether the object already exists on the destinationenvironment. It also lets you specify what you want the wizard to do when it finds that anobject already exists on the destination environment.

Advanced Universe Design—Learner’s Guide116

Page 131: Bou320 en Col91 Fv Part Ltr

Lesson summaryAfter completing this lesson, you are now able to:

• Move content from development to production

117Implementing Universe Life Cycle Management—Learner’s Guide

Page 132: Bou320 en Col91 Fv Part Ltr

Advanced Universe Design—Learner’s Guide118

Page 133: Bou320 en Col91 Fv Part Ltr

Lesson 7Maintaining and Optimizing Universes

Lesson introductionAfter you have completed the universe and then deployed it to the end-user population inyour organization for report creation, youmustmaintain the universe to ensure that it continuesto function correctly and provide the reports with accurate results.

As a designer you can apply several parameters that are universe based or data access specificin 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

119Maintaining and Optimizing Universes—Learner’s Guide

Page 134: Bou320 en Col91 Fv Part Ltr

Optimizing universesAs a designer you can apply several parameters that are universe based or data access specificin 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 specificparameters when creating a new universe or via File ➤ Parametersmenu.

This unit looks at a more in depth insight into the parameters that can be set in the UniverseParameters ➤ Parametersmenu, together with a look at other performance enhancingparameters 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

Data access ismanaged by the Connection Server. TheConnection Server is the BusinessObjectsconnection engine that creates and manages connections used by universes between BusinessObjects data access drivers and the target RDBMS middleware.

The Connection Server libraries are present on the Web Intelligence Report Server, DesktopIntelligence Report Server, andWeb Intelligence Job Serverwhich allow these services to querythe database directly without communicating with the Connection Server service.

The Connection Server and the required data access components are automatically installedwhen you install BusinessObjects products.

Data access drivers (<driver>.stg, <driver>.sbo, <driver>.prm, <driver>.cod) can be foundin the installation directory:

C\Program Files\Business Objects\BusinessObjects Enterprise

12.0\win32_x86\dataAccess\connectionsServer\<RDBMS>

Note: Refer to the BusinessObjects XI 3.0/3.1 Designer 's Guide and the for more information onthe individual data access files (<driver>.stg, <driver>.sbo, <driver>.prm, <driver>.cod).

The CS.CFG file

Using the cs.cfg file you can set trace parameters that allow the recording of connection activitythrough the Connection Server in log files.

The cs.cfg file is a data access general configuration file in XML format that contains defaultconfiguration parameters that apply to all data access drivers. The cs.cfg file is stored at theroot level for the Connection Server:

C\Program Files\Business Objects\BusinessObjects Enterprise

12.0\win32_x86\dataAccess\connectionsServer

Advanced Universe Design—Learner’s Guide120

Page 135: Bou320 en Col91 Fv Part Ltr

Note: The cs.cfg file is an XML file. The Document Type Definition (DTD) file that relates toeach element used in the cs.cfg file is in the same directory. Ensure that, when editing and/ormodifying the XML file, the cs.dtd is available.

Setting up a trace file

The BO_trace.ini file is the core trace file that defines how the trace is generated and whichlevel is required. Thus, using this file is mandatory to get any trace files, including SQL traces.

The BO_trace.ini file can be located in: C\Program Files\Business Objects\BusinessObjectsEnterprise 12.0\win32_x86\scripts.

For the purposes of generating the SQL trace, the BO_trace.ini file should consist of theseparameters:active = true;importance = '<<';size = 10000;keep = true;

• >> and >= does not capture any SELECT statements.• == and <= does capture SELECT statements to data source only (universe connection).• << captures everything, including SQL communication with the CMS.

To trace the full-client BusinessObjects products

Follow these steps to get a SQL trace from full-client BusinessObjects applications, like UniverseDesigner, Desktop Intelligence, and Web Intelligence Rich Client:1. Set the System Environment variables.

Go to Control Panel ➤ System ➤ Advanced ➤ Environment Variables and click on theNew button to create a new system variable. You need to repeat this three times, once foreach of the following variables:• BO_TRACE_CONFIGDIR is the path of the folder containing the bo_trace.ini file• BO_TRACE_CONFIGFILE is the complete path of the bo_trace.ini file• BO_TRACE_LOGDIR is the path of the folder where the log files are saved

For example:

Variable ValueVariable Name

C:\BO_TRACE_CONFIGDIR

C:\BO_trace.iniBO_TRACE_CONFIGFILE

C:\BO_TRACE_LOGDIR

2. Open the cs.cfg file in an XML editor. The cs.cfg file is located in C\Program

Files\Business Objects\BusinessObjects Enterprise

12.0\win32_x86\dataAccess\connectionsServer.

121Maintaining and Optimizing Universes—Learner’s Guide

Page 136: Bou320 en Col91 Fv Part Ltr

3. Navigate to the <Traces> XML element and set <Traces ClassID="csTRACELOG" Active>equal to Yes.

Note: You can specify a subset of access drivers that you want to trace. BusinessObjectsallows you to filter the SQL statements according to the database type you want to trace.

In the following example, Oracle, Teradata, and ODBC access drivers are traced:<Traces ClassID="csTRACELOG" Active="Yes"> <Trace Name="MiddleWare" Active="Yes"> <Trace Name="Oracle" Active="Yes"/> <Trace Name="Sybase" Active="No"/> <Trace Name="Informix" Active="No"/> <Trace Name="Teradata" Active="Yes"/> <Trace Name="DB2" Active="No"/> <Trace Name="DB2/iSeries" Active="No"/> <Trace Name="ODBC2" Active="Yes"/> <Trace Name="ODBC3" Active="Yes"/> <Trace Name="OLEDB" Active="No"/> </Trace></Traces>

4. Save the changes. Click Save.

5. Restart the services in the Central Configuration Manager (CCM).

When now launching a BusinessObjects client module, you generate a log file that containsinformation regarding internal functions, and all of the SQL statements that are going to thedatabase.

The SQL statements are inserted into the client log file itself.

Connection configuration parameters

When creating or editing a new connection you can set certain parameters to optimize theconnection against the database in use. Query time can often be shortened by optimizing auniverse. The connection configuration page contains parameters used to optimize a universe:• Defining the duration of a connection into a pool.• Defining howBusinessObjects products respondwhen database resources are not available.• Defining the size of the array fetch.

You can set the following configuration parameters:• Connection pool mode.• Array fetch size.• Array bind size.• Login time-out.

Connection pool mode

There are three connection pool mode options:

Advanced Universe Design—Learner’s Guide122

Page 137: Bou320 en Col91 Fv Part Ltr

DescriptionPool mode option

Check this box if you want your connection to disconnectimmediately after the transaction is completed. Users have toreconnect each time they want to access data.

Disconnect after eachtransaction

Check this box if you want your connection to stay active for adefined period of time. Youmust also enter a value for the numberof minutes. This is the default Pool timeout value.

Keep the connectionactive for

Check this box if you want your connection to stay active duringthe entire session of the product. The connection ends when theuser exits the application.

Keep the connectionactive during thewholesession (local modeonly)

If you select Keep the pool active for in the previous field, thisparameter specifies the length of time to keep the connection open.Pool timeout

Array fetch size

Specifies the maximum number of rows authorized with each fetch.

If you enter 20, and your query retrieves 100 rows, the connection executes 5 fetches to retrieveyour data. Five fetches of 20 rows each equals 100 rows of data.

If you enter 1, the array fetch is deactivated and data is retrieved row by row.

Note: Deactivating array fetch is the safestway of retrieving your data but row-by-row retrievalslows down server performance. The greater the value in theArray fetch size option, the fasteryour rows are retrieved; youmust, however, ensure you have adequate client systemmemory.

Note: If a query retrieves data containing blob or long text types, the array fetch is automaticallyreset to 1. The default value is 20.

Array bind size

Specifies the size of the bind array that the Connection Server uses before sending to therepository. The bind array is the area in memory where the Connection Server stores a batchof data to be loaded (sent to the repository). When the bind array fills, it is transmitted to thedatabase. Generally, the larger the bind array, themore rows (n) can be loaded in one operation,and the better your performance.

Login time-out

Specifies the number of seconds that must be spent to establish a connection before an errormessage is displayed.

123Maintaining and Optimizing Universes—Learner’s Guide

Page 138: Bou320 en Col91 Fv Part Ltr

Custom connection parameters

You can also add custom connection parameters in the Custom Parametersmenu. Theseparameters should only be modified by an advanced user, DBA, or BusinessObjectsadministrator.

The Custom Parametersmenu contains certain parameters that can be used to overrideconnection settings. Parameters set in this menu are database specific. The following outlinesa few parameters options that can be set:• ConnectInit

• Hint

ConnectInit

This parameter is used to declare database specific session statements when the connection isestablished. These statements are not parsed and should therefore be carefully set.

The syntax is defined in the universe Custom Parametersmenu.

An example Oracle database syntax is shown below:ConnectInit ALTER SESSION SET CURRENT_SCHEMA = @variable('BOUSER')

It can also be used with Informix Dynamic Server to add SQL statements to a connection thatare executed once the connection is opened. For example:ConnectInit SET PDQPRIORITY HIGH

For Informix Dynamic Server, the PDQPRIORITY environment variable determines the degreeof parallelism that the database server uses and affects how the database server allocatesresources, including memory, processors, and disk reads.ConnectInit = SET OPTIMIZATION FIRST ROWS

The ConnectInit parameter can be useful for:• Auditing:

Using the ConnectInit parameter, it is possible to send commands to the database whenopening a session. This can be used to set database-specific parameters used for auditingpurposes, as you can monitor the session_id and user that is accessing the universe. Forexample you can use a parameter like:ConnectInit = Begin DBMS_SESSION.SET_IDENTIFYER('@variable('BOUSER')');COMMIT;END;

For auditing purposes, you can set the following variables:• BO username: @variable('BOUSER')• Universe name: @variable('UNVNAME')• Document name: @variable('DOCNAME')• Data provider name: @variable('DPNAME')• Data provider type: @variable('DPTYPE')

• Query Banding:

SomeRelational DatabaseManagement Systems (Teradata for example) can provide a queryband (like banding a bird to track its flight path) with each query. The band can contain any

Advanced Universe Design—Learner’s Guide124

Page 139: Bou320 en Col91 Fv Part Ltr

number of attributes and values that provide detailed information about the query andmaybe referenced by workload management rules during the query classification phase.

Query banding is especially valuable for applications that sendwork throughpooled sessions,such as traditional session pool applications, analytic applications using pooled sessions,business intelligence (BI) tools and newWeb service applications. You can use query bandingto aqcuire information useful for workload management or tracking the use of the datawarehouse.

• Setting session specific database parameters:

Depending on the RDBMS used you can set session specific database parameters. Forexample, with Informix Dynamic Server, you can use the SET Database Object Modestatement to change the filtering mode of constraints of unique indexes, or to enable ordisable constraints, indexes, and triggers.

• Enforcing Oracle Virtual Private Database:

Oracle Virtual Private Database enforces security, to a fine level of granularity, directly ondatabase tables, views, or synonyms. Because you attach security policies directly to thesedatabase objects, and the policies are automatically applied whenever a user accesses data,there is no way to bypass security. Using the ConnectInit parameter, you can specify thenumber of seconds that must be spent to establish a connection before an error message isdisplayed.

Hint (Oracle only)

Ahint is commented information that is embedded in a query, and used by theOracle optimizerto choose an execution plan. You should consult yourOracle documentation for full informationon the Hints that can be used, and how they can be used to optimize queries.

You enter the value for a Hint as a comment. A plus sign is used at the beginning, immediatelyafter the comment delimiter, with no space between the comment delimiter and the plus sign:/*+ <hint> */

Some useful hints that you can use are as follows. Consult your Oracle documentation for afull list:

What it does...Hint

Optimizes response time.FIRST_ROWS

Use rule-based optimization and not cost.RULE

Performs a full table scan on the table.FULL

Scans table by rowid.ROWID

125Maintaining and Optimizing Universes—Learner’s Guide

Page 140: Bou320 en Col91 Fv Part Ltr

What it does...Hint

Perform a fast full scan on the index rather than on thetable.

INDEX_FFS

An example of the FIRST_ROWS parameter is outlined below:1. On the Custom Parameters page, click Hints.

2. Type /* + FIRST_ROWS */ in the values box, and click Finish.

3. The SQL generated in the client tool looks similar to this:SELECT /* + FIRST_ROWS */CLIENT.CLIENT_IDFROMCLIENT

Dynamic SQL parameters

Each data access driver is associated with a SQL parameters file (<driver>.prm). This PRM filecontains default SQL parameters used for query generation, date and other operators, andfunctions. As the PRM file is associated with the data access driver, all parameters set in the<driver>.prm file affect all universes through their middleware connection.

The PRM file is still used for many RDBMS specific SQL and connection parameters, however,SQL parameters common across RDBMS are now modified within an individual universe.These parameters apply only to the current universe, so universes using the same data accessdriver can have different SQL generation behavior.

These dynamic SQL parameters are saved in the .unv file, and are accessible only from theuniverse.

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.

To edit a dynamic SQL parameter

1. Open your universe in Universe Designer.

2. Select File ➤ Parameters ➤ Parameter from the toolbar menu.The Parameter dialog box opens showing the SQL parameters.

3. Select the appropriate parameter to edit.

The selected parameter is displayed in the PropertyName field togetherwith the parameterdefault value in the Value field.

4. Change the value as required and click Replace to apply the changes.

5. ClickOK to close the Parameter dialog box.

Advanced Universe Design—Learner’s Guide126

Page 141: Bou320 en Col91 Fv Part Ltr

Adapting dynamic SQL parameters

This section looks at some of the more common dynamic SQL parameters used and howchanging their default values can influence the BusinessObjects interface and behavior.• BEGIN_SQL

• END_SQL

• ANSI92 and FILTER_IN_FROM

• JOIN_BY_SQL

BEGIN_SQL

SQL statements can be prefixed with the BEGIN_SQL parameter. The BEGIN_SQL parameter canbe configured to insert SQL orders that are executed before BusinessObjects-generated SQLstatements. This ensures that the orders are executed before all generated SQL statements.

This function works with any database that supports passing parameters before the SELECTstatement.

The following are some examples of use:• Terradata: The BEGIN_SQL parameter can be used to monitor and manage database usage

based on query origin details provided within the executed SQL.• Oracle: The BEGIN_SQL parameter can be used to turn on read-only transactions.• Netezza: The BEGIN_SQL parameter can be used to trigger optimization options.

END_SQL

The End_SQL parameter is used to append a string to the SQL sent to the database each time aquery is run. This parameter is useful for query banding and auditing.

DBAs often need to monitor query usage. The End_SQL parameter allows designers to inputvariables.

By using a parameter like @variable('BOUSER'), the DBA can clearly see who sent the querywith what results.

This can aid system optimization, and can also be useful in a situation where a long runningquery must be terminated, or when the system has to be stopped for maintenance reasons.

Variables that can be used are:

• BO username: @variable('BOUSER')• Universe name: @variable('UNVNAME')• Document name: @variable('DOCNAME')• Data provider name: @variable('DPNAME')• Data provider type: @variable('DPTYPE')

127Maintaining and Optimizing Universes—Learner’s Guide

Page 142: Bou320 en Col91 Fv Part Ltr

ANSI92 and FILTER_IN_FROM

If a query uses a condition object or a quick filter the selected values for this restriction are stilldisplayed in the WHERE clause.

In the example below a filter on Region is placed in the query, and the SQL is generated as:SELECT CLIENT.CLIENT_LASTNAME + ', ' + CLIENT.CLIENT_FIRSTNAME, REGION.REGION_NAME, count(CLIENT.CLIENT_ID)FROM CLIENT INNER JOIN REGION ON (REGION.REGION_ID=CLIENT.REGION_ID)WHERE REGION.REGION_NAME In ('East','North')GROUP BY CLIENT.CLIENT_LASTNAME + ', ' + CLIENT.CLIENT_FIRSTNAME, REGION.REGION_NAME

The joins are generated in the FROM clause, but the REGION.REGION_NAME In ('East','North')restriction is placed in the WHERE clause.

These types of WHERE clause restrictions can be moved to the FROM clause. This can be achievedbe altering the setting for the FILTER_IN_FROM parameter.

The FILTER_IN_FROM parameter determines if query conditions are included in the FROM clause.

Note: This parameter onlyworks in conjunctionwith the ANSI92 parameter, either as a dynamicSQL parameter, or set in the PRM file.

As with the ANSI92 parameter, the FILTER_IN_FROM parameter has two settings: Yes, and No.

FILTER_IN_FROM: No

As seen in the above example, query filters are still generated in the WHERE clause instead of inthe FROM clause:SELECT CLIENT.CLIENT_LASTNAME + ', ' + CLIENT.CLIENT_FIRSTNAME, REGION.REGION_NAME, count(CLIENT.CLIENT_ID)FROM CLIENT INNER JOIN REGION ON (REGION.REGION_ID=CLIENT.REGION_ID)WHERE REGION.REGION_NAME In ('East','North')GROUP BY CLIENT.CLIENT_LASTNAME + ', ' + CLIENT.CLIENT_FIRSTNAME, REGION.REGION_NAME

When set to No, standard SQL is generated, or in case ANSI92 is set, the default ANSI92 SQLgeneration takes place. All joins are placed in the FROM clause, but any query filters andrestrictions remain in the WHERE clause.

FILTER_IN_FROM: Yes

Setting the FILTER_IN_FROM parameter to Yes, moves the WHERE clause conditions seen in theprevious section to the FROM clause.

Advanced Universe Design—Learner’s Guide128

Page 143: Bou320 en Col91 Fv Part Ltr

When the end user creates a newWeb Intelligence Rich Client report using Client Name,Region, with a quick filter applied to Region, the generated SQL looks like this:

With the FILTER_IN_FROM parameter set to Yes, a query with Client Name, Region, and SalesRevenue produces the following SQL, with the Sale_Type = 'S' join restriction placed in theFROM clause:

SELECT CLIENT.CLIENT_LASTNAME + ', ' + CLIENT.CLIENT_FIRSTNAME, REGION.REGION_NAME, sum(SALE_MODEL.SALE_QTY * MODEL.MODEL_PRICE * ((100 - SALE.SALE_DISCOUNT) / 100))FROM MODEL INNER JOIN SALE_MODEL ON (SALE_MODEL.MODEL_ID=MODEL.MODEL_ID) INNER JOIN SALE ON (SALE.SALE_ID=SALE_MODEL.SALE_ID AND SALE.SALE_TYPE='S') INNER JOIN CLIENT ON (CLIENT.CLIENT_ID=SALE.CLIENT_ID) INNER JOIN REGION ON (REGION.REGION_ID=CLIENT.REGION_ID)GROUP BY CLIENT.CLIENT_LASTNAME + ', ' + CLIENT.CLIENT_FIRSTNAME, REGION.REGION_NAME)

Note: By changing the FILTER_IN_FROM parameter to Yes, this parameter is applied to thewhole universe. The FILTER_IN_FROM functionality can however be applied to individual classesand objects.

About ANSI92 SQL syntax

The ANSI92 syntax moves join references from the WHERE clause to the FROM clause, which canhelp decrease the quantity of data parsed by the database. The SQL displays the table joins asINNER JOIN references in the FROM clause. For example:

SELECT CLIENT.CLIENT_LASTNAME + ', ' + CLIENT.CLIENT_FIRSTNAME, COUNTRY_REGION.COUNTRY_NAME,

129Maintaining and Optimizing Universes—Learner’s Guide

Page 144: Bou320 en Col91 Fv Part Ltr

count(CLIENT.CLIENT_ID)FROM CLIENT INNER JOIN COUNTRY COUNTRY_REGION ON (COUNTRY_REGION.COUNTRY_ID=CLIENT.COUNTRY_ID)GROUP BY CLIENT.CLIENT_LASTNAME + ', ' + CLIENT.CLIENT_FIRSTNAME, COUNTRY_REGION.COUNTRY_NAME

For databases that support ANSI92 SQL syntax, the ANSI92 parameter is automatically appliedat data access driver (<driver>.prm) level.

The PRM file contains the following parameter that is set to ANSI92:<Parameter Name="OUTERJOINS_GENERATION">ANSI_92</Parameter>

As the PRM file is accessed via the connection, the ANSI92 setting is applied on all universesthat access the samemiddleware connection. If youwant to only apply ANSI92 syntax to selecteduniverses, the option in the PRM file needs to be set to No:<Parameter Name="OUTERJOINS_GENERATION">NO</Parameter>

The ANSI92 dynamic SQL parameter can instead be set to Yes directly in the universe.

Note: Remember that the PRM file is a system file and should be used/adapted responsibly. Ensurethat a backup version is available to restore the defaults if changes have been applied.

The ANSI92 dynamic SQL parameter

The ANSI92 parameter allows ANSI92 SQL syntax to be used in query generation. It enablescomplete left, right, and full outer join support in the universe.

The parameter has two possible setting: Yes, and No.

ANSI92: No

With the ANSI92 parameter set to No, SQL generation behaves according to theOUTER_JOIN_GENERATION parameter in the PRM file. If in the PRM file, theOUTER_JOIN_GENERATION parameter is set to No, standard SQL output is generated.

The SQL output for a query using Client Name, Region, andNumber of Clients is as follows:SELECT CLIENT.CLIENT_LASTNAME + ', ' + CLIENT.CLIENT_FIRSTNAME, COUNTRY_REGION.COUNTRY_NAME, count(CLIENT.CLIENT_ID)FROM CLIENT, COUNTRY COUNTRY_REGIONWHERE (COUNTRY_REGION.COUNTRY_ID=CLIENT.COUNTRY_ID)GROUP BY CLIENT.CLIENT_LASTNAME + ', ' + CLIENT.CLIENT_FIRSTNAME, COUNTRY_REGION.COUNTRY_NAME

ANSI92: Yes

By setting the ANSI92 parameter to Yes, join references are moved from the WHERE clause intothe FROM clause, and the same query outputs the following SQL statement:SELECT CLIENT.CLIENT_LASTNAME + ', ' + CLIENT.CLIENT_FIRSTNAME, COUNTRY_REGION.COUNTRY_NAME,

Advanced Universe Design—Learner’s Guide130

Page 145: Bou320 en Col91 Fv Part Ltr

count(CLIENT.CLIENT_ID)FROM CLIENT INNER JOIN COUNTRY COUNTRY_REGION ON (COUNTRY_REGION.COUNTRY_ID=CLIENT.COUNTRY_ID)GROUP BY CLIENT.CLIENT_LASTNAME + ', ' + CLIENT.CLIENT_FIRSTNAME, COUNTRY_REGION.COUNTRY_NAME

The structure now shows the join references in the FROM clause using INNER JOIN references.

Applying the FILTER_IN_FROM functionality to individual classesand objects

The FILTER_IN_FROM can be applied to individual classes and objects via each universe join.

Note: In order to apply the FILTER_IN_FROM functionality to individual classes and objects,FILTER_IN_FROM dynamic SQL parameter needs to be set to No.

When the ANSI92 parameter has been set to Yes, or when the PRM file has ANSI92 set as thedefault., theAdvanced button in the Edit Join dialog box of each universe join becomes active.

In the Advanced Join Properties dialog box you can determine which classes and objects areincluded in the FROM clause in the generated SQL.

131Maintaining and Optimizing Universes—Learner’s Guide

Page 146: Bou320 en Col91 Fv Part Ltr

You can specify the following:• Default behavior:

When applied, all classes and objects that are associated with this join are greyed out andcan not be selected. The standard ANSI92 rules are applied and if a quick filter is used in thequery, the generated SQL displays the filter results in the WHERE clause.

• All objects in FROM:

When applied, any condition/quick filter applied to the objects associatedwith this join areincluded in the FROM clause.

Note: The classes and objects remain greyed out in the Advanced Join dialog box.

• No objects in FROM:

When applied, all classes and objects that are associated with this join are greyed out andcan not be selected. The standard ANSI92 rules are applied and if a quick filter is used in thequery, the generated SQL displays the filter results in the WHERE clause.

• Selected objects in FROM:

When applied, the classes and objects in the Advanced Join dialog box are activated. Youcan select the individual classes and objects. If a quick filter is applied to a selected object,the generated SQL displays the filter results for that object in the FROM clause. If a quick filteris applied to an object that was not selected, the generated SQL displays the filter resultsfor that object in the WHERE clause.

To apply FILTER_IN_FROM functionality to individual classes andobjects

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 toNo.

5. Double-click a join in the Structure pane.

The Edit Join properties open for the selected join.

Advanced Universe Design—Learner’s Guide132

Page 147: Bou320 en Col91 Fv Part Ltr

6. Click the Advanced button.

Note: This button is active only if the ANSI92 dynamic SQL parameter is set to Yes or whenthe PRM file has ANSI92 set as the default.

The Advanced Join Properties dialog box opens.

133Maintaining and Optimizing Universes—Learner’s Guide

Page 148: Bou320 en Col91 Fv Part Ltr

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

8. Select the appropriate classes and objects.

Advanced Universe Design—Learner’s Guide134

Page 149: Bou320 en Col91 Fv Part Ltr

9. ClickOK to apply the changes.

10.Repeat steps for other joins in the schema.

The JOIN_BY_SQL parameter

The JOIN_BY_SQL parameter combines split queries into one sentence and makes the databasecalculate the union. Split queries happen when requesting measures over multiple contexts.Each context generates one query and each query result set is sent back to the microcube. Themicrocube makes the final union and presents the data in the report as one result set.

Each separate result set or SQL statement is processed sequentially by the RDBMS. This canslow down response time, especially if the requested query needs to process several SQLstatements. The returned result sets subsequently need to be merged by the microcube into afinal report result set.

Example scenario: Using the Motors universe, if in a query you need information on car salesand rental revenue, it requires running across two contexts. The default behavior generatestwo separate queries for each context; sales and rentals. Assuming the query returns 10,000rows of car sales information, and 10,000 rows of car rental information, this has double impacton the entire system sending a total of 20,000 rows of data across the network, and the Enterpriseserver synchronizes them to display 10,000 rows in your final report. Merging data this wayhas a high impact on the network and Enterprise server performance.

Applying the JOIN_BY_SQLparametermoves the data UNIONprocessing from the BusinessObjectsEnterprise server to the RDBMS. Fewer rows travel the network and as themicrocube no longerneeds to merge the data, there is less impact on the BusinessObjects Enterprise server.

Use of this parameter can improve performance depending on how well your RDBMS is setup.

The JOIN_BY_SQLparameter can also help in taking advantage of the RDBMSability to generatederived tables and the full outer join SQL. Despite generating at least two SQL flows, there isonly one global SQL flow.

Finally, this parameter can be used for universes through Crystal Reports. Multi-flow SQLcannot be applied for Crystal Reports. On some databases there is the possibility to force thegeneration of a single flow of SQL from the universe by setting the JOIN_BY_SQL = Yes.

JOIN_BY_SQL generated SQL

The generated SQL for the JOIN_BY_SQL functionality may differ depending on the RDBMSyou are connecting to. The end result is the same.

When the query is based on an Oracle data source, the SQL generated uses NVL to display thedimensions common to both sets of queries. The NVL function lets you substitute a value whena null value is encountered. The syntax for the NVL function is as follows:NVL(string1, replace_with)

Where string1 is the string to test for a null value and replace_with is the value returned ifstring1 is null.

135Maintaining and Optimizing Universes—Learner’s Guide

Page 150: Bou320 en Col91 Fv Part Ltr

When the query is based on a MS SQL Server data source, the SQL generated uses COALESCEas NVL is not supported. The end result is the same. The COALESCE function returns the firstnon-null expression among its arguments. The syntax for COALESCE is:COALESCE(expression [,...n])

Where expression is an expression of any type and n is a placeholder indicating that multipleexpressions can be specified. All expressions must be the same type or must be implicitlyconvertible to the same type. If all arguments are NULL, COALESCE returns NULL.

Note: The COALESCE syntax COALESCE(expression [,...n]) is equivalent to the followingCASE statement:CASE WHEN (expression IS NOT NULL) THEN expression1...WHEN (expression IS NOT NULL) THEN expressionNELSE NULL

Activity: Using dynamic SQL parameters

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 newWeb Intelligence Rich Client document based on your Motors universe. Dragthe Client Name, Number of Clients, andNumber of Cars Sold objects to the ResultObjects 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 youruniverse.

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. ClickOK to close the Parameter dialog box.

9. Save the changes locally.

Advanced Universe Design—Learner’s Guide136

Page 151: Bou320 en Col91 Fv Part Ltr

10.Launch Web Intelligence Rich Client and create a new document based on your Motorsuniverse.

11.Drag theClient Name, Sales Revenue, andRental Revenue objects into theResult Objectspane.

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 yourMotors universe open inUniverseDesigner, selectFile➤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 theend of the SQL generated by a query. The variables are stated in a comment field andevaluated when running a query. The query is generated with the explicit sentence.

5. ClickOK 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 SalesRevenue.

8. Click the View SQL icon.The generated SQL appears in the SQLViewer. The last line in the SQL contains the syntaxadded to the END_SQL parameter in the Parameter dialog box.

9. Run the query and return to theQuery Panel by editing the query.

10.View the SQL.The END_SQLwas executed at query run time. When viewing the SQL after running thequery, 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 yourMotors universe open inUniverseDesigner, selectFile➤Parameters➤Parameter.The Parameter dialog box opens.

3. Locate the ANSI92 parameter and change this to Yes.

137Maintaining and Optimizing Universes—Learner’s Guide

Page 152: Bou320 en Col91 Fv Part Ltr

4. Click Replace and thenOK.

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. ClickOK twice.

10.Save your universe locally.

11.Create a newWeb Intelligence Rich Client report with theClient Name andRegion 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 aQuick Filter on theClientName object and select a few valuesfrom 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 secondQuick Filter on theArea 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.ClickOK 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 andNorth.

23.Click View SQL to see the results. The SQL statement contains the INNER JOIN statementsand 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).

Advanced Universe Design—Learner’s Guide138

Page 153: Bou320 en Col91 Fv Part Ltr

Applying index awarenessThe 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 howUniverseDesigner takes advantage of primary and foreign keys thatmay 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?

Index awareness is the ability to take advantage of the indexes on key columns to speed dataretrieval.

The objects that you create in the universe are based on database columns that are meaningfulto an end user. For example, a Customer object retrieves the field that contains the customername. In this situation the customer table typically has a primary key (for example, an integer)that is not meaningful to the end user, but which is very important for database performance.

In Universe Designer you can apply primary and foreign key index awareness:• Primary key index awareness: by applying primary key index awareness on an object

Universe Designer can substitute the object's column value with the associated index value.The generated query uses the key value instead of the actual column value.

• Foreign key index awareness: by applying foreign key index awareness on an objectUniverseDesigner can restrict the values returned without the need to join the tables. If you build aquery that involves filtering on a value in a dimension table, Universe Designer can applythe filter directly on the fact table by using the dimension table foreign key. This eliminatesunnecessary and costly joins to dimension tables.

When you set up index awareness in Universe Designer, you tell Universe Designer whichdatabase columns are primary and foreign keys. This can have a dramatic effect on queryperformance in the following ways:• UniverseDesigner can take advantage of the indexes on key columns to speed data retrieval.

• Universe Designer can generate SQL that filters in themost efficient way. This is particularlyimportant in a star schema database. If you build a query that involves filtering on a valuein a dimension table, Universe Designer can apply the filter directly on the fact table byusing the dimension table foreign key. This eliminates unnecessary and costly joins todimension tables.

Note: UniverseDesigner does not ignore duplicateswith index awareness. If two customershave the same name, Universe Designer retrieves only one unless it is aware that eachcustomer has a separate primary key.

139Maintaining and Optimizing Universes—Learner’s Guide

Page 154: Bou320 en Col91 Fv Part Ltr

For example, a query inWeb Intelligence Rich Client, with Client Name in the Result Objectspane, andClient Country in theQuery Filterspane, restricted on the countriesUnitedKingdomand the United States, produces the following SQL when primary key index has been applied: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) )

The restricted country name values have been replaced by their respective primary key indexvalue to help increase query performance.

Note: If the FILTER_IN_FROMparameter is also set for the universe, the index awareness conditionappears in the FROM clause, instead of in the WHERE clause.

Avoiding joins in tables

With foreign key index awareness, you can tell Universe Designer that Country_ID is theprimary key of the Country_Region table and that it also appears in the Client table as a foreignkey. Using this information, Universe Designer can restrict the countries without joining to theCountry_Region table.

Reducing the number of joins in a query can help improve query performance. The SQL fromthe primary key index awareness example improved performance by restricting on the primarykey (indexed) of the Country_Region table.

The example query includes the Client and Country_Region tables, which both can providethe Country_ID column.

The Country_Region table is only needed to satisfy the WHERE clause and is not needed in theSELECT or GROUP BY clauses.

Using index awareness it is possible to remove the Country_Region table from the querycompletely, by telling BusinessObjects to use theMaker table to retrieve Country_ID data from.

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

The Country_Region table is no longer referenced in the SQL. This table no longer shows upin the FROM clause, nor in the WHERE clause as a join to the Client table or as a table used toretrieve the condition values from.

Advanced Universe Design—Learner’s Guide140

Page 155: Bou320 en Col91 Fv Part Ltr

To set up foreign key index awareness

1. Right-click the object on which you are setting up index awareness and selectObjectProperties 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 clickOK.

Multiple foreign key entries

The Keys tab allows more than one foreign key entry. This allows you to deal with repeatedvalues in multiple tables (denormalized data).

Database designers may denormalize primary key values beyond what is necessary to satisfyconstraints or to assist in performance and simplification of SQL generation.

It is expected to see an entity repeated twice: initially in the entity’s own table as its primarykey and then in a table that refers to this primary key through its foreign key.

Denormalization implies that the database designer has gone beyond this duplication and hasmore than two instances of the value in a schema.

In the Motors schema you can find such a scenario with the following tables:• Client• Region• Country_Region

All three tables contain a Country_ID column.

If you set up the keys for the Client Country object, you can give BusinessObjects three choicesfrom which it can retrieve these values for the purposes of restricting data in the WHERE clause.This can aid query performance.

141Maintaining and Optimizing Universes—Learner’s Guide

Page 156: Bou320 en Col91 Fv Part Ltr

When running a query in Web Intelligence Rich Client using Client Name and Region objectsin the Result Objects pane, and the Client Country object in theQuery Filters pane, the SQLgenerated is as follows:SELECTCLIENT.CLIENT_LASTNAME + ', ' + CLIENT.CLIENT_FIRSTNAME,REGION.REGION_NAMEFROM CLIENT INNER JOIN REGION ON (REGION.REGION_ID=CLIENT.REGION_ID)WHERE CLIENT.COUNTRY_ID In (1,44)

The Region table is used to restrict on Country_Region (Country_ID) as it is one of the foreignkey entries and the Country_Region table is not used anywhere else in the query and issubsequently dropped from the SQL.

Why does BusinessObjects use the Region table and not the Client table? Both tables exist inthe FROM clause, however the Region table is used as the Country_ID key replacement.

The reason for this is the order in which the foreign keys have been defined. The Country_IDkey from the Region table was the last one defined in the list and this is the one that is used inthe SQL generation.

Rearranging the keys by placing the Country_ID key from the Client table last results in thefollowing SQL instead:

SELECTCLIENT.CLIENT_LASTNAME + ', ' + CLIENT.CLIENT_FIRSTNAME,REGION.REGION_NAMEFROM CLIENT INNER JOIN REGION ON (REGION.REGION_ID=CLIENT.REGION_ID)WHERE REGION.COUNTRY_ID In (1,44)

Note: If a shortcut join has been defined between the Country_Region and Client table, thisshortcut key takes precedence as the foreign key, even if the last foreign key defined is theRegion key.

Advanced Universe Design—Learner’s Guide142

Page 157: Bou320 en Col91 Fv Part Ltr

SQL Editor dialog box

The SQL Editor available to the management of index aware is the same SQL Editor dialogbox available to predefined conditions, SELECT and WHERE clauses for objects.

If your target database allows them, you can add SQL comments to the primary key and foreignkey entries so that they are identifiable in the final query SQL for example:/* Index Awareness Foreign Key */

To add a string value in the SQL Editor dialog box

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. ClickOK to apply your changes.

Using an index awareness WHERE clause

This section looks at using a WHERE clause for the primary and foreign key. Using a WHERE clausecondition in either the primary or foreign key index acts as a data restriction. Thismay be usefulif there is a large amount of data returned for a particular object.

To add a string value in the SQL Editor dialog box

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. ClickOK to apply your changes.

143Maintaining and Optimizing Universes—Learner’s Guide

Page 158: Bou320 en Col91 Fv Part Ltr

Applying best practices for universe designAswith any project you should always base your universe design and implementation on bestpractices. 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

The following section outlines a general workflow of best practices to design an effectiveuniverse that meets end users’ needs.

General best practices

• Identify reporting requirements.

Involve users at every step of the universe design and production process, especially innaming objects (this ensures the terminology is correct).

• Identify the database schema relevant to the universe you are creating and ensure there isrepresentative data in that schema.

Ensure that the data and structure of that schema is stable and not likely to changedramatically during development without warning.

• Insert universe tables one at a time, not in bulk, understanding how each table relates torest of the universe.

• Insert joins and define cardinalities.

Specify cardinalities manually as opposed to using theDetect Cardinalities option inUniverse Designer. Always define cardinality, even for self-referencing and self-restrictingjoins, to avoid cardinality warning messages.

• Lay out your structure window with cardinalities facing the same direction and alwaysarrange tables logically in the structure window. This helps you identify and visualize thecontext and resolve loops and SQL Traps.

• Add relevant comments to your universe to document up to date universe developmentchanges. Remember that you may not be the only person building and designing thisuniverse.

In general, two methods are often used to place technical comments in the universe wherethey are not visible for the end user:○ Just type the text in the universe structure○ Place comments in SQL- boxes of objects between /* and */ in: Select and, Where fields,

and in join definitions.

• Build relevant objects. Keep the universe business-focused, for examplewhen naming objectsand classes.

Advanced Universe Design—Learner’s Guide144

Page 159: Bou320 en Col91 Fv Part Ltr

• Do not normalize. Use Multi-Dimensional Modeling instead.• Always check integrity.• If the universe is bigger than 1MB, divide it into multiple universes.

Note: When you select File ➤ Open, you load the universe into RAM. If the universe is1.39 MB, then it uses 1.5MB RAM. This could have an impact on the RAM available to yoursystem.

• Use aggregate awareness, which speeds up query time by using special tables containingpre-calculated data. Do all aggregation on the server side instead of in the document (thiscan result in huge time savings).

• Define aggregate SQL functions on universe measures. Fewer rows get returned from thedatabase thus making reports smaller and the calculation of variables, ranks and alertersquicker.

• Database connections for a universe should be set to disconnect after each transaction. Thisensures that the SQL is terminated cleanly and that the are no treads left open to the databasewhich are inactive.

Note: A number of databases are licensed on the number of concurrent connections and ifa connection is left open for a period of time when the keep connection active for x minutesis enabled, then end users could experience difficulties in accessing the database.

• Optimize universe performance and database tuning.• Remove unnecessary lists of values, such as on dates andmeasure objects. Base lists of values

on lookup tables.• Add any other elements to the universe such as predefined conditions and hierarchies.• Test the universe by building queries in BusinessObjects end user querying tools.

Best practices for classes and objects

• Use the minimum possible objects in a universe.

500 objects is the recommended maximum. Too many objects may slow down the timerequired for a user to find objects.

• Create predefined condition or filter objects when possible.• Consider putting the full class path and object name in the object’s description.

This may be a laborious process but one which is useful if you are working with a largeuniverse. The description is shown in the report/query panel when a user points to anobject.

• Always define help for objects.

Start the help off with the object’s full name: this is particularly helpful to users if the object’sname is very long and cannot be fully displayed in the report/query panel.

• Dimension, measure, and detail objects should be within their logical classes unless themeasure objects are generic to the whole universe, in which case a general measure class iscreated.

• Format objects and measures within the universe.

145Maintaining and Optimizing Universes—Learner’s Guide

Page 160: Bou320 en Col91 Fv Part Ltr

This prevents users having to spend valuable time formatting data fromwithin the reportingtool every time they create a report.

Best practices for joins

• Avoid building universe tables with no joins. There are exceptions, like with Views that actas summary tables, however in those instances ensure that incompatibilities are set usingthe Aggregate Navigation tool to avoid SQL errors.

• Optimize database performance by using shortcut joins.

Shortcut joins provide an alternative path between two tables. Shortcut joins can improvequery performance by using shorter paths and bypassing intermediate tables.

Note: Placing shortcut joins in an existing universe may change the results returned byexisting queries.

• Avoid outer joins where possible.

Outer joins may have a negative effect on performance since more rows are returned.Additionally, some databases do not use indexes when outer joins are involved.

Note: It is recommended that outer joins be placed at the end of the flow of data, otherwiseouter join errors may occur. Potentially, this could cause the SQL to try to match on theequality of a NULL value, which it cannot do. Using aggregate aware and aliases may helpif outer joins are necessary but cannot be placed at the end of the path. If you do place outerjoins in themiddle of a table path, the subsequent joins in the pathmay also have to bemadeouter to avoid errors. This can have a significant negative impact on performance.

Advanced Universe Design—Learner’s Guide146

Page 161: Bou320 en Col91 Fv Part Ltr

Quiz: Maintaining and optimizing universes1. True or False. Adding new tables or columns to the database impacts the reports that are

already created and refreshed regularly by end users.

2. True or False. In the case of a column name change, you only need to edit all the objects thatreferred to the original column.

3. True or False. Setting the FILTER_IN_FROM parameter to Yesmoves the SELECT clause dataof a query to the FROM clause.

147Maintaining and Optimizing Universes—Learner’s Guide

Page 162: Bou320 en Col91 Fv Part Ltr

Lesson summaryAfter completing this lesson, you are now able to:

• Optimize universes• Apply foreign key index awareness• Apply best practices for universe design

Advanced Universe Design—Learner’s Guide148

Page 163: Bou320 en Col91 Fv Part Ltr

Lesson 8Creating Universes from Other Data Sources

Lesson introductionThe universe access list continues to grow as the variety of data sources evolve in customerenvironments.

Using Universe Designer, you can create a universe from a data source, such as XML files orOracle 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

149Creating Universes from Other Data Sources—Learner’s Guide

Page 164: Bou320 en Col91 Fv Part Ltr

Creating a universe from an XML data sourceYou can use Universe Designer to create a universe from a XML data source, by using theMetadata Exchange panel. Once the universe has been created it can be exported to the CentralManagement Server (CMS) as any other universe, and is then available to end users to runqueries and create reports on.

Note: TheMetadata Exchangewizard is also available in stand-alone mode. To access theMetadata Exchange panel in stand-alonemode 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 theMetadata Exchange panel• Describe theMetadata Exchange panel functions• Create a new universe from an XML data source

Which data sources are supported in the Metadata Exchangepanel?

Using theMetadata Exchange panel, you can create universes from the following data sources:• XML data sources:

○ Common Warehouse Model (CWM Relational 1.0)

○ Common Warehouse Model OLAP (CWMOLAP)

○ Oracle Warehouse Builder (Oracle WB)

○ Data Integrator

○ IBM DB2 Data Warehouse Center (IBM DB2 DWC)

○ IBM DB2 Cube Views

• Oracle Analytic Workspaces (Oracle OLAP)

Working with the Metadata Exchange panel

You access theMetadata Exchange panel by selecting theMetadata Exchange option from theFile menu in Universe Designer.

Advanced Universe Design—Learner’s Guide150

Page 165: Bou320 en Col91 Fv Part Ltr

In theMetadata Exchange panel, you can:• Select the data source format to build the universe.

This is the source XML file or database view that you use to build a universe. A universecreation wizard takes you through steps to select a connection for the data source, selectingthe data components that youwant to bemapped to the universe, and finally the generationof the universe.

• Update an existing universe with data from a data source that has been updated.

This is the data source that has been used to create the universe. The source has been updated,and now you want to update the universe with the same modification. A universe updatewizard takes you through the steps needed to update the universe.

• Export a universe to a data source format.

You select a data source format to which you can export the universe. The default optionavailable is DB2 Cube Views 8.1, then save the universe in that format.

TheMetadata Exchange panel takes you through a three-step process to create the universe:• Specify the location of the data source file.• Select the tables you want to include in the universe.• Define the connection to the original data source.

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

1. From the Filemenu in Universe Designer, selectMetadata Exchange.TheMetadata Exchange panel displays.

2. In theMetadata Exchange panel, click the drop-down arrow next to the Create a universefrom the drop-down list.

151Creating Universes from Other Data Sources—Learner’s Guide

Page 166: Bou320 en Col91 Fv Part Ltr

3. Select the CWM Relational 1.0/1.1 Metadata format.

4. ClickOK.

5. The CWM Relational 1.0 Universe Builderwizard appears.

6. ClickNext to continue.

7. In theUniverse creation - Step 1/5wizard page, browse to the location of your XMLmetadatafile.

8. ClickNext to continue.

The Universe creation - Step 2/5wizard page displays:

Advanced Universe Design—Learner’s Guide152

Page 167: Bou320 en Col91 Fv Part Ltr

9. SelectDatabase1 to highlight it and clickNext.

The Universe creation - Step 3/5wizard page displays.

This wizard page displays all the tables and columns in this metadata file.

10.Click the + box next to a table to view the columns in this table.

11.You can select individual tables or columns in the list and use the > button to move themindividually into the list in the right-hand side of the wizard box. Or you can use the >>button to move all the contents of the file at once.

12.ClickNext to continue.

The Universe creation - Step 4/5wizard page displays.

TheUniverse creation - Step 4/5wizardpage allows you to select the connection the universeuses to connect to the data source. For the purposes of this course, you will not actuallyconnect the universe to a data source, so it is not important which connection is selectedhere.

13.Type a name for the new universe in the Universe name field.The universe name must be eight characters or less.

14.Select the Advanced button.

TheOptions dialog box displays.

In theGeneral tab of theOptions dialog box, you can specify the location where trace filescan be stored.

15.Click the File Locations tab.

153Creating Universes from Other Data Sources—Learner’s Guide

Page 168: Bou320 en Col91 Fv Part Ltr

The File Locations tab allows you to specify default locations for storing the source XMLfiles and the parameter files associated with the metadata.

16.ClickOK to close theOptions dialog box. ClickNext to continue

The Universe creation - Step 5/5wizard page appears.

This page summarizes the connection and file information that are used to create the universe.

17.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 theCMS, because you have not defined a connection to the original data source.

18.Save the universe and close Universe Designer.

Advanced Universe Design—Learner’s Guide154

Page 169: Bou320 en Col91 Fv Part Ltr

Creating stored procedure and JavaBeans universesThe objective of universes is to provide a seamless access to any underlying source, which thenensures a consistent experience to users. By doing so, users can query, analyze, and report onany data source using universes.

The universe access list continues to grow as the variety of data sources evolve in our customerenvironments; the universe's capabilities are extended to access relational SQL storedproceduresand 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

A stored procedure universe is a special universe that enables Web Intelligence users to accessstored procedures residing in the database. This is the only way that Web Intelligence userscan access stored procedures. Web Intelligence users can use the stored procedure universesto create reports that are based on stored procedures in the database.

A stored procedure is a compiled SQL program, consisting of one or more SQL statements,which resides and runs on the target database.

Creating a universe based on stored procedures

UniverseDesigner allows designers to create universes based on stored procedures. This featureis very important for customers who have historically used Desktop Intelligence for theirreporting needs and are now interested in migrating to Web Intelligence. Support of storedprocedures brings Web Intelligence closer to parity with Desktop Intelligence functionality.

BusinessObjects supports stored procedures:• Without parameters.• With parameters (IN).• With multi-result sets.• With multi-statement (with SQL sentences different from SELECT).

Stored procedures are represented as Derived Tables, thus they benefit from Derived Tablemechanisms and concepts.

Note: It is important to note that youmust create a newuniverse based on the stored procedure.

Note: Universes that have been created from stored procedures are supported in WebIntelligence, Query as a Web Service, Polestar, and Live Office.

155Creating Universes from Other Data Sources—Learner’s Guide

Page 170: Bou320 en Col91 Fv Part Ltr

To create a universe based on a simple stored procedure

You can create a universe based on one or several stored procedures without parameters.1. In Universe Designer, click theQuick Design Wizard button on the toolbar.

TheWelcome dialog box appears.

2. Click the Click here to choose stored procedures universe check box at the bottom of thepane.

3. Click Begin.TheDefine 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 clickNewto create a new connection.

6. ClickNext.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 storedprocedure.

8. Click Add.The stored procedure is created in the Universe pane.

9. ClickNext.

10.Click Finish.The Congratulations dialog box appears.

Stored procedure parameters in the universe

To improve performance, you can have several stored procedures based on the same universefor the same data source (via theQuick Design Wizard or Insert ➤ Stored procedures ➤

Update ).

InUniverse Parameters, check the parameter STORED_PROC_UNIVERSE is set toYes. This indicatesthat the current universe is based on a stored procedure.

In order to avoid parsing errors on stored procedures columns, it is recommended that youalias result columns based on complex SQL, for example using the aggregate functions - sum,count. The creation of aliased objects cannot be constrained.

Note: The stored procedures do not support OUT or dynamic result sets parameters.

To create a universe based on stored procedures with inputparameters

You already have objects declared if the procedure prompts the user to select a value from alist in the database.

Advanced Universe Design—Learner’s Guide156

Page 171: Bou320 en Col91 Fv Part Ltr

You can create a universe based on stored procedures that requires one or more inputparameters. Depending on the entered value, the procedure returns the fact data of the valuefrom the appropriate fact table.1. In Universe Designer, click theQuick Design Wizard button on the toolbar.

TheWelcome dialog box appears.

2. Click the Click here to choose stored procedures universe check box at the bottom of thedialog box.

3. Click Begin.TheDefine 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 clickNewto create a new connection.

6. ClickNext.The Create initial classes and objects panel appears.

7. Expand the database node and the database owner node (for example dbo) to select a storedprocedure.

8. Click Add.When the storedprocedure requires input parameters, theStoredProcedures 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 thecolumns 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 ofsubscriber IDs from a table).

13.ClickOK.

14.ClickNext.

15.Click Finish.The Congratulations dialog box appears.

Advantages and disadvantages of stored procedure universes

Stored procedures offer the following benefits:• They encapsulate code. The database operation appears once, in the stored procedure, and

not multiple times throughout the application source. This improves debugging as well asmaintainability.

157Creating Universes from Other Data Sources—Learner’s Guide

Page 172: Bou320 en Col91 Fv Part Ltr

• Changes to the database schema affect the source code in only one place, the storedprocedure. Any schema changes become a database administration task rather than coderevision.

• Since the stored procedures reside on the server, you can set tighter security restrictions.This saves more trusted permissions for the well-protected stored procedure themselves.

• Because stored procedures are compiled and stored outside the client application, they canuse more sensitive variables within the SQL syntax, such as passwords or personal data.

• Using stored procedures reduces network traffic.• The stored procedure universe feature is useful for customers who already have many

programs that cannot be duplicated easily in straight SQL. If the customer is designing anew project, it's better to build a universe or simply add a derived table to an existinguniverse.

Note the following restrictions apply to stored procedures universes:• No joins are permitted between objects in stored procedures universes.• Filters cannot be used on the stored procedure universe.• You cannot link a stored procedure universe to a standard universe.• Not all RDBMSs support stored procedures. Consult your database guide to see if yours

does.• COMPUTE, PRINT, OUTPUT, or STATUS statements contained in storedprocedures are not executed.• If the stored procedure uses input parameters, they are converted as prompts in a Web

Intelligence document. If you want to link the stored procedure to a list of values, you needto create an additional object in the universe to house the LOVs returned.

JavaBeans and universes

JavaBeans are classes written in the Java programming language conforming to a particularconvention. They are used to encapsulate many objects into a single object (the bean), so thatthe bean can be passed around rather than the individual objects.

A JavaBean can be developed to obtain a result set from any source, andwe support beans thatimplement at least one Sql.ResultSetmethod.

Using a JavaBean universe

Universe Designer supports the creation of a universe based on JavaBeans. The bean allowsBusinessObjects designers to build a universe from a bean that implements at least oneJava.Sql.ResultSetmethod. The universe based on JavaBeans returns a result set fromwhichyou build a universe entity-relation.

The universe based on JavaBeans uses the same workflow and offers the same benefits as auniverse based on stored procedures. The limitations are also the same:• No joins are permitted.• Filters cannot be used on the universe.

Developers can create JavaBeans that you can use as data sources. You can create connectionsusing these JavaBeans. Typically, these JavaBeans provide access to a datasource. In order tocreate a JavaBeans connection, the developers who create the JavaBean need to supply:

Advanced Universe Design—Learner’s Guide158

Page 173: Bou320 en Col91 Fv Part Ltr

• The required .jar files.• Any other files that the JavaBean requires.• Any specific configuration details that the JavaBeans driver requires.

Within a JavaBeans driver, data-retrieval procedures are configured as stored procedures.When configuring a JavaBeans connection, on theDatabase Middleware Selection screen, oftheNew Connection Wizard you must select the Filter Stored Procedures Network Layerscheck-box. If you do not, theNew ConnectionWizard does not display the JavaBeans driversthat are available.

To create a JavaBean connection

1. Use an XML editor to open the javabeans.sbo file for editing. For example, on a Windowssystem, the configuration files are located in the following paths, where $INSTALLDIR is thedirectory where the BusinessObjects applications are installed:\\<INSTALDIR>\win32_x86\dataAccess\connectionServer\javabean.

2. Add the required .jar file details to the ClassPath area. Include the fully qualified pathnames when specifying these files.

Note: These files need to be installed on themachine running the BusinessObjects application.

JavaBean SBO example file structure:<DataBase Active="Yes" Name="ExcelSpreadsheet"> <JavaBean> <ClassPath> <Path>$ROOT$/beans/bean_excel.jar </Path> </ClassPath> <Parameter Name="JavaBean Class">com .businessobjects.beans.excel.Excel

159Creating Universes from Other Data Sources—Learner’s Guide

Page 174: Bou320 en Col91 Fv Part Ltr

</Parameter> <Parameter Name="URL Format">$DATASOURCE$ </Parameter> </JavaBean> <Parameter Name="Family">Java Beans </Parameter> <Parameter Name="Description File"> bean_excel</Parameter> <Parameter Name="Authentication Mode"> Bypass</Parameter> <Parameter Name="Extensions">bean_excel, javabean</Parameter> </DataBase></DataBases>

3. Save and close the javabeans.sbo file.

4. Perform any other configuration tasks specified by the JavaBeans developer.

5. Run the Connection Wizard. The JavaBeans datasource that you have configured shouldappear in the list of available connections.Select the JavaBeans datasource and use theWizard to configure the connection. When youcomplete this task, the connection is available for use with a BusinessObjects application.

Activity: Creating stored procedure universes

Objective

• Create universes from stored procedures.

Instructions

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

• CustomerOrderHistory

Advanced Universe Design—Learner’s Guide160

Page 175: Bou320 en Col91 Fv Part Ltr

Tip: The CustomerOrderHistory stored procedure contains an input parameter for theClient ID 1001.

1. Using the TenMostExpensiveModels stored procedure, create a new universe calledSimpleSP_xx (where "xx" stands for your initials).Use yourMotorsOLEDB_xx (where "xx" stands for your initials) connection to connect tothe Motors database.

2. Using theCustomerOrderHistory storedprocedure, create a newuniverse calledParamSP_xx(where "xx" stands for your initials).Use yourMotorsOLEDB_xx (where "xx" stands for your initials) connection to connect tothe Motors database.

3. Save your universes locally and test them in Web Intelligence Rich Client.

161Creating Universes from Other Data Sources—Learner’s Guide

Page 176: Bou320 en Col91 Fv Part Ltr

Working with OLAP universesAn OLAP universe is a BusinessObjects universe that has been generated from an OLAP cubeor query. The universe is created automatically from a selected connection to an OLAP datasource using anOLAPquery flattening driver that is installed as an add in toUniverseDesigner.

Once the universe has been created it can be exported to the Central Management System(CMS) as any other universe, and is then available toWeb Intelligence users to run queries andcreate 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

On Line Analytical Processing, or OLAP allows end users to get concise answers to businessquestions such as: "Show me the sales generated during a specified period, for a specifiedproduct in a specified location less than a specified amount".

UsingOLAP, a user can quickly narrowor expand the scope of a business question. For example,in the scenario illustrated above, the sales for a single product, a group of products, or manyproducts can be displayed. In a traditional relational reporting system, each of these questionswould require a separate relational query to summarize historical datawhich,when the volumeof transactions is high, can take a long time to produce the desired results. By comparison,comparable queries in an OLAP database can deliver answers with a better response time.

The power of an OLAP database is its ability to quickly and dynamically summarize data bya variety of dimensions. In addition, anOLAPdatabase provides a powerful calculation enginewhich supports ad hoc analysis to extend the value of the information beyond the data physicallystored in the OLAP database.

Advanced Universe Design—Learner’s Guide162

Page 177: Bou320 en Col91 Fv Part Ltr

Dimensions

An OLAP database is constructed from multiple components.

In the example shown above, Location, Product, and Time are the "Dimensions". Dimensionsdefine the numerical data under analysis. For example, knowing that there are $1 million insales is not meaningful until you put this amount in context with one or more dimensions. Isthis sales amount for one month or for one product or is it the annual sales for all products ina single city?

A dimension is comprised of representative values, or "Members". Atlanta is a member of theLocation dimension in the example above. When you query an OLAP database, you select oneor moremembers of a dimension or you can choose to summarize all members of a dimension.For example, you can select a particular location or you can summarize all locations. When thedesign of a dimension allows this type of summarization, a special type of member known asthe "AllMember" is available to provide a summarized value for themembers of that dimension.

Members can be organized intomultiple "levels". Time is a dimensionwhich commonly containsmany levels, often Year, Quarter, and Month. Depending on analytical requirements, thisdimension can also include Week, Day, and even Hour and Minutes. Levels organize adimension into a hierarchy with the most summarized values at the top and the most detailedvalues at the bottom. In the example above, Q1, Q2, Q3, and Q4 are all members of the Quarterlevel of the Time dimension, while Jan and Feb are members of the Month level of the samedimension. When you query an OLAP database, levels allow you to drill up or down adimension to view summary or detailed data.

Measures

Dimensions form the sides, or axes, of a cube. The cube cells represent the intersection of eachdimension member with members of all other dimensions. Contained within each cell is the"Measure", which is the numerical data being analyzed and summarized. A cube can containone or more measures.

163Creating Universes from Other Data Sources—Learner’s Guide

Page 178: Bou320 en Col91 Fv Part Ltr

Generating universes from OLAP cube sources

AnOLAPuniverse is created automatically from a selected connection to anOLAPdata source.

Note: OLAP universes support a single cube in the universe.

OLAP structures are mapped directly to classes, measures, dimensions, details, and filters inthe universe. The universe structure appears in the Universe pane, the Structure pane remainsempty.

You canuseUniverseDesigner to createOLAPuniverses from the followingOLAPdata sources:• SAP BW (Business Warehouse)• Microsoft Analysis Services 2000• Microsoft Analysis Services 2005• Hyperion Essbase

Once the universe has been created, it can be exported to the centralmanagement server (CMS)as any other universe. The universe is then available to Web Intelligence andWeb IntelligenceRich Client users to run queries and create reports.

To create a universe from an OLAP cube

1. Open Universe Designer.

2. Create a new OLAP connection. Select Tools ➤ Connections.

3. Click Add.TheNew Connection Wizard opens.

4. ClickNext.

5. Activate the Connection Type drop-down list to select the appropriate connection type;Secured, Shared, or Personal.

6. In the Connection Name field enter a name for the connection.

7. Expand the appropriate database node that supports the data access driver to the relevantOLAP data source.

8. Expand the appropriatemiddleware node that supports the data access driver to the relevantOLAP data source.

9. Select the appropriate data access driver to the relevant OLAP data source, and clickNext.

10.In the Login Parameterswindow, fill in the appropriate authentication mode and logindetails to connect to your OLAP data source, and clickNext.

11.TheCatalog/Database parameterswindowdisplays the available OLAP cubes. Expand theOLAP Cubes node and select the appropriate OLAP cube to connect to, and click TestConnection.If the connection is valid, a message dialog box appears indicating that the connection iscorrect. If you receive an error message, check that you entered all the parameters correctly.

12.ClickNext and click Finish twice to complete defining the OLAP connection.

Advanced Universe Design—Learner’s Guide164

Page 179: Bou320 en Col91 Fv Part Ltr

13.Create a new universe. Click File ➤ New.

14.Give the universe a name and a description.

15.Select the OLAP data source connection from the Connection drop-down menu, and clickOK.

The OLAP universe gets generated. This may take a few minutes depending on the cubesize. OLAP structures are mapped directly to classes, measures, dimensions, details, andfilters in the universe. The universe structure appears in the Universe pane.

Modifying and updating an OLAP universe

Once the OLAP universe has been automatically generated, designers are able to make thefollowing types of modifications:• Hide, duplicate, and rename classes and objects (dimension, detail, and measure)• Insert new classes and objects (dimension, detail, and measure).• Edit an object's format.• Edit an object's data type (character and number only).• Edit hierarchies.• Use universe functions (@variable, @select, @prompt).• Create a cascading list of values.• Define a delegate search for a list of values, allowing users to limit loading of the list of

values at query run time.• Define measures with database delegated projection function (delegated measures).• Create calculated measures (SAP BW and MSAS only).• Run the Check Integrity or Parse tools at any time.• Parse dimension, detail, and measure object MDX syntaxes.

165Creating Universes from Other Data Sources—Learner’s Guide

Page 180: Bou320 en Col91 Fv Part Ltr

• Create predefined conditions/filters.• Define optional prompts.

The following Universe Designer features are not supported for OLAP universes:• You cannot set row-level security authorizations in an OLAP universe.• You cannot edit a list of values in an OLAP universe.• You cannot view and edit the universe entity-relationship schema as no schema is generated

for OLAP universes.

Delegated measures

OLAP cube aggregation is supported in Universe Designer with delegated smart measures. Adelegated measure is a measure that delegates its aggregation calculation to the database. ForOLAP universes, this allows the universe designer to use the cube aggregation calculated inthe OLAP source.

Web Intelligence reporting and layout workflows now work seamlessly on OLAP sourcesregardless of the nature of the measure. This greatly eases the user experience by simplifyingworkflows and reducing inconsistent results.

Note: For MSAS 2000, MSAS 2005, and Essbase, by default, all measures generated in OLAPuniverses are defined as delegated measures. For SAP BW, the universe designer must set thisoption manually for each measure.

Calculated measures in OLAP universes

Calculatedmeasures allowuniverse designers to create their ownmeasuresmanually. In orderto create calculated measures, designers create pure MDX expression embedded in new XMLtags: <EXPRESSION></EXPRESSION>

Universe Designer functions are allowed in calculated measure expressions, for example:• @select

• @prompt

• @variable

• @where

For example:<EXPRESSION>@select(MEASURES GROUP\ORDER COUNT)*@select(MEASURES GROUP\SALES REVENUE)</EXPRESSION>

Note: Expressions for calculated measures cannot include the @aggregate_aware function.

The check integrity validates the XML syntax and any of the Universe Designer functions.

Universe Designer also supports constants in the expression such as: "10", "ABC", @prompt, andso forth. This is important to support constants as it could be used (like in relational universes)to pass dynamic values to the report: ratio, percentage, and so forth.

The Update OLAP Wizard

TheUpdateOLAPUniverseWizard allows you tomanage the life cycle of theOLAPuniverse.The wizard automatically refreshes the universe structure with changes made in the OLAPdata source. The wizard compares the universe with the updated data source, and can

Advanced Universe Design—Learner’s Guide166

Page 181: Bou320 en Col91 Fv Part Ltr

differentiate generated objects from objects added or modified manually, allowing you topreserve the manual changes made in Universe Designer.

It allows you to choose which strategy to adopt:• Business Name Keep Replace.• Object Type Keep Replace.• LOV options Keep Replace.• Deleted objects Delete from the Universe Keep and Hide: objects and add "/##/" as prefix

to the Object name.

A LOG file is generated at the end of the update process and can been saved on a hard disk tobe reviewed later. In Universe Designer, designers can now run the Check Integrity tool afterthe update process.

Note: The wizard does not update objects added manually in Universe Designer.

To refresh the structure of an OLAP universe

1. In Universe Designer, open the OLAP 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 the desired options you want to preserve modifications to manually made objects inthe universe.All keep options are selected by default.

5. Click Finish.The Change Management Results page appears showing added/deleted/hidden objects.Hidden objects aremoved to a separate class in the universe and appear in italic font precededby /##/.

6. On the Change Management Results page, selectOK, Export, or Check Integrity.• OK: If you are not satisfiedwith the results, you can clickOK, and then close the universe

without saving or exporting.• Export: If you are satisfiedwith the changes, click Export to save and export the updated

universe to the CMS.• Check Integrity: Click Check Integrity to perform an integrity check.

The integrity tool 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 pageyou can print the results of the check.

167Creating Universes from Other Data Sources—Learner’s Guide

Page 182: Bou320 en Col91 Fv Part Ltr

Activity: Creating an OLAP universe

Objective

• Create a universe from an OLAP cube

Instructions

1. Open Universe Designer.Create a newOLAP_xx connection, where "xx" stands for your initials, with the followingparameters:• 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 Parameterswindow 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. ClickNext.The Catalog/Database parameterswindow displays the available OLAP cubes.

4. SelectOLAP Cubes ➤ Motors (Motors) ➤ Motors (Motors), and click Test Connection.

5. Create a newMotorsOLAP_xx universe, (where "xx" stands for your initials), using yourcreated secured OLAP connection.

6. Save your universe locally and test it in Web Intelligence Rich Client.

Advanced Universe Design—Learner’s Guide168

Page 183: Bou320 en Col91 Fv Part Ltr

Quiz: Creating universes from other data sources1. What three tasks can you perform in the Metadata Exchange panel?

2. True or False. A stored procedure is a compiled SQL program, consisting of one or moreSQL statements, which resides and runs on the target database.

3. True or False. When creating an OLAP universe, no tables are generated in the Structurepane.

4. True or False. Stored procedures are represented as Derived Tables, thus they benefit fromDerived Table mechanisms and concepts.

169Creating Universes from Other Data Sources—Learner’s Guide

Page 184: Bou320 en Col91 Fv Part Ltr

Lesson summaryAfter 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

Advanced Universe Design—Learner’s Guide170

Page 185: Bou320 en Col91 Fv Part Ltr

Appendix AEnd of Course Challenge

Activity: Completing the end of course challengeObjectives

• Build YTD objects in the Motors universe• Use aggregate awareness to optimize the universe

PrestigeMotorsmanagement is finding that theirmonthly reports take a long time to run. Theyhave requested that these reports be producedwithout anynoticeable processingdelay, however,no changes can be made to the existing data store structure. In addition they would like toreview 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 calledDT_Monthly_Figures. Add the following SQL Syntaxfor 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_RevenueFROM SALE_MODEL, MODEL, SALEWHERE (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 newMonthly Figures class to contain the followingmonthly figures objects, basedon theDT_Monthly_Figures table:• Month• Year• Monthly Sales Revenue

4. Join the derived table with theMAKER and SHOWROOM tables using the appropriateforeign keys and update the Sales context as required.

5. Update the existingSalesRevenuemeasure SQL syntax to include amonth value aggregationlevel.

171End of Course Challenge—Learner’s Guide

Page 186: Bou320 en Col91 Fv Part Ltr

Tip: Check other objects that reference the monthly aggregate, for example year object inthe Financial Period class.

6. Set incompatibilities where required.

7. Test the aggregation level generations by running test queries in the Universe DesignerQuery 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:

TypeDescriptionSELECT syntaxDate Object

DateReturns the current date andtime.getdate()

CurrentDate

NumberReturns the current year.datepart(yyyy,getdate())CurrentYear

NumberReturns the current monthdatepart(mm,getdate())CurrentMonth

Note: These objects are not based on any database columns and do not parse as they arelacking a reference table. To check if the syntax is correct clickTables, select the SALE table,apply the changes and click Parse.

9. There are no current date values in theMotors database. To ensure that you can create YTDobjects, create a new derived table.Select Insert ➤ Derived Tables from the toolbar menu.

10.Name the tableDT_Sale_YTD.

11.Add the following syntax to the derived table SELECT statement:SELECT CLIENT_ID,SALE_ID, SALE_TOTAL, getdate() as SALE_DATEFROM SALEWHERE CLIENT_ID = (1089)UNIONSELECT CLIENT_ID,SALE_ID, SALE_TOTAL, dateadd(mm,-1,getdate()) as SALE_DATEFROM SALEWHERE CLIENT_ID = (1088)UNIONSELECT CLIENT_ID,SALE_ID, SALE_TOTAL, dateadd(mm,-2,getdate()) as SALE_DATEFROM SALEWHERE CLIENT_ID = (1087)UNIONSELECT CLIENT_ID,SALE_ID, SALE_TOTAL, dateadd(yy,-1,getdate()) AS SALE_DATEFROM SALE

Advanced Universe Design—Learner’s Guide172

Page 187: Bou320 en Col91 Fv Part Ltr

WHERE CLIENT_ID = (1086)

12.Check the syntax and clickOK.

13.As you need to ensure that all tables are part of a context you need to join theDT_Sale_YTDtable to the CLIENT table via the CLIENT_ID.

14.Detect the cardinality and create a new context for the join between theDT_Sale_YTD andCLIENT tables. Name the context SALE_YTD.

15.Create aYTDObjects class, and add the following objects based on the SALE_YTDderivedtable:

SELECT SyntaxObject

sum(DT_Sale_YTD.SALE_TOTAL)Sales Total (SALE_YTD table)

DT_Sale_YTD.SALE_DATESale Date (SALE_YTD table)

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 theYTDObjects class that are usedto create YTD measure objects in the remaining activity steps:

SELECT SyntaxBoolean FlagObject

CASE @select(YTD Objects\Year of Sale Date (SALE_YTD table))WHEN @select(Current Dates\Current Year)Sales in YTD

flag THEN 1ELSE 0 END

CASE @select(YTD Objects\Year of Sale Date (SALE_YTD table)) WHEN @select(Current Dates\Current Year)

Sales in YTDflag - currentmonth

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:

173End of Course Challenge—Learner’s Guide

Page 188: Bou320 en Col91 Fv Part Ltr

SELECT syntaxMeasure Object

sum((DT_Sale_YTD.SALE_TOTAL)*@select(YTD Objects\Sales in YTD flag))Total SalesYTD

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

Total SalesYTD- currentmonth

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.

Advanced Universe Design—Learner’s Guide174

Page 189: Bou320 en Col91 Fv Part Ltr

Appendix BData Access Files

BusinessObjects data access filesA number of driver level files used by specific data access drivers are installed with theBusinessObjects product suite. This unit will look at the individual data access files and atadvanced connection parameters that can be used to enhance your universe deployment.

Data access ismanaged by the Connection Server. TheConnection Server is the BusinessObjectsconnection engine that creates and manages connections used by universes betweenBusinessObjects data access drivers and the target RDBMS middleware.

The Connection Server libraries are present on the Web Intelligence Report Server, DesktopIntelligence Report Server andWeb Intelligence Job Serverwhich allows these services to querythe database directly without communicating with the Connection Server service.

The Connection Server and the required data access components are automatically installedwhen you install Business Objects.

Data access drivers can be found in the installation directory:

C\Program Files\Business Objects\BusinessObjects Enterprise

12.0\win32_x86\dataAccess\connectionsServer\<RDBMS>

DescriptionDriver specific file

Contains the help text for each externalstrategy defined in the <driver>.stg file.<driver><language>.stg

For example: sqlsrven.stg This text appears when the strategy isselected in a universe.

Contains the external strategies available todata access driver.<driver>.stg

For example: sqlsrv.stg or oracle.stg Note: External Strategies will be covered later on inLesson 7 External strategies

Defines all databases supported and thespecific connectivity configuration for eachdatabase.

<driver>.sbo

For example: odbc.sbo

Contains the help text for functions that arelisted in the <driver>.prm file. This text<driver><language>.prm

For example: sqlsrven.prm appears when the function is selected inUniverse Designer.

175Data Access Files—Learner’s Guide

Page 190: Bou320 en Col91 Fv Part Ltr

DescriptionDriver specific file

Defines the information parameters andfunctions related to the database.

<driver>.prm

For example: sqlsrv.prm

Stores information related to connection

Note: Do not modify this file.

<driver><language>.cod

For example: odbcen.cod

How can you quickly identify which data access files are being used? By looking at theconnection details.

Select File ➤ Parameters . On the Definition menu click the Test button for the Connection.Click onDetails. This will show the version of BusinessObjects Enterprise used, the networklayer. The details are split up into two parts:• Business Objects configuration

This section highlights the BusinessObjects version used, and the network layer as definedin the connection.

Note: The line <DBMS Engine: MS SQL Server 2005> is what has been defined in theconnection. This does not mean that the database connected to is actually MS SQL Server2005. The database version connected to is outlined in the Middleware and DBMSConfiguration section.

The BusinessObjects Configuration section also highlights the library of data access filesused.

Note: Double-click on the path to view the full path, or to copy the path.

• Middleware and DBMS Configuration

Advanced Universe Design—Learner’s Guide176

Page 191: Bou320 en Col91 Fv Part Ltr

The Middleware and DBMS Configuration section highlights the actual DatabaseManagement System (DBMS) that you are connected to, and the version. This can be animportant indicator that no cross reference ofDBMSversuswhat is specified in the connectionoccurs.

The SBO file

The SBO file is a parameter file used to configure the behavior of some of the connectionparameters. For each access driver (RDBMS) there is one SBO file that contains the appropriateconnection parameters.

Each <driver>.sbo file contains the following:• Default parameters that apply to all connections using the data access driver.

○ A list of database middleware that the driver supports. This list can also contain aliasesfor middleware versions that are no longer supported, but which are still used byconnections defined with the data access driver.

Each middleware entry can have default parameters set that apply only to that databasemiddleware. For example for Microsoft SQL Server 2005 you will find the followingsettings in the ODBC.sbo file:<DataBase Active="Yes" Name="MS SQL Server 2005"> <Libraries> <Library>dbd_wmssql</Library> <Library>dbd_mssql</Library></Libraries><Parameter Name="Family">Microsoft</Parameter><Parameter Name="Version">rdbms_mssqlserverodbc.txt</ Parameter><Parameter Name="SQL External File">sqlsrv</Parameter<Parameter Name="SQL Parameter File">sqlsrv</Parameter><Parameter Name="Strategies File">sqlsrv</Parameter><Parameter Name="Array Bind Available">True</Parameter><Parameter Name="CharSet Table"Platform="Unix">datadirect<Parameter Name="Driver Name">SQL Server</Parameter></DataBase>

The table below outlines what some of the above shown parameters mean:

177Data Access Files—Learner’s Guide

Page 192: Bou320 en Col91 Fv Part Ltr

DescriptionParameter

This specifies the family of database engine to be displayed in theDatabaseMiddleware Selection page of the new connection wizard. The

Family middleware that correspond to your data access key are displayed onthis page in a tree view.

Note: Do not modify this parameter.

The bind array is the area in memory that Connection Server stores abatch of data to be loaded (sent to the repository). When the bind arrayfills, it is transmitted to the database.Array Bind

VariableThis parameter specifies if the database supports this method. Valuescan be set to True or False, the default value is set to True

Specifies the limitations of each driver. This setting is specific to each<driver>.sbo file

Driver Level

• 1 specifies that you can only use the driver to create and executequeries.

• 13 specifies that you can use the driver to create and execute queries,and to create universe folders.

• 15 specifies that you can use the driver to create the BusinessObjectsrepository, and to create and execute queries.

• 31 specifies that you can use the driver to create the BusinessObjectsrepository, to create and execute queries, and to access storedprocedures.

Specifies the Charset file (.crs) for the data access driverwith no extension.This setting is specific to each .sbo file. The .crs file is in the same directoryas the .sbo file.

CharSet Table

Some <driver>.sbo files contain parameters that are also set in the cs.cfg file. The values setin the SBO file can over-ride the values in the cs.cfg file.

Note: Prior to making any changes in the .SBO file, you need to create a backup. The .SBO fileis a system file. Consult your database administrator before making any changes.

Note: All data access files are now in XML format. Although XML files may be opened in anytext editor such as WordPad or Notepad, only an editor designed for XML should be used toedit such files. Editing XML files without a proper editor may create file corruptionswhich canresult in problems with demonstrations and activities.

Note: Consult the BusinessObjects XI 3.0: Data Access Guide for more information on the .SBOfile.

Advanced Universe Design—Learner’s Guide178

Page 193: Bou320 en Col91 Fv Part Ltr

The CS.CFG file

The cs.cfg file is a data access general configuration file in XML format that contains defaultconfiguration parameters that apply to all data access drivers. The cs.cfg file is stored at theroot level for the connectionServer:

C\Program Files\Business Objects\BusinessObjects Enterprise

12.0\win32_x86\dataAccess\connectionsServer\

Note: The cs.cfg file is an XML file. The Document Type Definition (DTD) file that relates toeach element used in the cs.cfg file is in the same directory. Make sure that, when editingand/or modifying the XML file, the cs.dtd is accessible.

There are five XML elements in the cs.cfg file:• Locales:

This element defines the usual operating system charset for a given language. The localesare UNICODE compliant which allows SQL UNICODE to be used. Note that for somedatabases, SQL Server included, the SQL UNICODE settings are set to NVARCHAR. Toallow for UNICODE compliancy the UNICODE setting in the PRM file or the UNICODEDynamic SQL Parameter in the universe needs to be set accordingly.

• Settings:

This element defines parameters that apply to all data access drivers, for example the fileextensions of files used by Connection Server to manage data access.

Some settings can be defined either for library version or server version of ConnectionServer.○ Library: parameters apply to a standard Connection Server installation. It is installed

with other BusinessObjects desktop or server software. This is the default mode whenyou install a BusinessObjects product that is installed automatically with ConnectionServer.

○ Server: parameters apply to a Connection Server stand alone server installation. It isinstalled alone with no other BusinessObjects desktop or server product.

• Distribution:

This element contains two sub elements; Protocols and Lookup.

The protocols element contains settings that the Connection Server uses to process requestscoming from CORBA clients or HTTP clients.

The Lookup element allows you to expose the target RDBMS that corresponds to a specificODBC network layer to Connection Server. This applies when Connection Server is usingtwo different data access drivers, for example Microsoft SQL Server and Microsoft Access,through a common ODBC network layer. By default, Lookup is set to No, so ConnectionServer associates a target RDBMS to its ODBCnetwork layer. However, if Connection Serveris being used as a standalone server, and has two databases that are accessed by the sameODBCnetwork layer, the specific target database informationmust be exposed toConnectionServer to allow queries to be routed through ODBC to the correct data account.

• Driver defaults:

179Data Access Files—Learner’s Guide

Page 194: Bou320 en Col91 Fv Part Ltr

Data access driver parameters that are also found in driver specific SBO files. The valuesset for these parameters apply to all data access drivers.

Parameters specified in the SBO file can over-ride the parameters set in the cs.cfg file. Forexample the cs.cfg holds the default settings for the Array Fetch Size and Array Bind Sizevalues, in the oracle.sbo file you can define different Array Fetch size and Array Bind sizevalues.

These values are normally set in individual universe connections in theAdvancedParametersand Custom Parameters menus. If no values are changed in these menus when defining theuniverse connection, the default settings from the cs.cfg will be used instead. If these valueshave been altered in the SBO file, this file over-rides the default from the cs.cfg file.

• Traces:

You can set trace parameters that allow the recording of connection activity throughConnection Server in log files.

Note: Consult the BusinessObjects XI 3.0: Data Access Guide for more information on the cs.cfgfile.

Advanced Universe Design—Learner’s Guide180

Page 195: Bou320 en Col91 Fv Part Ltr

The PRM fileA number of driver level files used by specific data access drivers are installed with theBusinessObjects product suite. This unit will look at the individual data access files and atadvanced connection parameters that can be used to enhance your universe deployment.

Each data access driver is associated with a SQL parameters file (<driver>.prm). This PRM filecontains default SQL parameters used for query generation, date and other operators, andfunctions.

Each PRM file is structured into four groups:

The configuration section holds the SQL parameters used to create andoptimize a universe, for example, COMMA, OWNER, QUALIFIER,and OUTERJOINS_ GENERATION

Configuration

The date operations section holds the date operators available toUniverse Designer and the BusinessObjects end user querying tools.For example YEAR, QUARTER and MONTH options.

Date Operations

The operators section holds the operators available toUniverseDesignerand the BusinessObjects end user querying tools, for example ADD,MULTIPLY and SUBSTRACT.

Operators

The functions section holds the functions available toUniverseDesigner,and the BusinessObjects end user querying tools, for exampleAverage,Sum, and Variance.

Functions

The function list shown in the PRM file never includes a complete list of available functionsfor the designated RDBMS. If additional functions are required for reporting purposes, thePRM file can be adapted and new functions can be added.

When working in Universe Designer, you can add SQL functions directly into the Selectstatement box of an object. If functions are used frequently this way, instead of typing this inevery time, it can be added to the PRM file to appear as a function in the list.

Note: Prior to making any changes in the .PRM file, you need to create a backup. The .PRMfile is a system file. Consult your database administrator before making any changes.

Note: All data access files are now in XML format. Although XML files may be opened in anytext editor such as WordPad or Notepad, only an editor designed for XML should be used toedit such files. Editing XML files without a proper editor may create file corruptionswhich canresult in problems with demonstrations and activities.

Note: Consult the BusinessObjects XI 3.0: Data Access Guide for more information on the .PRMfile.

181Data Access Files—Learner’s Guide

Page 196: Bou320 en Col91 Fv Part Ltr

PRM file function help text

The help text that appears under each functionwhen selected inUniverseDesigner ismaintainedin a separate file. In previous versions of Business Objects products this text was maintainedin the same file as the PRM parameters.

When you add a function to the PRM file, you need to add the Help text for the new functionto the appropriate <driver><language>.prm file.

Each <driver><language>.prm file has the following tags that need to refer to the each functionadded in the PRM file:• Name:

The name tag represents the name of the function. This is the name that appears in thefunction list in Universe Designer, and needs to correspond with the name of the functionin the <driver>.prm file.

• Message:

This tag is split up into two ID tags. The first ID tag represents the help text for the functionthat will be seen in Universe Designer. The second ID needs to convey the function name.

• Arguments:

For each argument set in the function, you can add a help text message to conveywhat typeof argument is expected to be used.

PRM file Configuration Parameters

The configuration section holds the SQL parameters used to create and optimize a universe.These parameters can be edited by altering the default values to a customized setting that canhelp optimize queries run against universes using the target data access driver. As with allparameter files, please make sure that settings are correctly defined and are compatible withthe RDBMS in use. Certain configuration parameters must not be edited. These parametershave values set for use internally within a Business Objects product. Before editing any otherPRM file parameter, you should make a backup copy of the PRM file.

You can view, edit, and add parameters to a PRM file.

Note: Consult the BusinessObjects XI 3.0: Data Access Guide for a full list of configurationfunctions that can be adapted in the PRM file.

The PRM file is also used to allow the use of analytic functions. Analytic functions can be addeddirectly to the Select statement if the RDBMS allows their use. To ensure correct use of thefunctions, the RISQL functions parameter has to be enabled in the PRM file. The following twoparameters need to be added to the configuration section:<Parameter Name="RISQL_FUNCTIONS">RANK,SUM,AVG,COUNT,MIN,MAX,DENSE_RANK,NTILE,ROW_NUMBER</Parameter>

<Parameter Name="OVER_CLAUSE">Y</Parameter>

The first parameter lists the RISQL functions supported by the database. The Over Clauseparameter allowsBusinessObjects products to include aggregate analytic functions (for example,SUM OVER PARTITION BY) when generating SQL. Depending on the database used, in thePRM file you also need to apply parameter rules for the GROUP BY.

Advanced Universe Design—Learner’s Guide182

Page 197: Bou320 en Col91 Fv Part Ltr

Note: Consult the BusinessObjects XI 3.0: Designer's Guide for more information on analyticfunctions and the PRM file.

183Data Access Files—Learner’s Guide

Page 198: Bou320 en Col91 Fv Part Ltr

Advanced Universe Design—Learner’s Guide184

Page 199: Bou320 en Col91 Fv Part Ltr

Appendix CExternal Strategies

Using external strategies in Universe DesignerUniverseDesigner uses built-in automated routines to automatically create universe componentsbased on the database structure. These routines are called strategies and are available from theStrategies page of the Parameters dialog box. These strategies are built-in to Universe Designer.You cannot access or modify them.

You can, however, create SQL scripts that follow a defined output structure to performcustomized automatic universe creation tasks. You can select these from the Strategies pagewith the other strategies.

These user defined and customized scripts are called External strategies. This appendix describesexternal strategies and their use.

What is an external strategy?

An external strategy is an SQL script stored externally to the .unv file, and structured so thatit can be used by Universe Designer to automate object or join creation, and table detectiontasks in a universe. External strategies are stored in an external strategy file with the extension.stg.

There is an STG file for each supported RDBMS. These files can be found in the BusinessObjectsinstallation directory:

C\Program Files\Business Objects\BusinessObjects Enterprise

12\win32_x86\dataAccess\connectionsServer\<RDBMS>\

External strategy files are in XML format. They can be edited or viewed inNotepad orWordpad,but it is recommended to use an XML editor to make modifications.

Accessing External Strategies in Universe Designer

External strategies appear in the drop down list boxes that also list the built-in strategies onthe Strategies page. Each drop down list box corresponds to a strategy type category in theXML file. An external strategy appears in the list with External Strategy prefixing the strategyname as follows:External Strategy:<strategy name>

For example, an external strategy for join creation called Constraints in the Strategy file, appearsas External Strategy: Constraints in the Joins drop down list on the Strategies page.

The Strategies Tab

The Strategies tab of the Universe Parameters dialog box defines how the universe usesinformation from the data dictionary to help you build the universe. A data dictionary is a setof system tables that your RDBMS automatically creates andmaintains about the objects (tables,views, synonyms, owners) in your data source.

185External Strategies—Learner’s Guide

Page 200: Bou320 en Col91 Fv Part Ltr

The information in the Strategy dialog box is accessed by Universe Designer when:• the quick design wizard is used to build a new universe.• your database option for "Extract joins with tables" has been selected in Tools ➤ Options

➤ Database to assist in automatically creating tables and joins for a universe.• tables, objects and joins are inserted via the toolbar icons or via the Insert menu.

There are a number of default built-in strategies that provide a good starting point. However,if you have a data warehouse or DBMS that uses public synonyms (Oracle for example), youwill need to create external strategies to ensure Universe Designer can see those synonyms astables in the table browser.

Built-in strategies can not be modified, so in order to get data source specific requirementsadded to the universe, designers can create customizable external strategies to reflect theirneeds.

Strategies are SQL statements that read the data dictionary tables in your source system. Thereturned query results use that dictionary information to form of a list of potential tables, joins,classes and objects.

In some cases Datawarehouse tables have aDWprefix, for exampleDW_Sales_fact. If a built-instrategy is used to identify potential classes and objects, the proposed classes will also have aDW prefix. Classes and objects need to remain end users focused and should not be portrayedwith confusing prefixes. Instead of using the built-in strategy andmanually remove the prefixes,designers can create a customized strategy that identifies potential classes and objects, and thatdrops the DW from the proposed classes automatically.

Advanced Universe Design—Learner’s Guide186

Page 201: Bou320 en Col91 Fv Part Ltr

Types of strategiesThere are three universe components that strategies interact with: objects, joins, and tables. Tolearn more about how strategies interact with these components we will look at how these areused in the built-in strategies.

Objects

The built-in object strategy determines how Universe Designer reads the table and columninformation from the data dictionary to come upwith potential classes and objects (eitherwhenusing the wizard or when inserting tables). By default, the data source table names are usedas the proposed class names and the table columns are used as the proposed objects names.The built-in object strategy also converts all names to initial caps and removes the underscore(_) from any table and field names.

Joins

Universe Designer has four built-in strategies that automatically create joins in a universe.• Edit manually (none): Joins are not created automatically.• Database keys matching names: When using this strategy, joins are created automatically

between columns that are indicated in the database as primary keys and foreign keys.• All matching column names: This strategy identifies matching column names. When the

column names match between two tables, the joins are automatically inserted, even if thesecolumns are not designated primary or foreign keys.

• All matching numeric column names: When using this strategy, joins are createdautomatically between columns that are numeric andhavematching names. In some schemasprimary and foreign keys can be a date or char type, rather than a numeric value. Thisstrategy would only propose join candidates for numeric fields. If you wish joins to beproposed for numeric, date, or character columns, select the preceding strategy.

Tables

The built-in table strategy selects all physical tables owned by the individual user specified inthe connection parameters. If the owner of the tables in your DBMS is System, then you mustlog in with the user ID System for Universe Designer to find these tables. To avoid users to seeOwner prefixes on tables you DBA can create synonyms (depending on the DBMS used), orcan change the OWNER parameter in the <driver>.PRM file. When setting this parameter toN it drop the owner name from your table prefix and will cause the built-in strategies to lookfor public synonyms and views (for example, the user name specified in the connectionparameters does not necessarily own the physical tables).

Note: Setting the parameter OWNER to N without customizing an external strategy can alsopick up unwanted system tables. If owner prefixes need to be excluded from tables names itis better to use an external table strategy that adapts to those needs instead of using thebuilt-in-strategy.

All these built-in strategies can be used as an example layout for customized external strategies.External strategies allow you to control how the data dictionary is read. They can be a usefulsolution for:

187External Strategies—Learner’s Guide

Page 202: Bou320 en Col91 Fv Part Ltr

• database public synonyms• extracting column comments from your source system and use them as object descriptions• importing metadata from a text file

Accessing new external strategies in Universe Designer

After adding new strategies in the .STG file, you need to restart Universe Designer.

To acces the added strategey :1. Open a universe in Universe Designer

2. Select File ➤ Parameters from the menu bar.

3. Select the Strategies tab.

4. The drop-down arrows allow designers to selectObject, Join, or Table strategies that weredefined in the .STG file.

Advanced Universe Design—Learner’s Guide188

Page 203: Bou320 en Col91 Fv Part Ltr

Appendix DSQL syntaxes for other RDBMS

Alternative SQL syntaxes for other RDBMSThis appendix provides the alternative SQL syntaxes for Oracle, MySQL, and DB2, for theobjects and functions used within this course, sectioned by lesson and topic.

189SQL syntaxes for other RDBMS—Learner’s Guide

Page 204: Bou320 en Col91 Fv Part Ltr

ORACLEThis section provides solution syntaxes for ORACLE, based on SQL examples used in thecourse.

Lesson 3 - Using database functions in objects

OracleSQL Server

Substr()Substring()

Instr() function. Can be used as:instr('some string','search string')instr('some string','search string',position)instr('some string','search string',position,occurence)

CharIndex() Course example syntax:instr(CLIENT.CLIENT_AREA_CODE,' ')

substr(CLIENT.CLIENT_AREA_CODE,1,instr(CLIENT.CLIENT_AREA_CODE,' ')-1)

Length()Fn_Length()

Substr()

Substr() returns part of a character string beginning at startposition, length characters long.

Fn_Right() (orRight(,))

if start is positive, Oracle counts from the beginning of the string.

if start is negative, Oracle counts backwards from the end of thestring.

if length is omitted, Oracle returns all characters to the end of thestring.

This example returns the first four characters of the Client Namecolumn:substr(CLIENT.CLIENT_NAME,1,4)

Substr()

This example returns the last four characters of the Client Namecolumn:substr(CLIENT.CLIENT_NAME,-4)

Fn_Left() (or Left(,))

Ceil()Ceiling()

Floor()Floor()

Round( number, [ decimal_places ] )Round()

Advanced Universe Design—Learner’s Guide190

Page 205: Bou320 en Col91 Fv Part Ltr

OracleSQL Server

CAST()CAST()

CASE WHEN THEN ELSE END or Decode()

Course example syntax:CASE instr(CLIENT.CLIENT_PHONE_NO,'(')WHEN 0 THEN CLIENT.CLIENT_PHONE_NO ELSE

CASE WHEN THEN ELSEEND

substr(CLIENT.CLIENT_PHONE_NO,instr(CLIENT.CLIENT_PHONE_NO,'('),instr(CLIENT.CLIENT_PHONE_NO,')')) END

Lesson 3 - Constructing relative date-time objects

OracleSQL Server

Oracle uses TO_CHAR() to extract date parts:TO_CHAR(SALE.SALE_DATE,'Q')

{fn year()}

{fn month()}

You can add the following parameters to the To_char functionto extract date parts:

{fn week()}

{fn dayofweek()}

Year, spelled outYEAR

Datepart(qq, )

4-digit yearYYYY

Quarter of year (1, 2, 3, 4;JAN-MAR = 1).Q

Month (01-12; JAN = 01).MM

Abbreviated name of month.MON

Name of monthMONTH

Week of year (1-53) where week 1starts on the first day of the yearWW and continues to the seventh dayof the year.

Week of month (1-5) where week1 starts on the first day of themonth and ends on the seventh.

W

Week of year (1-52 or 1-53) basedon the ISO standard.IW

Day of week (1-7).D

Name of day.DAY

191SQL syntaxes for other RDBMS—Learner’s Guide

Page 206: Bou320 en Col91 Fv Part Ltr

OracleSQL Server

Day of month (1-31).DD

Day of year (1-366).DDD

Abbreviated name of day.DY

To add a "Q" for formatting:CONCAT('Q',TO_CHAR(SALE.SALE_DATE,'Q'))

DATEADD ( datepart , number, date )

You can also use the Add_Months() function.DateAdd()

Substr()

There is no real equivalent in Oracle. You can usemonths_between(date 2, date 1)or subtract one date directlytfrom another date.

DateDiff()

To_Char()DateName()

Sysdate() or current_date()Current Date

to_date(to_char(Sysdate(),'YYYY') 'YYYY')Current Year

to_date(to_char(Sysdate(),'MM') 'MM')Current Month

Add_Months(12,sysdate())Next Year

to_date(to_char(@Select(Sales Dates\Sales DatePrompt),'YYYY') 'YYYY')

Sales Year Prompt

to_date(to_char(@Select(Sales Dates\Sales DatePrompt),'MM') 'MM')

Sales Month Prompt

Lesson 4 - Working with advanced LOVs

OracleSQL Server

SELECTmax(TO_CHAR(RENTAL.SALE_DATE,'MM'))

SELECTmax(Datename(mm,RENTAL.SALE_DATE))

FROMFROM

SALE RENTAL SALE RENTAL

WHEREWHERE

( RENTAL.SALE_TYPE='R' ) ( RENTAL.SALE_TYPE='R' )

GROUP BY TO_CHAR(RENTAL.SALE_DATE,'MM')),GROUP BY Datename(mm,RENTAL.SALE_DATE), Datepart(mm,RENTAL.SALE_DATE)

TO_NUMBER(TO_CHAR(RENTAL.SALE_DATE,'MM'))

Advanced Universe Design—Learner’s Guide192

Page 207: Bou320 en Col91 Fv Part Ltr

OracleSQL Server

ORDER BY

TO_NUMBER(TO_CHAR(RENTAL.SALE_DATE,'MM'))

ORDER BY Datepart(mm,RENTAL.SALE_DATE)

SELECTmax(TO_CHAR(RENTAL.SALE_DATE,'D'))

SELECT

FROMmax(datename(weekday,SALE.SALE_DATE)) SALE RENTALFROMWHERE SALE ( RENTAL.SALE_TYPE='R' )WHEREGROUP BY TO_CHAR(RENTAL.SALE_DATE,'D')), ( SALE.SALE_TYPE='S' )

GROUP BY TO_NUMBER(TO_CHAR(RENTAL.SALE_DATE,'D'))Datename(weekday,SALE.SALE_DATE),ORDER BY {fn dayofweek(SALE.SALE_DATE)}

TO_NUMBER(TO_CHAR(RENTAL.SALE_DATE,'D'))ORDER BY{fn dayofweek(SALE.SALE_DATE)}

TO_CHAR(RENTAL.SALE_DATE,'Day') + '- '+ TO_CHAR(RENTAL.SALE_DATE,'D')

CAST({fn dayofweek(SALE.SALE_DATE)} as Varchar) + '- '+ datename(weekday, SALE.SALE_DATE)

193SQL syntaxes for other RDBMS—Learner’s Guide

Page 208: Bou320 en Col91 Fv Part Ltr

MySQLThis section provides solution syntaxes forMySQL, based on SQL examples used in the course.

Lesson 3 - Using database functions in objects

MySQLSQL Server

Substring()Substring()

CharIndex()

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

CharIndex()

Length()Fn_Length()

Right()Fn_Right() (orRight(,))

Left()Fn_Left() (or Left(,))

Ceil()Ceiling()

Floor()Floor()

Round()Round()

CAST()CAST()

CASE WHEN THEN ELSE ENDCASE WHEN THEN ELSEEND

Lesson 3 - Constructing relative date-time objects

MySQLSQL Server

Year(){fn year()}

Month(){fn month()}

MonthName(){fn week()}

Week(){fn dayofweek()}

WeekDay()Datepart(qq, )

Quarter()

DATE_ADD(date,INTERVAL exprunit)

SELECT DATE_ADD('1998-01-02', INTERVAL 31 DAY)DateAdd()

Advanced Universe Design—Learner’s Guide194

Page 209: Bou320 en Col91 Fv Part Ltr

MySQLSQL Server

DateDiff() or TO_DAYS(date2) - TO_DAYS(date1)DateDiff()

MonthName()DateName()

WeekDay()

CURDATE() or NOW()Current Date

to_date(to_char(Sysdate(),'YYYY') 'YYYY')Current Year

Month(CURDATE())Current Month

MonthName(CURDATE())

DATE_ADD(CURDATE(), INTERVAL 12 MONTH)Next Year

Year(@Select(Sales Dates\Sales Date Prompt)Sales Year Prompt

Month(@Select(Sales Dates\Sales Date Prompt)Sales Month Prompt

Lesson 4 - Working with advanced LOVs

MySQLSQL Server

SELECTmax(MonthName(RENTAL.SALE_DATE))

SELECTmax(Datename(mm,RENTAL.SALE_DATE))

FROMFROM

SALE RENTAL SALE RENTAL

WHEREWHERE

( RENTAL.SALE_TYPE='R' ) ( RENTAL.SALE_TYPE='R' )

GROUP BY MonthName(RENTAL.SALE_DATE),GROUP BY

Month(RENTAL.SALE_DATE)ORDER BY Month(RENTAL.SALE_DATE)

Datename(mm,RENTAL.SALE_DATE), Datepart(mm,RENTAL.SALE_DATE)ORDER BY Datepart(mm,RENTAL.SALE_DATE)

SELECTmax(WeekDay(RENTAL.SALE_DATE))

SELECT

FROMmax(datename(weekday,SALE.SALE_DATE)) SALE RENTALFROMWHERE SALE ( RENTAL.SALE_TYPE='R' )WHEREGROUP BY WeekDay(RENTAL.SALE_DATE), ( SALE.SALE_TYPE='S' )

195SQL syntaxes for other RDBMS—Learner’s Guide

Page 210: Bou320 en Col91 Fv Part Ltr

MySQLSQL Server

GROUP BY Datename(weekday,SALE.SALE_DATE),

Week(RENTAL.SALE_DATE)ORDER BY Week(RENTAL.SALE_DATE)

{fn dayofweek(SALE.SALE_DATE)}ORDER BY{fn dayofweek(SALE.SALE_DATE)}

CAST(Week(SALE.SALE_DATE) as Varchar) + '- '+ WeekDay(SALE.SALE_DATE)

CAST({fn dayofweek(SALE.SALE_DATE)} as Varchar) + '- '+ datename(weekday, SALE.SALE_DATE)

Advanced Universe Design—Learner’s Guide196

Page 211: Bou320 en Col91 Fv Part Ltr

DB2This section provides solution syntaxes for DB2, based on SQL examples used in the course.

Lesson 3 - Using database functions in objects

DB2SQL Server

Substr()Substring()

LOCATE(<Search String>,<Actual String>, <Starting

Position>)

CharIndex() Course example syntax:substr(CLIENT.CLIENT_AREA_CODE,1,LOCATE(' ',CLIENT.CLIENT_AREA_CODE))

Length()Fn_Length()

Right()Fn_Right() (orRight(,))

Left()Fn_Left() (orLeft(,))

Ceil()Ceiling()

Floor()Floor()

Round( number, [ decimal_places ] )Round()

CAST()CAST()

CASE WHEN THEN ELSE END

Course example syntax:CASE LOCATE(CLIENT.CLIENT_PHONE_NO,'(')WHEN 0 THEN CLIENT.CLIENT_PHONE_NO ELSE

CASE WHEN THEN ELSEEND

substr(CLIENT.CLIENT_PHONE_NO,LOCATE(CLIENT.CLIENT_PHONE_NO,'('),LOCATE(CLIENT.CLIENT_PHONE_NO,')')) END

Lesson 3 - Constructing relative date-time objects

DB2SQL Server

Year(){fn year()}

Month(){fn month()}

MonthName(){fn week()}

DayOfWeek(){fn dayofweek()}

197SQL syntaxes for other RDBMS—Learner’s Guide

Page 212: Bou320 en Col91 Fv Part Ltr

DB2SQL Server

Week()

Datepart(qq, )Day()

DayName()

Quarter()

DB2 adds date values by using "- <datetype>" and "+ datetype"

DateAdd()

SALE.SALE_DATE -5 day

SALE.SALE_DATE +5 day

SALE.SALE_DATE -5 months

SALE.SALE_DATE +5 months

SALE.SALE_DATE -5 year

SALE.SALE_DATE +5 year

timestampdiff() or DateDiff()DateDiff()

MonthName()

DateName() DayOfWeek()

DayName()

DATE() or Current DateCurrent Date

Year(Date())Current Year

Year(Current Date)

Month(Date())Current Month

Month(Current Date)

Year(Current Date + 1 year)Next Year

Year(@Select(Sales Dates\Sales Date Prompt)Sales Year Prompt

Month(@Select(Sales Dates\Sales Date Prompt)Sales Month Prompt

Advanced Universe Design—Learner’s Guide198

Page 213: Bou320 en Col91 Fv Part Ltr

Lesson 4 - Working with advanced LOVs

DB2SQL Server

SELECTmax(MonthName(RENTAL.SALE_DATE))

SELECTmax(Datename(mm,RENTAL.SALE_DATE))

FROMFROM

SALE RENTAL SALE RENTAL

WHEREWHERE

( RENTAL.SALE_TYPE='R' ) ( RENTAL.SALE_TYPE='R' )

GROUP BY MonthName(RENTAL.SALE_DATE),GROUP BY

Month(RENTAL.SALE_DATE)ORDER BY Month(RENTAL.SALE_DATE)

Datename(mm,RENTAL.SALE_DATE), Datepart(mm,RENTAL.SALE_DATE)ORDER BY Datepart(mm,RENTAL.SALE_DATE)

SELECTmax(DayOfWeek(RENTAL.SALE_DATE))

SELECT

FROM

max(datename(weekday,SALE.SALE_DATE))

SALE RENTAL

FROM

WHERE

SALE

( RENTAL.SALE_TYPE='R' )

WHERE

GROUP BY DayOfWeek(RENTAL.SALE_DATE),

( SALE.SALE_TYPE='S' )

Week(RENTAL.SALE_DATE)ORDER BY Week(RENTAL.SALE_DATE)

GROUP BY Datename(weekday,SALE.SALE_DATE),{fn dayofweek(SALE.SALE_DATE)}ORDER BY{fn dayofweek(SALE.SALE_DATE)}

CAST(Week(SALE.SALE_DATE) as Varchar) + '- '+ DayOfWeek(SALE.SALE_DATE)

CAST({fn dayofweek(SALE.SALE_DATE)} as Varchar) + '- '+ datename(weekday, SALE.SALE_DATE)

199SQL syntaxes for other RDBMS—Learner’s Guide

Page 214: Bou320 en Col91 Fv Part Ltr

Advanced Universe Design—Learner’s Guide200

Page 215: Bou320 en Col91 Fv Part Ltr

Answer Key

This section contains the answers to the reviews and/or activities for the applicable lessons.

201Answer Key—Learner’s Guide

Page 216: Bou320 en Col91 Fv Part Ltr

Advanced Universe Design—Learner’s Guide202

Page 217: Bou320 en Col91 Fv Part Ltr

Review: Using universe design conceptsPage 2

1. What is a universe?

Answer: The BusinessObjects universe is the semantic layer that isolates business usersfrom the technical complexities of the databaseswhere their corporate information is stored.For the ease of the end user, universes are made up of objects and classes that map to datain 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 storedin the .unv file.

3. What are the main advantages of a universe?

Answer:○ Only the universe designer needs to knowhow towrite SQL andunderstand the structure

of the target database.

○ The interface allows you to create a universe in an easy-to-use graphical environment.

○ Data is secure. Users can see only the data exposed by the universe. Users can only readdata, 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 descriptionof 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 areused in queries and condition/filters and can also be used to drill on in hierarchies andlink on between queries.

203Answer Key—Learner’s Guide

Page 218: Bou320 en Col91 Fv Part Ltr

○ Detail: These objects relate to supportive information and are associatedwith dimensions.They can be date, character, or number type, and may contain a calculation. They areused in queries and condition/filters but cannot be used to drill on or link on betweenqueries.

○ Measure: These objects are dynamic aggregates and are always a number type, containingfunctions like Sum, Count, Average, Max, or Min. Depending on the other objects in thequery, they dynamically aggregate themselves when displayed in the report block.

○ PredefinedCondition/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 ornot. 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 descriptionof 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 fromboth tableswherethe data matches.

○ Outer: This join works in the same way as an equi-join, however there may be data inone table but not the other, and the requirement is for the data to be returned regardless.For example, a join betweenCustomer and Saleswould be based onCustomer ID, howevera customer may still be prospective and not have any records in the sales table, but allcustomers must be reported on regardless of sales.

○ Complex/Theta: This join works on the Between principle. For example, a sales datemay be joined to a begin and also an end date in a table which is date based, for examplesales 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 beused as a flag on a table, then this join would allow that flag to be referenced every timethe table is used in the SQL statement.

○ Self-referencing: A self-referencing join is a join from one column of a table to anothercolumn of the same table. This join should not be used as it creates a loop. Ideally, if thisjoin exists, then the table should be aliased and the appropriate join and cardinalityshould be assigned.

○ Shortcut: A shortcut join is a join that provides an alternate path between two tables. Itimproves the performance of a query by not taking into account intermediate tables, andshortening a normally longer join path.

7. What are the different types of SQL traps that can be found in a schema? How can each ofthese 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

Advanced Universe Design—Learner’s Guide204

Page 219: Bou320 en Col91 Fv Part Ltr

of the relationship. If a query is runwith 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 fieldsbeing used as aggregates and they are at different levels in the path. This can give thesame result as a chasm trap.

○ Resolve - If they can be avoided by using the lowest level of granularity then this isthe best practice, however that isn't always possible. In which case, a combination ofaliases 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 youto the fact you may have a loop.

9. Describe how you would test a measure to make sure the aggregation levels are projectedcorrectly.

Answer:

To test a measure correctly, a minimum of three queries should be created.

1. The measure on its own.

2. Themeasurewith two different dimensions, in different queries. Once the table has beenprojected, remove the dimensions and then add them again using the drag and dropmethod. This checks the aggregation in the report is correct.

3. Applying a total to the tables checks (if they are all the same total) the aggregation levelfrom the database.

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 thequery. For example: UK customers, US customers. Effectively you are saying they mustbe UK and US at the same time, this is a conflict so no data is returned.

2. Creates a flat level at the end of the class making drilling through the hierarchy difficult.

11.Describe the use of the @select function.

Answer: The @select function has no benefit to the end user. However, it does have benefitto the designer, as this is how they can reuse code between objects.

205Answer Key—Learner’s Guide

Page 220: Bou320 en Col91 Fv Part Ltr

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 away of utilizing the indexing in the database to enable queriesto 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 Designclass. The objective is to shift the responsibility for the aggregation to the data source, insteadof the universe This allows for complex and weighted calculations of dimensional subsets,but requires a refresh to the data source in order to display the results in theWeb Intelligencereport.

Advanced Universe Design—Learner’s Guide206

Page 221: Bou320 en Col91 Fv Part Ltr

Quiz: Working with aggregate awarenessPage 28

1. How does the @aggregate_aware function improve query performance?

Answer: It directs the query to run against aggregate tables or summary tables, wheneverpossible.

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 tablesin the structure of the universe is called the ___________________ tool.

Answer: Aggregate Navigation

207Answer Key—Learner’s Guide

Page 222: Bou320 en Col91 Fv Part Ltr

Quiz: Designing advanced objectsPage 57

1. True or False: You can use all database functionality over and above what is listed in thefunctions 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

Advanced Universe Design—Learner’s Guide208

Page 223: Bou320 en Col91 Fv Part Ltr

Quiz: Creating complex predefined conditions andLOVsPage 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 syntaxesare required to achieve this?

Answer: LIKE and %

3. What functions cannot be used in a join definition?

Answer: @select and @where

209Answer Key—Learner’s Guide

Page 224: Bou320 en Col91 Fv Part Ltr

Quiz: Securing universesPage 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 foldersand set appropriate access rights per folder.

Answer: True.

3. True or False. When theUse Single Sign-On when refreshing reports at view time optionis selected for a connection, all users in the CMS that need to use this connectionwill requirehaving their database user credentials set in the CMS.

Answer: False. This only applies to the Use BusinessObjects credential mapping option.

Advanced Universe Design—Learner’s Guide210

Page 225: Bou320 en Col91 Fv Part Ltr

Quiz: Implementing universe life cyclemanagementPage 116

1. True or False. When importing documents from a BIAR file, both the universe name andpath 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 targetrepository, or the CMS database. It can promote content between clusters on the samenetwork (LAN or WAN).

Answer: True.

3. True or False.When using the ImportWizard to promote an object fromone BusinessObjectsEnterprise XI 3.0/3.1 deployment to another, the wizard allows you to use either the objectsCUID or its name and path to determinewhether the object already exists on the destinationenvironment. It also lets you specify what you want the wizard to do when it finds that anobject already exists on the destination environment.

Answer: True.

211Answer Key—Learner’s Guide

Page 226: Bou320 en Col91 Fv Part Ltr

Quiz: Maintaining and optimizing universesPage 147

1. True or False. Adding new tables or columns to the database impacts the reports that arealready 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 thatreferred to the original column.

Answer: True.

3. True or False. Setting the FILTER_IN_FROM parameter to Yesmoves the SELECT clause dataof a query to the FROM clause.

Answer: False.

Advanced Universe Design—Learner’s Guide212

Page 227: Bou320 en Col91 Fv Part Ltr

Quiz: Creating universes from other data sourcesPage 169

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.

2. True or False. A stored procedure is a compiled SQL program, consisting of one or moreSQL 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 Structurepane.

Answer: True.

4. True or False. Stored procedures are represented as Derived Tables, thus they benefit fromDerived Table mechanisms and concepts.

Answer: True.

213Answer Key—Learner’s Guide

Page 228: Bou320 en Col91 Fv Part Ltr

Advanced Universe Design—Learner’s Guide214

Page 229: Bou320 en Col91 Fv Part Ltr

Notes

Page 230: Bou320 en Col91 Fv Part Ltr

Notes

Page 231: Bou320 en Col91 Fv Part Ltr

Notes

Page 232: Bou320 en Col91 Fv Part Ltr

Notes