0% found this document useful (0 votes)
141 views

Bou220 en

Business Objects xi R1 / R2: Advanced Universe Design Learner's Guide DM351R2. Business Objects owns the following U.S. Patents, which may cover products that are offered and licensed by Business Object.

Uploaded by

nasirshaik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
141 views

Bou220 en

Business Objects xi R1 / R2: Advanced Universe Design Learner's Guide DM351R2. Business Objects owns the following U.S. Patents, which may cover products that are offered and licensed by Business Object.

Uploaded by

nasirshaik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 248

BusinessObjects XI R1/R2: Advanced

Universe Design

Learners Guide
DM351R2

Copyright
2007 Business Objects. All rights reserved. Business Objects owns
the following U.S. patents, which may cover products that are offered
and licensed by Business Objects: 5,555,403; 6,247,008; 6,289,352;
6,490,593; 6,578,027; 6,768,986; 6,772,409; 6,831,668; 6,882,998
and 7,139,766. Business Objects and the Business Objects logo,
BusinessObjects, Crystal Reports, Crystal Xcelsius, Crystal
Decisions, Intelligent Question, Desktop Intelligence, Crystal
Enterprise, Crystal Analysis, Web Intelligence, RapidMarts, and
BusinessQuery are trademarks or registered trademarks of Business
Objects in the United States and/or other countries. All other names
mentioned herein may be trademarks of their respective owners.
Last updated: March 8, 2007

C O N T E N T S
About this Course
About this course . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .viii
Audience for the course . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .viii
About the training material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .viii
Preparing for your role . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Reviewing the course materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Reviewing the learning process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x
Reviewing the course objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi

Computer Setup
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
Computer Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
Testing the hardware and software setup . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Setting up for the activities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx
Getting Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii

Lesson 1

Universe Development Process


Understanding the metadata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
What type of database schema is used? . . . . . . . . . . . . . . . . . . . . . . . . . . .
Data warehouses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Online Transactional Processing systems . . . . . . . . . . . . . . . . . . . . . . . . . .
Data Marts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Comparing Data systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Dimensional Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Star and snowflake schemas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Metadata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Data systems versus universe design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Copyright 2007 Business Objects. All rights reserved.

1-2
1-2
1-2
1-3
1-4
1-5
1-5
1-5
1-7
1-8

iii

Universe Development Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-12


Universe Design Phases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-12
Preparation Phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-13
Analysis Phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-15
Planning Phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-17
Implementation Phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-18
Testing Phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-23
Deployment Phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-24
Updating/Maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-24
Pre-packaged solutions: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-25
Best practices for universe design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-26
Best practices for designing your universe . . . . . . . . . . . . . . . . . . . . . . . . . 1-26
Activity: Implementing a Universe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-29
Lesson summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-31
Quiz: Universe Development Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-31

Lesson 2

Universe Parameters
Data access files and connection parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Data Access files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
The SBO file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
The CS.CFG file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
The PRM file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6
Activity: Editing the PRM file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15
BusinessObjects dynamic SQL parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-18
Dynamic SQL Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-18
Adapting Dynamic SQL Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-19
The Join By SQL parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-31
Activity: Dynamic SQL Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-32
Connection and user credential parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-37
Use data source credentials for the connection . . . . . . . . . . . . . . . . . . . . . . 2-37
Activity: User Credentials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-39
Connection Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-43
Advanced Connection Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-43
Custom Connection Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-46
Activity: ConnectInit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-49
Lesson summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-50
Quiz: Universe Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-50

iv

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Lesson 3

Advanced Objects Scenarios


Combining database functions in objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
Using database functions in objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
Activity: Database functions in objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6
Constructing relative date-time objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8
Date functions in objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8
Relative date-time objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10
Activity: Relative date-time objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11
Working with Transact_SQL functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17
Transact_SQL functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17
Activity: Working with Transact_SQL functions . . . . . . . . . . . . . . . . . . . . . . . . . 3-21
Lesson summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-25
Quiz: Advanced Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-25

Lesson 4

Complex Predefined Conditions, LOVs and Joins


Complex predefined conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
Subqueries in Predefined Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
Activity: Subqueries in Predefined Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
@Prompt scenarios in Predefined Conditions . . . . . . . . . . . . . . . . . . . . . . . . 4-9
Activity: @Prompt syntaxes in Predefined Conditions . . . . . . . . . . . . . . . . . . . . 4-11
Advanced LOVs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13
Customize LOVs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13
Activity: Modifying LOVs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-15
Sorting and arranging LOVs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17
Sorting LOVs Chronological . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17
Arranging LOV data as a index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-19
Activity: Sorting and arranging LOVs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-21
Advanced Join syntaxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-24
Defining an @prompt condition in a join . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-24
Defining conditional join paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25
Activity: Complex Joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-26
Lesson summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-27
Quiz: Complex Predefined Conditions and LOVs . . . . . . . . . . . . . . . . . . . . 4-27

Lesson 5

SQL Traps revisited


Chasm Traps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
Chasm traps in a universe schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
Resolving Chasm Traps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4
Fan Traps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8
Resolving Fan traps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10
Activity: Resolving SQL Traps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-14
Lesson summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-16
Quiz: SQL traps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-16

Table of ContentsLearners Guide

Lesson 6

Extended Index Awareness and Derived Tables


Applying Index Awareness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2
What is Index Awareness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2
Index Awareness on a Primary Key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3
What happens behind the scenes? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6
Avoiding joins in tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-7
Multiple Foreign Key entries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-11
Activity: Multiple foreign key entries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-14
Unique and non-unique values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-16
Using Index Awareness objects as result object . . . . . . . . . . . . . . . . . . . . . 6-19
Using an Index Awareness WHERE clause . . . . . . . . . . . . . . . . . . . . . . . . 6-20
Activity: Add WHERE clauses to key entries . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-22
Index Awareness - rules and limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-24
Derived Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-26
Adding Derived Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-26
Activity: Derived Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-30
Lesson summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-33
Quiz: Index Awareness and Derived Tables . . . . . . . . . . . . . . . . . . . . . . . . 6-33

Lesson 7

External Strategies
Creating and using external strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
What is an external strategy? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
Accessing External Strategies in Designer . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
The Strategies Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4
Types of strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4
The output formats of external strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6
Object Strategy output format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-9
Join Strategy output format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-11
Table Browser Strategy output format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-12
Creating external strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-14
Activity: External Strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-16
Lesson summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-22
Quiz: External Strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-22

vi

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Appendix A

Answer Key
Lesson 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-2
Activity: Implementing a Universe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-2
Quiz: Universe Development Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-2
Lesson 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-5
Activity: Dynamic SQL Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-5
Quiz: Universe Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-5
Lesson 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-6
Quiz: Advanced Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-6
Lesson 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-7
Quiz: Complex Predefined Conditions and LOVs . . . . . . . . . . . . . . . . . . . . . A-7
Lesson 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-8
Activity: Resolving SQL Traps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-8
Quiz: SQL traps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-9
Lesson 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-10
Activity: Derived Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-10
Quiz: Index Awareness and Derived Tables . . . . . . . . . . . . . . . . . . . . . . . . A-13
Lesson 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-14
Quiz: External Strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-14

Table of ContentsLearners Guide

vii

viii

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

About this Course


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

Copyright 2007 Business Objects. All rights reserved.

vii

About this course


This training offering is based on BusinessObjects XI R2 Service Pack 2
(SP2). This two-day instructor-led advanced course is designed to give you the
comprehensive skills and in-depth knowledge needed to design universes in
BusinessObjects Designer.
This course involves:

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.

Audience for the course


The target audience for this course is anyone responsible for creating and
designing universes using a Business Objects Enterprise XI R2 SP2
environment. The learners who attend the course will be most successful if
they have prior experience working with Business Objects Designer.

About the training material


The Learners Guide is designed to assist learners who attend the classroom
-based course and contains reference material, generic procedures, activities
and reviews.

viii

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Preparing for your role


To prepare for your role, you need to:

Review the materials for the course.

Review the learning process used in this course.

Review the course objectives.

Reviewing the course materials


The materials included with the course materials are:

Name card.

Activity Guide.
The Activity Guide contains activities and reviews.

Evaluation form.
At the conclusion of this course, provide feedback on the course content,
instructor, and facility through the evaluation process. Your comments will
assist us to improve future courses.

Additional information for the course is provided on the Resource CD or as a


hard copy:

Sample files.
The sample files on the Resource CD can include required files for the
course activities and/or supplemental content to the training guide.
If you access the files from the HTML Table of Contents (TOC) that
automatically appears when you insert the Resource CD, you can save
the files to the desktop using the Save function on the File Download
dialog box.

Additional resources include:

Online Help.
Retrieve information and find answers to questions using each products
Online Help.

About this CourseLearners Guide

ix

Reviewing the learning process


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

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

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

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

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

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

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Reviewing the course objectives


BusinessObjects XI R1/R2: Advanced Universe Design is a classroom-based
course where participants learn to design and maintain BusinessObjects
universes.
The course includes presentation of concepts, demonstration of features,
facilitated discussions, practice activities and reviews.
After completing this course, learners will be able to:

Identify different data sources and metadata

Understand the BusinessObjects universe development process

Define best practices for universe building

Set universe parameters

Create advanced objects

Define complex predefined conditions and joins

Customize list of values

Resolve SQL chasm and fan traps

Define index awareness

Work with derived tables to solve structure and complex objects issues

Create external strategies

About this CourseLearners Guide

xi

xii

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Computer Setup
This section lists the hardware and software setup requirements for trying the
activities on your own.

Copyright 2007 Business Objects. All rights reserved.

xiii

Introduction
The purpose of this setup guide is to provide the information necessary to set
up your computer and ensure the necessary course files are installed if you
want to recreate the learning environment.

xiv

Guidance for learners wishing to recreate the learning environment

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Computer Setup
Hardware
The minimum hardware requirements are:

P3 700MHz

512 MB RAM, 1 GB Recommended

CD-ROM or DVD drive

Software
The software required for this course is:

an operating system: Microsoft Windows 2000 SP4 or 2003.

Note: This course uses SQL Server 2005 which needs a server based
OS. It is therefor not recommended to install this on XP.

a web application server

Note: For a complete list of supported operating systems for servers and
client components, refer to the Platforms.txt with your product
installation

Microsoft Office 2000, 2003, XP

Microsoft SQL Server 2005

Note: A database is required for the Central Management Server (CMS).


This can be set up against a SQL Server 2005 database, or you
can choose to use MySQL. MySQL database server is an opensource database that provides local data storage. By default the
BusinessObjects setup program installs MySQL; and you can
specify this as your database for the CMS.

BusinessObjects XI Release 2 Professional Edition including:

Web Intelligence and InfoView portal

BusinessObjects Designer

Install software according to the instructions in this document.

Computer SetupLearners Guide

xv

To install required software


1

Install one of the following operating systems:

Windows 2000 (SP4)

Windows 2003

Install Microsoft Office 2000 or higher (Microsoft Word, Excel,


PowerPoint, Access).

Install Microsoft SQL Server 2005 using the setup.exe in the Server
folder and by selecting the following installation components

Install one of the following web servers:

Microsoft Internet Information Server (IIS) 5.0 (ISAPI and CGI for
Windows)

Microsoft IIS 4.0 (NT 4 Workstation)

Install one of the following applications for your web server:

Java J2EE environment, 1.4 or higher

Note: A prepackaged version of Tomcat with Apache web server is


provided during the BusinessObjects Enterprise XI installation.
6

Follow the installation procedures listed in the installation guide for:

The directions in the BusinessObjects Enterprise XI R2 Installation


Guide should be followed accepting the defaults whenever possible.

Note: Use stand-alone installations for setup if possible. However, you


can install one server and have all students connect to that server.
7

xvi

After the installation has been completed verify that all servers are
running in the Central Configuration Manager (CCM). To access the CCM
click Start > Programs > BusinessObjects 11.5 > BusinessObjects
Enterprise > Central Configuration Manager.

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Testing the hardware and software setup


To ensure the hardware and software are set up properly, perform these steps
on your machine.

Verify the BusinessObjects Enterprise installation


1

Click Start > Programs > BusinessObjects XI Release 2>


BusinessObjects Enterprise > BusinessObjects Enterprise Java
InfoView.

Log on with user name: Administrator and leave the password blank.

Test InfoView and Web Intelligence by checking if you can see the
eFashion Universe and can successfully run ad hoc queries:
a

Click the New button in the top left, and then from the drop-down
menu select Web Intelligence Document.
You should see the eFashion universe listed.

Click the eFashion universe. This launches Web Intelligence.


If this is the first launch of Web Intelligence, the Java Runtime
Environment (JRE) installer will automatically launch. Accept the
licence agreement and then click OK. This will install the JRE. If you
get a security warning message click Always. As Web Intelligence is
an applet, a JRE is necessary to function properly.

Computer SetupLearners Guide

xvii

Double-click or drag these data objects into the Result Objects box:

Year (under Time period class)

Quarter (under Time period class)

Sales Revenue (under Measures class)

Click the Run Query button at the upper right of the window
It will take a few moments to retrieve the data. The resulting Web
Intelligence document should look like this:

Log off BusinessObjects Enterprise.

Create databases in SQL Server


Attach MotorsAdv.mdf, CRM.mdf, and ChasmFan.mdf files, located on the
resource CD in the Databases folder. These databases contain data for course
activities.
1

Open the resource CD, open the Databases folder, and copy to the hard
drive:
MotorsAdv.mdf
MotorsAdv_Log.ldf
CRM.mdf
CRM_Log.ldf
ChasmFan.mdf
ChasmFan_Log.ldf

xviii

Select Start > Programs > Microsoft SQL Server > SQL Server
Management Studio.

Enter the sa credentials and click Connect.

Right-click Databases and select Attach.

Click Add. Browse to the location where the database files were copied
to and select the MotorsAdv.mdf file.

Click OK twice.

Repeat the steps to attach the CRM and the ChasmFan databases.

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Create new ODBC data sources


1

From the Windows Control Panel, click Administrative Tools, and then
click Data Sources (ODBC).

Click the System DSN tab, and then click Add.

Scroll down to select the SQL Server driver, and then click Finish.

In the Name box, type MotorsAdv.

In the Server box, select (local) - unless SQL Server is installed on


another machine. In that case, select the machine name from the list.

Click Next.

Select the With SQL Server authenticaion.....by the user option.


Selecting this option enables boxes at the bottom of the dialog box.

For Login ID, type sa.

For Password, type the password for the sa account.

Click Next.

Select the Change the default database to check box, and then select
the MotorsAdv from the drop-down list

Click Next, and then click Finish.

Click Test Data Source.

10 You should get the message TESTS COMPLETED SUCCESSFULLY.


If you dont get this message, review your steps and/or go into SQL
Server Enterprise Manager and verify the password for the sa account.
11 Click OK until you can close the Administrative Tools window.
12 Repeat the above steps to create a connection to the CRM database.

For the DSN name, type CRM.

For the default database, select CRM.

13 Repeat the above steps to create a connection to the ChasmFan


database.

For the DSN name, type ChasmFan.

For the default database, select ChasmFan.

Computer SetupLearners Guide

xix

Setting up for the activities


Setting up the MotorsAdv universe.
1

From the resource CD MotorsAdv Universe folder, copy the


MotorsAdv.unv file to the Desktop.

Click Start > Programs > BusinessObjects XI Release 2 >


BusinessObjects Enterprise > Designer.

Log on as Administrator (no password).

To close the Quick Design Wizard, click Cancel.

Click File > Open.

Navigate to the Desktop and open the universe named MotorsAdv.

Create a secured connection named MotorsAdv.


1

Click File > Parameters.

Below the Connection box, to start the New Connection wizard, click
New and then click Next.

To select the Data Access driver for the connection, expand the
Microsoft node, expand the MS SQL Server 2005 middleware node,
click ODBC Drivers, and then click Next.

Type, select or accept these login parameters to access your


middleware, and then click Next:

Type: Secured

Name: MotorsAdv

User name: sa

Password: password credentials associated with the sa login

Data source name: MotorsAdv

Click Test Connection to verify the data source server, and then click
Next.

To accept the Advanced Parameters defaults when accessing your


middleware, click Next.

In the Custom Parameters dialog box, to create the connection, click


Finish. The newly created connection will appear in the Parameters
Connection box. Click OK to close.

To save the universe with the new connection, click File > Save.

To export the universe, click File > Export, and then click OK twice.

10 Ensure that the MotorsAdv.unv file is available in Web Intelligence.

Create a secured connections for the CRM and the ChasmFan


databases.

xx

In Designer, select Tools > Connections.

To start the New Connection wizard, click Add and then click Next.

To select the Data Access driver for the connection, expand the
Microsoft node, expand the MS SQL Server 2005 middleware node,
click ODBC Drivers, and then click Next.

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Type, select or accept these login parameters to access your


middleware, and then click Next:

Type: Secured

Name: CRM

User name: sa

Password: password credentials associated with the sa login

Data source name: CRM

Click Test Connection to verify the data source server, and then click
Next.

To accept the Advanced Parameters defaults when accessing your


middleware, click Next.

In the Custom Parameters dialog box, to create the connection, click


Finish.

Repeat the same steps to add a secured connection for the ChasmFan
database based on the following parameters:

Type: Secured

Name: ChasmFan

User name: sa

Password: password credentials associated with the sa login

Data source name: ChasmFan

To add samples files


1

For Lesson 7 sqlsrv.stg files are required that are not installed by default.
Sample template files are on the resource CD:
\Activity Solution Universes\Lesson 7\Template sqlsrv.stg files.

Copy these files to the following directory:


C\Program Files\Business Objects\BusinessObjects Enterprise
11.5\win32_x86\dataAccess\connectionsServer\ODBC\

Computer SetupLearners Guide

xxi

Getting Help
If you encounter difficulties installing the software when recreating the learning
environment, refer to the Installation document found on the product CD or
contact Business Objects Customer Support. For a current contact list visit
http://support.businessobjects.com.

xxii

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Lesson 1

Universe Development Process


To design effective and efficient universes for your business users, you need a
general understanding of the underlying metadata and database structure used.
It is important to become familiar with how this data can be best implemented and
to know the steps for building a successful universe.
In this lesson you will learn about:

Understanding the metadata

Universe Development Cycle

Best practices for universe design

Duration: 2 hours

Copyright 2007 Business Objects. All rights reserved.

1-1

Understanding the metadata


Before developing a universe you have to familiarize yourself with the data to
be used. Universe development requirements may differ depending on the
type of data storage system used. This unit will look at different types of data
storage systems.
After completing this unit, you will be able to:

Describe Data Warehouse components and characteristics

Describe OLTP components and characteristics

Describe Data Mart components and characteristics

Describe Metadata

Describe how to implement the used metadata model into a universe


schema

What type of database schema is used?


The role of the universe is to present a business-focused front end to the SQL
structures in the database. The data used in a universe schema depends
greatly on the end user requirements. It needs to provide an easy-to-use
interface for end users to run queries, create report and perform data analysis.
Before developing a universe you must familiarize yourself with the underlying
data. Which type of database schema is going to be used for the universe? Will
this be a Data Warehouse model, an Online Transactional Processing system
(OLTP), or a Data Mart? How can you best implement the metadata into a
universe schema to meet the end user requirements?

Data warehouses
A data warehouse is an enterprise wide centralized storage facility for different
types of data. Data stored in a data warehouse is characteristically subject
oriented, time sensitive, and should be organized in a way that allows data
analysis. For example, a data warehouse can contain customer information
and sales details per customer, over the past five years. These customer
details and sales records are often derived from several production systems in
the enterprise. Performing query and trend analysis on this dispersed data can
prove to be a difficult task.
This is where data warehousing comes into play. Data warehousing is the
process of collecting, aggregating, storing, and maintaining information so that
it may lead to accurate business decisions. Some characteristics and features
of data warehousing are as follows:

1-2

Provides a consolidated storage of information from across the


enterprise.

Warehoused data is organized by subject area and is populated from


many operational systems.

Can act as a decision support system.

Generally concerned with historical data and aggregates.

Added to regularly, but loaded data is rarely ever directly changed.

Regular schedule of dumps and loads from operational data stores.

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

All these features differentiate data warehouses from typical operational


database systems. Data warehouses are commonly kept on separate
machines that can be tuned for a lower frequency of users with different
querying characteristics. Data warehouses are usually read-only based
systems, aside from the periodic loading of current information.

Online Transactional Processing systems


Operational database systems deal with handling many users and
transactions. These databases are often referred to as Online Transactional
Processing systems (or OLTP). These operational databases are continuously
used systems in which users add, update, and query the stored information.
An example of an OLTP is a typical order-entry application. A customer calls a
call center and orders products from a catalog. The sales representative
answering the call can pull up the order entry screen and enter the line items
the customer desires. Whenever an order is placed it triggers inventory
allocations. This seems like a relatively small process, but it will have
generated many records, and many underlying transactions. This type of
OLTP system requires transactions to be speedy and inventory levels to be
accurate. The sheer volume of these diverse operations and the amount of
data that is produced provide a poor environment for decision support.
OLTP systems have been designed to support the primary business processes
and are optimized for transaction processing. To avoid data redundancy and
possible data conflicts the data model has been normalized. An OLTP
environment is not necessarily designed for querying and reporting, which can
potentially make universe design based on an OLTP a bit more challenging.

Universe Development ProcessLearners Guide

1-3

Data Marts
A data mart is a repository of data gathered from operational data or other
sources and is designed to serve a particular department or functional group.
It is similar to a Data warehouse, but there would be a difference in size and
focus. The emphasis of a data mart is on meeting the specific demands of a
particular group of users. These users can run reports and analyze data stored
in the data mart that is designed to portray information based on their group
requirement needs.
A common approach to using data marts is to keep data at a detail level in the
data warehouse and summarize this information into the data mart for each
functional group or department.
Sometimes data marts are designed for each departmental unit, and all
departmental data marts are merged later on into an enterprise-level data
warehouse.
Either method offers the benefit of centralizing the information for the end
users. Some characteristics of data marts are as follows:

Data specialized for a particular group of an organization.

Engineered for easy access.

Optimal response from lower volume queries.

Due to more simplified and specialized nature of data marts, organizations are
turning to data marts, as a quick solution to their decision-support needs.

1-4

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Comparing Data systems


The table below outlines the differences and similarities between the three
major types of data storage systems.

Data Warehouse

OLTP

Data Mart

Optimized for bulk


loads and large,
complex queries

Transaction oriented
around entities and
relationships

Developed to access
specialized departmental
data for query and
analysis

Fewer tables,
de-normalized
schema

Many tables, relational


(normalized) schema

Highly de-normalized
schema

Consolidated and
summarized rows

Many detail rows

Summarized rows

Vast indexes for optimized queries

Smaller indexes for


speedy updates

Large indexes

Historical data

Always currently accurate data

Historical data

Designed for Enterprise-wide analysis of


business measures
and dimensions by
categories and
attributes

Designed for real-time


business operations

Designed for departmental


needs and contains a
smaller, more specialized
volume of data

Dimensional Modeling
The traditional entity relationship (ER) model uses a normalized approach to
database design. Normalization removes redundancy from the schema to
optimize storage. Data warehousing is not that concerned with saving space.
It is more concerned with meeting the decision support needs. A small amount
of redundancy is usually acceptable.

Star and snowflake schemas


Dimensional modeling is a more appropriate approach to the warehouse
design. With dimensional modeling you separate the business data into logical
events or facts and a set of corresponding dimensions.

Universe Development ProcessLearners Guide

1-5

This results in a schema that is commonly referred to as the star schema. This
schema will normally contain a large and centralized fact table which branches
off into many small dimension tables, resembling a star-like layout.

Fact Tables
The fact table that sits in the centre of this star schema usually contains
business events recorded over time. Examples of data that can be found in this
table are: sales transactions, orders and returns, bank transactions,
shipments, etc.
The fact table normally consists of a set of numeric values and a number of
foreign keys that correspond to primary keys in the various dimension (lookup)
tables. The information stored in the fact tables is usually static as it is
historical. The most common example of a fact table in the star schema is for
sales.

Dimensions
The dimension tables consist mainly of descriptive information linked to fact
records. Example of dimension data are: customer names, product
descriptions, suppliers, and vendors. Dimension tables contain fewer records
than the facts table. An important factor is that the information in dimension
tables is not static as records in dimension tables can be updated. For
example, a customer address might be modified in the source system.
A typical data warehouse schema will always use dimension tables or tables
that deal with periods of time. These tables are the key element to tracking the
time variant information in these types of databases.

1-6

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Sometimes a more normalized approach is taken to the dimension tables.


When this happens the star schema changes to a snowflake (or constellation)
schema. A snowflake schema is basically one fact table, connected to a
number of dimension tables, and these dimension tables in turn are connected
to additional dimension tables

In a snowflake schema it is also common to include aggregations across


dimensional hierarchies, for example sales values summed up by store. These
sales values can also be summarized into separate fact tables by region or
district.
The dimensional model is a logical technique optimized for queries and
reporting. It is the most common model used in current data warehousing or
data mart designs. It provides simplified hierarchical paths that would enable
end users with drill-down analysis capabilities. Precalculated aggregations can
be also embedded in the fact tables, which can result in rapid query-response
times.

Metadata
Metadata is defined as data about data and is one of the most ambiguous
terms in use in our industry.
In Business Objects terminology, metadata usually refers to the universe or
semantic layer. It represents all the universe classes and objects and how they
are defined and mapped to the source system.
In the data warehousing world, metadata refers to the business and technical
definitions of each of the elements in the warehouse. This can get complicated
due to the extraction and transformation steps that a given element may have
gone through.

Universe Development ProcessLearners Guide

1-7

Different types of metadata


Without access to metadata, users will have a hard time accepting that the
transformed data in the warehouse is correct and will hesitate to use it.

Source System Metadata: each element used in the warehouse and its
location and definition in the source system.

Extract Metadata: the name of each extract file and the elements
contained therein along with any technical information (location in the file,
field length, etc.).

Data Warehouse Metadata: physical data element name, data type,


length and source table from the data warehouse plus summary of the
transformation applied.

End User Metadata: names as they appear in the end-user tool with
business descriptions. It may also provide users with information on the
accuracy of data in the form of a summary of transformation from data
warehouse.

The end user metadata level is what a universe designer needs to keep in
mind. By using the semantic layer interface, end users can be presented with
easy-to-use metadata that will allow them to run queries and perform data
analysis via the BusinessObjects end-user querying tools.

Data systems versus universe design


Depending on the type of data storage system or database schema used as a
universe data source there are a few things to take into consideration.

Basing a universe schema on an OLTP data source


An OLTP environment is not necessarily designed for querying and reporting,
and you may encounter more challenges when you create a universe on such
a structure.
An OLTP system is based on normalized data and your required data can be
stored in a variety of different tables. In your universe schema you may need
to use more tables and joins than you would when using a data warehouse as
your data source. With more tables and joins in your schema you are more
likely to encounter loops, and other SQL Trap scenarios. In an OLTP system
fan and chasm traps are quite common.

1-8

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Unlike with the data warehouse star or snowflake schemas where you would
be looking at mainly equi-joins, an OLTP will require more complex theta joins.
Data in an OLTP is not subject orientated and organized to allow easy query
and analysis. It will likely be just simple field definitions, and you would need
to use database functions, calculations, conditional logic to define the
appropriate objects. Sometimes this implies adding your own user functions to
allow additional calculation options for your objects.
Sometimes data required to report on may originate from multiple sources. In
a universe you can only connect to one data source. In order to get the
required data into your universe schema, it may mean that you are required to
work with database solutions of views and synonyms depending on the
Database Management System (DBMS) used.
Data in an OLTP is based on current transactional input. The problem with this
is that there may not be a specific calendar type value or table available. The
date information you would work with is based on transaction dates.
This may lead to missing records. If no order has been placed in a certain
month for a specific customer you may end up with a missing month value in
an output report or chart. Querying and reporting directly against an
operational system will cause some performance of transaction processing
issues. Large number of input/output transfers, some data operations like
sorts, database functions and complex join syntaxes are CPU intensive. These
can lead to potential bottlenecks. Additionally, the select query can cause read
locks on rows and pages. During a read lock a row cannot be updated or
deleted. Locking of data rows and pages can cause transactions to be
delayed.
Sometimes an exact copy of the original database is made for querying and
reporting so that it will no longer affect the performance of OLTP transactions.

Universe Development ProcessLearners Guide

1-9

Basing a universe schema on a data warehouse or data mart


data source
A data warehouse or data mart environment is created specifically for query
and reporting needs. Creating a universe on such a structure generally poses
little problems.
Take into consideration when designing a universe schema based on a data
warehouse structure is that facts and fact related descriptions could be stored
in one row. For example, a fact table may contain a catalogue_code, the
catalogue product description, product characteristics, and number of items
left in stock. No joins are needed to retrieve information, however, having all
information in one table can limit hierarchical methods used in a universe
structure and limits the use of drill mode functionality.
Defining hierarchies can also pose a problem when building a universe based
on a star schema. In a star schema structure all data about facts are stored in
a fact table together with foreign keys to link the facts to the corresponding
dimension values. Each dimension is a single table; there is no relation
between the dimension tables themselves. Hierarchical levels of the same
functional dimension are modeled as separate dimensions.
A question like: Which departments fall into which region?, is impossible to
answer without going through the fact table. However in the universe you can
resolve this in some cases by using short-cut joins to by-pass the fact table.
The snowflake schema can resolve this problem. In a snowflake structure
foreign keys link the fact table to the corresponding lowest known hierarchy
level of a related dimension. Each dimension can be linked to several further
dimension tables that can be used as further hierarchy levels. This relation
between dimension hierarchies makes scope of analysis or drill down
reporting possible. Snowflake schemas are in general easier schemas to base
your universe on.
An advantage of a data warehouse is that there is no real need for complex
joins. In most data warehouses, generated keys are used to identify table
rows. Therefore you can almost always use an equi-join to get from table to
table. An exception is the use of aggregation functions.
In a well-designed Data Warehouse you will need little or no functions to
present the objects the user wants. You do need to take into account that the
tables used to create the objects from will contain vast amounts of data. Data
restriction methods should be taken into consideration and aggregations
should preferably be done at database level instead of report level to avoid
performance issues. Objects that need to have a list of values assigned must
be based on smaller lookup tables, or the LOV needs to conditionally
restricted.
Another thing to consider is the history in the dimension values. Many users
will be happy enough to report historic facts against the current organization or
product grouping. However in some cases this is not enough and the data
warehouse will have to be designed to keep track of slowly changing
dimensions. When this happens there will always be a group of users that want
facts rolled up to historic dimensions and others to current dimensions.

1-10

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

To solve this you can have two separate dimension classes, one with current
data and one with historical data.

OLTP versus Data warehouse data source


The table below summarizes the potential issues that you may encounter in
your universe design.

OLTP

Data Warehouse

Normalized - many more tables and


joins in the universe schema.

Subject orientated - data used for


objects comes from only a few designated tables.

Complex theta-joins rather than equijoins

Mainly equi-joins

More chances to have loops and


SQL Traps

With star and snowflake schemas


there are few loops and SQL Trap
encounters

Complex object creation, requiring


calculations and merges of data from
several tables and/or sources

Subject orientated and objects are


easy to build of existing tables

Possible missing records

Many historical time based references - not much chance of having


missing data

Hierarchy levels are easy to define

Only snowflake schemas can work


well for hierarchy levels

Not much scope for historical data

Good resource for historical data

Potential CPU, bottleneck and row


locking issues when reporting on an
operational data source

Static fact data - no real bottleneck or


locking issues, but large amounts of
data need to be restricted to not affect
performance.

Universe Development ProcessLearners Guide

1-11

Universe Development Cycle


Universe development is a cyclical process that includes planning, designing,
building, distribution, and maintenance phases. Use Designer to design and
build a universe. However, the usability of any universe is directly related to
how successfully the other phases in the development cycle interact with each
other.
After completing this unit, you will be able to:

Identify the Universe Design Phases

Universe Design Phases


This unit presents an overview of a universe designing methodology that you
can use to plan and implement a universe development project.
A BusinessObjects Universe is best developed using a structured process.
Development tasks can be grouped under the phases of the universe
development cycle, as outlined in the table below:
Development
Phase

Description

Preparation

Identify the target data source and become


familiar with its structure.

Know what data is contained within each table of


the target databases.

Understand the joins.

Identify the cardinality.

Understand limitations.

Identify the user population and how it is


structured. For example, is the user group
structured by department or by task?

Identify what information the users need.

Identify what standard reports users require.

Familiarize yourself with company business


terminology so you can name objects
meaningfully.

Planning

Identify a project strategy. For example,


determine the number of universes required, the
universes to link together and the level of those
links.

Implementation

Build the universe using Designer.

Test frequently during the build process for


validity and reliability of inferred SQL.

Analysis

1-12

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Development
Phase

Description

Testing

Form a small group of users, preferably Web


Intelligence power users who have some
knowledge of what information they expect to get
from the universe. Ask the users to perform
thorough tests simulating live use of the universe.

Deployment

Distribute the universe by exporting it to the


repository, where it can be accessed by end
users.

Updating/

Update and maintain the universe as the data


sources and user requirements change and grow.

Maintenance

Preparation Phase
During the preparation phase, the scope of a BusinessObjects universe is
defined.The production and development architectures are identified and
reviewed. Project teams are assembled and the initial task plan is defined.

Identify Universe Scope


The definition and communication of project scope eliminates risk associated
with deploying the universe to pilot users during Implementation. Identification
of scope should be the first project objective.
The scope is defined in terms of intended functionality of the universe. Specific
business processes to be supported are spelled out. Identification of target
users of the universe also helps create a shared understanding of project
objectives.
Key managers should be involved in the scoping process. Once formulated,
the objectives of the project are communicated to everyone involved, directly
or indirectly.

Build a Project Team


In designating the team members, individuals must be chosen to fill the
following roles. One person may fill multiple roles.

Role

Task

Sponsor

Usually the individual funding the project. The project


sponsor makes any final decisions regarding scope or
unresolvable issues.

Project Leader

The project leader develops the project plan, assigns


resources, tracks, and reports on progress.

Analyst

Individual who gathers requirements in the form of


candidate objects.

Data Expert

An individual familiar with the data structures.

Key User

Provides ongoing business perspective for developers.

Universe Development ProcessLearners Guide

1-13

Role

Task

Pilot Users

Users who will work with the universe during the universe
build and development phase.

QA Reviewer

An individual with BusinessObjects experience who is not a


part of the development process will perform a technical
review of the final product.

In most cases, a single person will be responsible for the bulk of the work,
filling the roles of Analyst, BusinessObjects Administrator, and Data Expert.
In designing and building the Universe, this person will maintain a relationship
with the Key User, who should also be one of the Pilot Users.
This developer usually reports to a Manager or IS Director, who serves as
Project Leader. The Leader maintains a close relationship with the Sponsor.
Other roles that will be impacted by the project include the Database
Administrator, the System Administrator, and the Data Administrator.

Adopt Standards
Standards for the components of a BusinessObjects universe will help to
guarantee consistency and stability in the final product. During preparation, the
team adopts a set of standards for BusinessObjects components. If the
enterprise has a data administrator, he/she should be involved in the standard
selection process.
Standards can be specified for:

Universe Names

Object definition guidelines

Names for Simple Objects

Names for Complex Objects

Names for Aggregate Objects

Class Names

Alias Names

Help Text

The standards may be revised during the course of the first Universe
development project as the team becomes more familiar with the product.

Conduct a Meeting
Communicate the preparation phase strategy in a meeting. This is your
opportunity to gather all interested parties (developers, users, the sponsor) to
ensure that everyone understands the scope of the endeavor.
Introduce the team members and be sure everyone understands who is
responsible for what. Briefly discuss the plan, so that everyone understands
how the project will proceed.
Finally, demonstrate BusinessObjects. This will help set expectations of the
user community and is a good lead-in for the interviews that will be conducted
during Analysis.

1-14

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Analysis Phase
The primary objective of analysis activities is to identify user requirements for
the ad hoc query environment.

Identify the user population and how it is structured. For example, is the
user group structured by department or by task?

Identify what information the users need.

Identify what standard reports users require.

Familiarize yourself with company business terminology so you can


name objects meaningfully.

These requirements are captured in the form of candidate classes and objects.

Identify Candidate Objects


There are many places to look for candidate objects. The best way to identify
them is by talking to the end users. When interviewing end users, the
questions to ask are much the same as those used in interviews conducted
during development of an OLTP application (that is, the screens, reports,
and database design of an on-line system).
What type of information do you need to do your job?
How do you know you are doing well? or How does your boss know you are
performing well?
What kind of information do others ask you for?
Additional questions can be added to capture unique ad hoc requirements. For
example: When someone comes to you asking for specific information they
cannot retrieve from a report, what do they ask for?
As users answer these questions, document their answers in terms of class
and object requirements. For example, if a user states, We require to retrieve
information on employees by department and hire date you have identified a
potential Class (information about employees) and an object or two
(department and hire date). When you identify a potential class, probe for
objects. For example, What kind of information about Employees do they
want?
Candidate classes and objects can also be identified by reviewing existing
reports, any special summary reports that are hand-produced for managers,
etc. If available, interview notes conducted during the Analysis phase for the
development of the OLTP system should also be consulted.

Relational Modeling versus Multi-Dimensional Modeling


The questions asked during BusinessObjects interviews are similar to those
asked in the development of OLTP applications. What is done with the
answers is very different.
When conducting Analysis for an OLTP application, analysts document data
requirements in entity relationship diagrams. Rules of normalization are
applied to the items that users request, breaking them down to an atomic level,
eliminating calculated objects, etc. These activities optimize the data for
storage in a relational database.
By contrast, requirements for an ad hoc query environment should be
expressed in terms that are optimized for retrieval of the information.

Universe Development ProcessLearners Guide

1-15

A successful BusinessObjects universe presents information to a business


person using user specific business terminology.
The developer must unlearn analysis techniques used for the development
of application systems. User requirements must be taken at face value,
remaining in business terms. Basic rules of thumb:

Do not normalize

Do not eliminate objects that can be derived from other objects

Do not try to figure out where this data can be found in the database

For example: in an interview, a user states I need to look at annual sales


figures by region. Document this at face value; identify the requirements, but
do not attempt to transform them in a manner appropriate for storage in a
relational database. You can identify three candidate objects: Year of Sale,
Sales Amount, and Region. Do not eliminate Year of Sale because you
have already documented a Date of Sale object. Do not reduce Sales to the
components from which it is calculated (perhaps quantity multiplied by
price). Instead of normalizing object requirements, identify how they will
support on-line analysis by end users.
Objects that provide statistical information are called measures. They are
always quantitative in nature, and represent aggregates (sums, averages,
counts, etc.). Sales Revenue is a good example of a measure. In multidimensional modeling parlance, measures are often referred to as facts.
Dimension objects describe actual things, and are used to qualify measures.
Region and Product are examples of dimensions. Combine the Region
dimension with the Revenue measure to see Revenue by Region. Add the
Product dimension and youve got a two dimensional matrix showing Revenue
by Region and Product. Adding or rotating dimensions like this allows users
greater flexibility in their report designs and more effective analysis
functionality. Users will only be able to do this if you have carefully planned
your measures and dimensions.
Dimensions can have details associated with them. For example, a Customer
dimension may have Address and Phone Number details associated with it. In
multi-dimensional modeling, these details are often referred to as attributes.
Tip: Do not assume that numeric data is always the source of a measure. It
must make sense to aggregate the information for it to be suitable as a
measure. Summing up Sales Revenue makes perfect sense; it is a measure.
But it does not make sense to aggregate List Prices of products; List Price is
a dimension, or perhaps a detail for the Product dimension. You will also find
that you can create measures where there is no numeric data, simply by
counting things. This can result in measures like Number of Orders.
Identifying candidate objects as Dimensions, Details or Measures will facilitate
end user reporting and analysis flexibility. You can also plan for Scope of
Analysis (drill-down and drill-up options) by identifying dimensional
hierarchies.
A hierarchy allows you to specify a dimension at different levels of granularity.
You might have a customer hierarchy that allows the user to drill down from
Continent to Country to City and finally to a specific Customer. Time
dimensions make good hierarchies; you can break them down as Year,
Quarter, Month and Date.

1-16

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Document Class and Object Requirements


The candidate classes and objects are documented. Tables can be used to
present the candidate objects, grouped into classes together with each class
and object requirement. The source of the requirement can also be
documented. For example:

Type

Name

Description

Source

Class

Customer

Information on a customer,
including location, credit
ratings, and shipping
preferences.

Interview #1

Object
(Measure)

Total revenue

This object can be


combined with date ranges,
customers, and/or products
to provide meaningful
measures.

Interview #3,4

You should also try to document the qualification of objects (dimension/detail/


measure) and any potentially identified hierarchies. Once you have
documented requirements in the form of candidate objects, you are ready to
begin to plan the BusinessObjects universe requirements.

Planning Phase
The planning phase will be used to identify a project strategy and determine
resource requirements.

Create a Project Plan


The project plan is the key to timely implementation. For each task, the plan
should assign responsibility and target dates. Creation of the plan and the
tracking of progress against the plan are the primary responsibilities of the
project leader.

Universe Development ProcessLearners Guide

1-17

Plan the BusinessObjects Architecture


Technical architecture requirements may have been looked at in general in the
preparation phase. A review of the technical architecture should take place
during the planning phase of the project. Items to review include:

Development
Environment

Identify resources required to support a universe development environment. Identify source for development data.
Verify appropriate connectivity. Initiate any changes or purchases required and plan their implementation

Production
Environment

Identify resources required for a universe production environment. Locate source of production data. Verify connectivity. Initiate any changes or purchases required and plan
their implementation.

Computers

Review required computing resources for developer and


user workstations. Initiate any changes or purchases
required and plan their implementation.

Connectivity

Ensure infrastructure is in place to support connectivity


between users/developers and the repository and data
stores, including appropriate middle-ware to support
communication between clients and servers. Initiate any
changes or purchases required and plan their
implementation.

Configuration

Identify planned configuration for client software (serverbased, local workstation, combination). Ensure appropriate resources are available. Initiate any changes or purchases required and plan their implementation.

Security

Initiate a first look at security requirements. To be refined


during the implementation phase.

Support Plan

Develop support policy that will be followed when the


universe goes into production.
Identify necessary resources.

Change
Management
Plan

Identify procedures for the request, review, approval, and


implementation of changes to the universe once it is in
production. Identify necessary resources.

Training Plan

Plan for a user training program.

Implementation Phase
The Implementation phase can be split up into two stages:

1-18

Designing the schema

Building the universe

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Implementation phase 1; Schema Design


The first task during schema design is to determine and document the data
source for each candidate object. If requirements were gathered in a tabular
format, add a column to the table where you can indicate the SQL fragment
and source tables that will be used to retrieve the object.

Type

Name

Class

Customer

Object
(Measure)

Total
Revenue

SQL fragment

SQL:
sum(order_lines.quantity
* products.price)
Source Tables:

Description

Source

Information on a
customer, including
location, credit ratings,
and shipping preferences.

Interview #1

This object can be


combined with date
ranges, customers,
and/or products to
provide meaningful
measures.

Interview #3,4

ORDER_LINES,
PRODUCTS

Any candidate classes that were captured as general requirements without


specific objects must be expanded now. For example, suppose there was a
candidate class called Customer and the specific objects within this class
were not identified. During the schema design stage, the developer must fill
out this class. The developer might fill it out based on knowledge of the
business by indicating to include all columns from one or more tables, or the
developer might go back to users for more detail.
There are several ways that objects can be mapped to enterprise data. Simple
objects map back to a single column in the database. An example would be
Customer First Name, which maps back to the FIRST_NAME column in the
CUSTOMERS table.
Objects are not limited to a one-to-one correspondence with a database
column; the full range of SQL syntax can and should be exploited to create
objects. Complex objects make use of SQL to manipulate data that comes
from one or more columns. For example, a Customer Full Name object might
connect CUSTOMERS.FIRST_NAME and CUSTOMERS.LAST_NAME. A
Phone Number object might take a phone number from the database and
place parentheses around the area code.
Aggregate objects involve SQL GROUP functions. Counts, Sums, and
Averages are all aggregate objects. The Total Revenue object is an aggregate
object; it uses the SQL SUM function.
Aggregate objects are very powerful because the results they return depend
on the context in which they are used.
The Total Revenue object can be combined with Salesperson Name to see
revenue by salesperson, with Product to see revenue by product, or with a
date range to see revenue over a period of time.

Universe Development ProcessLearners Guide

1-19

Plan for object qualifications and drill-down functionality


As you design the Universe, you must complete the process you began during
analysis. Each objects qualification needs to be identified. Identify each object
as a measure, a dimension or a detail. For each detail object, identify the
dimension it is associated with.
Similarly, you need to identify hierarchies within your dimensions. These
hierarchies will later enable users to drill-down and drill-up.

Design a Table Diagram


Now that the objects are mapped back to data sources, the developer reviews
all the objects and produces a table-diagram of the database objects that will
support the Universe. Joins between the tables are then added to the diagram.
The table diagram is a valuable tool for resolving loops in the model. It will also
become an important reference for developers.
Note: This diagram design is usually done on paper, however this can be
created directly in the BusinessObjects Universe Designer software.
Review the table diagram looking for loops. A loop is said to exist when there
is more than one path of joins between two tables. If a loop exists between
two tables, BusinessObjects will not be able to generate the SQL for a query
against the tables; it does not know which path to choose. Any loops in the
model must be resolved. Review the table diagram also for potential Fan and
Chasm traps. SQL traps can cause incorrect results in reports and need to be
resolved.
Tip: If you find that you have documented a vast amount of classes and
objects based on user requirements you may consider designing schemas
that can be used to build:
1

Multiple universes which cater for a specific function within the business,
reducing the complexity and amount of classes and objects.

Multiple universes specific to a business function, as this will prevent


users from creating queries that can span the spectrum of the business.

Revise Objects and Table Diagram


Once loops and SQL traps are resolved, the design of some objects will require
modification. Any object based on a table that was replaced by an alias must
be updated. Consult your table of objects created in the preparation phase for
such objects.
Note: If you are already using Designer for the schema design you can view
a tables associated objects to identify which objects require changes.
Some objects may be applicable in the context of more than one of the aliases;
these objects will be split into multiple objects. Make sure that object names
make it clear what each one represents.

1-20

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Review Join Strategy


Where table relationships are optional, the type of join to use must be chosen
carefully. The use of standard versus outer joins will impact the results of user
queries. Using the wrong type of join may provide results that are not what
users expect.
In SQL, a standard join between two tables will return only rows where both
tables meet the join criteria. If one of the tables has no corresponding row in
the second table, its data will not be returned.
An outer join tells the database processing the SQL query to substitute a null
row if one of the joined tables has no corresponding row in the other table. With
an outer join, information in one table that does not have corresponding data
in the second table is returned with blanks in columns from the second table.
Recall from the example that each customer may be the originator of one or
more orders. Suppose the developer uses a standard join between customers
and orders. A user who queries on objects that come from customers and
orders tables will only receive information for customers that have associated
orders. The user will not receive any customers that have not placed orders.
The standard join prevents these customers from showing up. Is this the
behavior users would expect?
Alternatively, an outer join would cause this query to return all customers, with
order data where applicable. Perhaps this is closer to what business managers
would want to see, especially if order data is purged every year.
Use of an outer join, however, would make it more difficult for a user to retrieve
ONLY customers that have orders; this would require an extra qualifier on the
query.
Tip: Be careful! An outer join can alter the results of aggregate functions.
Suppose there is a Total Number of Orders object that is defined as
COUNT(ORDERS.ORDER_ID). A user combines this object with the
Customer Name object to get the number of orders for each customer. The
Total Number of Orders object will return 1 for customers with no orders!
The outer join has caused this behavior, because it causes the substitution of
a null order for customers with no orders. Changing the objects definition
toCOUNT(ORDERS.ORDER_ID) where ORDERS.ORDER_ID is not null
will solve this problem.
The developer must review join possibilities with a key user wherever optional
relationships exist. The chosen solution should produce results that users are
most likely to expect. In limited cases, it may be possible to create joins that
contain prompts. In our example, such a join might generate the following
prompt when the query is run:
Include Customers for whom there are no orders?

Universe Development ProcessLearners Guide

1-21

Identify Allowable Object Usage


The developer may identify certain objects that should not be used in
qualifications by end-users. Certain complex objects may not be usable in
qualifications for technical reasons, or there may be performance
considerations. The same holds true for sorts.

Determine Security Approach


Security requirements must also be addressed during Implementation.
Solutions to security requirements may involve complex object definition,
reliance on database-level security, use of BusinessObjects access levels
(public, private, controlled), Restriction Sets or the development of multiple
Universes. Chosen solutions may impact the database administrator and
developers.

Implementation phase 2; Building the universe


Once the schema design stage is complete, the development team is ready to
begin using the BusinessObjects Universe Designer software to build the
universe.
Tip: Remember that it is better to have several smaller less complex
universes than one large universe. This will reduce maintenance, avoid
potential security impacts and will improve overall usability.
Pilot users then begin to use the universe. They provide feedback to
developers who refine the universe until build is completed.

Build the Universe


The BusinessObjects Universe Designer software is used to actually build the
universe. The developer must:

Name the universe

Set up the universe parameters and connect to the relevant data source

Create aliases and contexts as identified in the schema design

Create joins as identified in the schema design

Create classes, sub-classes and objects as identified in the schema


design

Define objects as dimensions, details or measures

Define hierarchies

Define lists of values and help text

Define conditions and implement user security where applicable

If you used the BusinessObjects Universe Designer software to build your


table diagram during design, you have already completed the first four steps.
As the classes and objects are created, be sure to follow any standards that
were put in place during the preparation process.

Supply Pre-built Queries and Reports


During the build stage, the team may identify certain queries and reports that
will be of value to the entire enterprise. Created at anytime throughout build,
these queries and reports are re-checked after the universe is finalized to
ensure that objects used have not been renamed or removed. They are then
exported to the repository so that they are available to all users.

1-22

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Testing Phase
The pilot testing and refinement phase follows universe design
implementation.
Once an initial universe is built, it is deployed to the pilot users. These users
work with the universe and provide feedback to the developers. Types of
feedback include:

Better names for classes and objects

Objects not in the universe that should be added

Objects that can be removed

Better ways to organize objects (e.g., move an object from one class to
another, reclassifying a dimension as a detail, etc.)

Objects or queries that do not behave as expected

Based on this feedback, the universe is modified. The modified universe is


made available to the pilot users for further evaluation.
It is important that the testers understand the scope of the universe before
testing begins. Each iteration should be a refinement of the universe, rather
than an expansion. Without a shared understanding of the objectives, the
project can lose control.
The testing phase can also address potential performance issues. Users may
indicated slow processing of queries. As a developer you can look at
implementing performance enhancements to the universe, for example
aggregate awareness, index awareness, short cut joins, etc.

Quality Assurance
After the build is finalized, the universe is reviewed for Quality Assurance. An
independent reviewer makes the following checks:

Corporate standards for universe, object, class, and alias naming are
followed

Objects are only defined with tables that are referenced in the select text
or where condition

Objects return results without syntactic error

Objects return intended business results

Objects are correctly classified as dimensions, details or measures

Defined hierarchies make sense

Objects have help text

Aliases are used appropriately

Join syntax and foreign keys are accurate

Standard and outer joins are used appropriately

These checks are best made by an individual who was not part of the
development of the universe, guaranteeing an objective perspective. Any
issues that are identified are reported to the developers for correction and rereview.

Universe Development ProcessLearners Guide

1-23

Deployment Phase
The universe has been built, and has passed all quality assurance checks. It
is now ready for deployment.
The final deployment of the universe cannot begin until any architectural
issues identified during planning phase have been addressed. These issues
include the establishment of user connectivity, planning the installation
configuration, preparation of a training program, and identification of support
and change management processes.

Architecture
Architectural considerations identified during the planning phase are reviewed.
Any issues that have not been resolved will delay the deployment phase.

Production Environment
The production environment has been set up in accordance with the
architecture and security plans identified during preparation and planning. The
universe is modified to access data from production systems, rather than from
development systems and is exported to the production repository.

Granting User Access


Any database accounts that will be required for BusinessObjects users should
be created by the database administrator. These accounts should be given
appropriate access privileges to the data objects used by the universe.
Users are also added to the Central Management System and granted access
to the universe.

Conduct Training
The release of the BusinessObjects universe to production users is
coordinated with system and database administrators as appropriate. The
user training program is executed in conjunction with the roll-out of the
universe. Without appropriate training, users will not derive benefits from
BusinessObjects, regardless of the quality of the universe.

Updating/Maintenance
Be sure to inform users about the support and change control mechanisms
available to them. They need to know who to call if they have a problem or
question, and what procedure should be followed to request a change to the
universe. These mechanisms were identified during the planning phase.

1-24

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Pre-packaged solutions:
If you are designing a Universe for Business Objects developers for
developing pre-created/ pre-packaged reports, then the following items should
be taken into consideration:

Pre-define all filters and calculations that are used in standard


documents, to remain consistent throughout

The universe can cover more than one business function, to allow cross
functional reporting. Pre-created reports tend to cross reference reports
against different business functions. The universe will therefore have to
cover multiple business functions to provide end to end business
reporting.

Universe Development ProcessLearners Guide

1-25

Best practices for universe design


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

Describe best practices for universe design

Best practices for designing your universe


The following section outlines a general workflow of best practices to design
an effective universe that meets end users needs.

General best practices

Identify reporting requirements.


Involve users at every step of the universe design and production
process, especially in naming objects (this ensures the terminology is
correct).

Identify the database schema relevant to the universe you are creating
and ensure there is representative data in that schema.
Ensure that the data and structure of that schema is stable and not likely
to change dramatically during development without warning.

Insert universe tables one at a time, not in bulk, understanding how each
table relates to rest of the universe.

Insert joins and define cardinalities.


Specify cardinalities manually as opposed to using the Detect
Cardinalities feature in Designer. Always define cardinality, even for self
joins, to avoid cardinality warning messages.

Lay out your structure window with cardinalities facing the same direction
and always arrange tables logically in the structure window. This helps
you identify and visualize the context and resolve loops and SQL Traps.

Add relevant comments to your universe to document up to date universe


development changes. Remember that you may not be the only person
building and designing this universe.

Build relevant objects. Keep the universe business-focused, for example


when naming objects and classes.

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 is 1.39 MB, then it uses 1.5MB RAM. This could have
had an impact on the RAM available to your system.

1-26

Use aggregate awareness, which speeds up query time by using special


tables containing pre-calculated data. Do all aggregation on the server
side instead of in the document (this can result in huge time savings).

Define aggregate SQL functions on universe measures. Fewer rows will


be returned from the database thus making reports smaller and the
calculation of their variables, ranks and alerters quicker.

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Database connections for a Universe should be set to disconnect after


each transaction. This ensures that the SQL is terminated cleanly and
that the are no treads left open to the database which are inactive.
Note: A number of databases are licensed on the number of concurrent
connections and if a connection is left open for a period of time
when the keep connection active for x minutes is 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 and measure


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 time required 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 objects
description.
This may be a laborious process but one which is useful if you are
working with a large universe. The description is shown in the report/
query panel when a user points to an object.

Always define help for objects. Start the help off with the objects full
name: this is particularly helpful to users if the objects name 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 the measure objects are generic to the whole universe, in
which case a general measure class is created.

Format objects and measures within the universe. This prevents users
having to spend valuable time formatting data from within the reporting
tool every time they create a report.

Universe Development ProcessLearners Guide

1-27

Best practices for joins

Avoid building universe tables with no joins, even if these tables are just
snapshots of Oracle materialized views.

Optimize database performance by using shortcut joins. Shortcut joins


provide an alternative path between two tables. Shortcut joins can
improve query performance by using shorter paths and bypassing
intermediate tables.
Note: placing Shortcut joins in an existing universe may change the
results returned by existing queries.

Avoid outer joins where possible. Outer joins may have a negative effect
on performance since more rows are returned. Additionally, some
databases will 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, otherwise outer join errors may occur. Potentially, this could
cause the SQL to try to match on the equality of a NULL value, which it
cannot do. Using aggregate aware and aliases may help if outer joins
are necessary but cannot be placed at the end of the path.

If you do place outer joins in the middle of a table path, the subsequent joins in the
path may also have to be made outer to avoid errors. This can have a significant
negative impact on performance.

1-28

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Activity: Implementing a Universe


Objective
Using the details outlined in the scenario Implement a universe.

Design the schema

Build the universe in BusinessObjects Universe Designer

Scenario:
The project team has been asked to design a universe solution for Company
A. The project team has made the following findings during the preparation,
analysis and planning phases and are now preparing for the implementation
stage.
Company A requires an ad hoc reporting system for their Product Ordering
application. The company has store locations in 3 countries, U.S., U.K, and
Canada and they monitor sales activity for each location. Company A wants to
ensure that the universe is easy for their employees to use. Company A clients
purchase different products and currently the system has up to 3 years worth
of data (1998, 1999, and 2000).

Universe Scope - Reporting requirement


The universe should be designed to be able to:

Identify the products per store location that were purchased by clients.

Identify the sales for 2000 for a specific product in each country.

Determine the net sales revenue for each store.

Identify the number of Canadian clients that purchased products in 2000.

Standards
Company A reports need to refer to customers as clients.

Database design specifics:

The database contains orders for 3 years (1998, 1999 and 2000).

Tables to use: product, facts_orders, customer, store, and geography.

Start date in the facts_orders table is considered as the purchase order


date.
Instructions
Design the schema (on paper)
1 Outline the table schema structure on paper.
2 Identify the joins and cardinalities.
3 Outline classes and objects, hierarchies and possible conditions.
Build the universe
1 Based on your schema design now implement the universe in Designer.
Note: Use the CRM connection for this new universe.
At the end of the activity hand over your solutions to the instructor. Each group
will be assigned a solution to test and assess.

Universe Development ProcessLearners Guide

1-29

Testing phase
Perform tests in Web Intelligence to make sure the following questions can be
answered:

1-30

What was the net sales revenue for all stores in the UK in 1999?

How many Canadian customers purchased Compaq products in 2000?

What was the (actual) sales value for ACER 17in Monitors for stores in
the US in 2000?

How many UK Clients purchased laptops from the Aiden Soft store?

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Lesson summary
Review
Quiz: Universe Development Process
1

True or False: The role of the universe is to present a business focused


front end to the SQL structures in the database?

Of the following types of metadata, which one does a universe designer


need to keep in mind?
a) Source System Metadata
b) Extract Metadata
c) Data Warehouse Metadata
d) End User Metadata

Complete the table below comparing the differences between data


systems

data warehouse

OLTP

data mart

Optimized for Build loads


and large complex
queries
Many tables,
relational
(normalized) schema
Vast indexes for
optimized queries
Always currently
accurate data
Designed for departmental needs and contains a
smaller, more
specialized volume of
data

List three key points to consider in the Analysis stage of Universe Design.

Universe Development ProcessLearners Guide

1-31

List two best practices for the following:

General
Best
Practices

Best practice
for classes
and objects

Best practice
for joins

Summary
After completing this lesson, you are now able to:

1-32

Describe Data Warehouse components and characteristics

Describe OLTP components and characteristics

Describe Data Mart components and characteristics

Describe Metadata

Describe how to implement the used metadata model into a universe


schema

Identify the Universe Design Phases

Describe best practices for universe design

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Lesson 2

Universe Parameters
As a designer you can apply several parameters that are universe based or data
access specific in order to maximize the potential of a universe.
In the BusinessObjects XI R1/R2: Universe Design course we looked at how you
can set specific parameters when creating a new universe or via File >
Parameters menu.
This lesson will look at a more in depth insight into the parameters that can be
set in the Universe Parameters > Parameters menu, together with a look at
performance enhancing parameters that can be specified in the various data
access files installed with the BusinessObjects product suite.
In this lesson you will learn about:

Data access files and connection parameters

BusinessObjects dynamic SQL parameters

Connection and user credential parameters

Duration: 2 hours

Copyright 2007 Business Objects. All rights reserved.

2-1

Data access files and connection parameters


A number of driver level files used by specific data access drivers are installed
with the BusinessObjects product suite. These files allow designers to set
database specific parameters that can aid in enhancing universe and
connection performance. This unit will look at the individual data access files
and at advanced connection parameters that can be used to enhance your
universe deployment.
After completing this unit, you will be able to:

Describe what the different data access files are

Describe the SBO parameter file

Describe the CS.CFG parameter file

Describe the PRM parameter file

Modify parameters in the PRM file

Describe Advanced Connection Parameters

Describe Custom Connection Parameters

Data Access files


Data access is managed by the Connection Server. The Connection Server is
the Business Objects connection 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, Desktop Intelligence Report Server and Web Intelligence Job Server
which allows these services to query the database directly without
communicating with the Connection Server service.
The Connection Server and the required data access components are
automatically installed when you install Business Objects.
Data access drivers can be found in the installation directory:
C\Program Files\Business Objects\BusinessObjects Enterprise
11.5\win32_x86\dataAccess\connectionsServer\<RDBMS>
For example for Microsoft SQL Server 2005, the <RDBMS> folder is ODBC.
You can locate the following files in the ODBC folder:

2-2

Driver specific file

Description

<driver><language>.stg
For example: sqlsrven.stg

Contains the help text for each external


strategy defined in the <driver>.stg file.
This text appears when the strategy is
selected in a universe.

<driver>.stg
For example: sqlsrv.stg or
oracle.stg

Contains the external strategies available to


the data access driver.

Note: External Strategies will be covered


later on in Lesson 7 External
Strategies

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

<driver>.sbo
For example: odbc.sbo

Defines all databases supported and the


specific connectivity configuration for each
database.

<driver><language>.prm
For example: sqlsrven.prm

Contains the help text for functions that are


listed in the <driver>.prm file. This text
appears when the function is selected in
Designer.

<driver>.prm
For example: sqlsrv.prm

Defines the information parameters and


functions related to the database.

<driver><language>.cod
For example: odbcen.cod

Stores information related to connection


definitions.
Warning: Do not modify this file.

The SBO file


The SBO file is a parameter file used to configure the behavior of some of the
connection parameters. For each access driver (RDBMS) there is one SBO file
that contains the appropriate connection 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 aliases for middleware versions that are no longer supported, but
which are still used by connections defined with the data access driver.
Each middleware entry can have default parameters set that apply only
to that database middleware. For example for Microsoft SQL Server 2005
you will find the following settings 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="Driver Level">31</Parameter>
<Parameter Name="CharSet Table"
Platform="Unix">datadirect</Parameter>
<Parameter Name="Driver Name">SQL Server</Parameter>
</DataBase>

Universe ParametersLearners Guide

2-3

The table below outlines what some of the above shown parameters mean

Parameter

Description

Family

This specifies the family of database engine to be displayed


in the Database Middleware Selection page of the new connection wizard. The middleware that correspond to your
data access key are displayed on this page in a tree view.

Note: Do not modify this parameter.

Array Bind
Available

The bind array is the area in memory that Connection


Server stores a batch of data to be loaded (sent to the
repository). When the bind array fills, it is transmitted to the
database.
This parameter specifies if the database supports this
method. Values can be set to True or False, the default
value is set to True

Driver Level

Specifies the limitations of each driver. This setting is specific to each <driver>.sbo file

CharSet
Table

1 specifies that you can only use the driver to create


and execute queries.

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


BusinessObjects repository, and to create and
execute queries.

31 specifies that you can use the driver to create the


BusinessObjects repository, to create and execute
queries, and to access stored procedures.

Specifies the Charset file (.crs) for the data access driver
with no extension. This setting is specific to each .sbo file.
The .crs file is in the same directory as the .sbo file.

Some <driver>.sbo files contain parameters that are also set in the cs.cfg file.
The values set in the SBO file can over-ride the values in the cs.cfg file.

2-4

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

The CS.CFG file


The cs.cfg file is a data access general configuration file in XML format that
contains default configuration parameters that apply to all data access drivers.
The cs.cfg file is stored at the root level for the connectionServer:
C\Program Files\Business Objects\BusinessObjects Enterprise
11.5\win32_x86\dataAccess\connectionsServer\
Note: The cs.cfg file is an XML file. The Document Type Definition (DTD) file
that relates to each element used in the cs.cfg file is in the same
directory. Make sure that, when editing and/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 locales are UNICODE compliant which allows SQL
UNICODE to be used. Note that for some databases, SQL Server
included, the SQL UNICODE settings are set to NVARCHAR. To allow for
UNICODE compliancy the UNICODE setting in the PRM file or the
UNICODE Dynamic 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 file extensions of files used by Connection Server to
manage data access.
Some settings can be defined either for library version or server version
of Connection Server.

Library: parameters apply to a standard Connection Server


installation. It is installed with other BusinessObjects desktop or
server software. This is the default mode when you install a
BusinessObjects product that is installed automatically with
Connection Server.

Server: parameters apply to a Connection Server stand alone


server installation. It is installed 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 requests coming from CORBA clients or HTTP clients.
The Lookup element allows you to expose the target RDBMS that
corresponds to a specific ODBC network layer to Connection Server. This
applies when Connection Server is using two 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
Connection Server associates a target RDBMS to its ODBC network
layer. However, if Connection Server is being used as a standalone
server, and has two databases that are accessed by the same ODBC
network layer, the specific target database information must be exposed
to Connection Server to allow queries to be routed through ODBC to the
correct data account.

Universe ParametersLearners Guide

2-5

Driver defaults:
Data access driver parameters that are also found in driver specific SBO
files. The values set 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. For example the cs.cfg holds the default settings for the
Array Fetch Size and Array Bind Size values, in the oracle.sbo file you
can define different Array Fetch size and Array Bind size values.
These values are normally set in individual universe connections in the
Advanced Parameters and Custom Parameters menus. If no values are
changed in these menus when defining the universe connection, the
default settings from the cs.cfg will be used instead. If these values have
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 through Connection Server in log files.

The PRM file


Each data access driver is associated with a SQL parameters file
(<driver>.prm). This PRM file contains default SQL parameters used for query
generation, date and other operators, and functions.
Each PRM file is structured into four groups:

Configuration

The configuration section holds the SQL parameters


used to create and optimize a universe, for example,
COMMA, OWNER, QUALIFIER, and OUTERJOINS_
GENERATION

Date
Operations

The date operations section holds the date operators


available to Designer and the BusinessObjects end user
querying tools. For example YEAR, QUARTER and
MONTH options.

Operators

The operators section holds the operators available to


Designer and the BusinessObjects end user querying
tools, for example ADD, MULTIPLY and SUBSTRACT.

Functions

The functions section holds the functions available to


Designer, and the BusinessObjects end user querying
tools, for example Average, Sum, and Variance.
Help text that appears when functions in this section are
selected in Designer or BusinessObjects end user querying tools is listed in the <driver><language>.prm file,
for example, sqlsrven.prm. This file is found in the same
directory as the <driver>.prm file. You can open it to
view descriptions of all the functions available in the
<driver>. prm file.

2-6

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

The Functions section in the PRM has the following subsections:

Group:
This Group tag specifies if the function needs to generate a GROUP BY.
If this is set to True, a GROUP BY is generated when the function is used
in a query. If set to False no GROUP BY is needed for the function. For
example the function Maximum has the Group tag set to True as it is an
aggregate function, but the function Lowercase (a string function) has the
Group tag set to False.

ID:
The ID represents the unique identifier for the function across all PRM
files ( <driver>.prm and <driver><language>.prm).

InMacro:
The InMarcro tag specifies if the function appears in the function list in an
objects Edit Select box in Designer. When value is True, the function is
listed, when value is False, the function is not listed.
If you set the value to True, it will be listed the next time Designer is
started.

Type:
This represents the function return type. Values that can be entered here
are for example: ALL, Numeric, Char, String, DateTime, Logical. Designer
uses this value to list the function in the appropriate function type.

Arguments:
This represents the arguments accepted by the function.

SQL:
This represents the SQL syntax for the function.This is also the name that
appears in the function list in Designer.

The function list shown in the PRM file never includes a complete list of
available functions for the designated RDBMS. If additional functions are
required for reporting purposes, the PRM file can be adapted and new
functions can be added.

Universe ParametersLearners Guide

2-7

To add PRM file function parameters


You can view, edit, and add parameters to a PRM file as follows:
1

Locate the appropriate PRM file. Browse to the directory that stores the
PRM file for your target database in:
C\Program Files\Business Objects\BusinessObjects Enterprise
11.5\win32_x86\dataAccess\connectionsServer\<RDBMS>\

Open the <driver>.prm file in an XML editor.

Expand sections as required.

</Function>
<Function Group= [True/False] ID= [Function Name] InMacro=
[True/False] Type= [Type(Numeric,Alphanumeric,Date)] >
<Arguments>
<Argument Type= [Type] ></Argument>
<Argument Type= [Type] ></Argument>
</Arguments>
<SQL> [SQL Syntax] </SQL>
</Function>

Set values by entering the value in the appropriate tag.

Save and close the file.

PRM file function help text


The help text that appears under each function when selected in Designer is
maintained in a separate file. In previous versions of Business Objects
products this text was maintained in 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 function to the appropriate <driver><language>.prm file.
Each <driver><language>.prm file has the following tags that need to refer to
the each function added in the PRM file:

2-8

Name:
The name tag represents the name of the function. This is the name that
appears in the function list in Designer, and needs to correspond with the
name of the function in the <driver>.prm file.

Message:
This tag is split up into two ID tags. The first ID tag represents the help
text for the function that will be seen in Designer. The second ID needs to
convey the function name.

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Arguments:
For each argument set in the function, you can add a help text message
to convey what type of argument is expected to be used.

To add function help text


You can edit and add text to describe a function by editing the file:
1

Locate the appropriate language PRM file. Browse to the directory that
stores the PRM file for your target database in:
C\Program Files\Business Objects\BusinessObjects Enterprise
11.5\win32_x86\dataAccess\connectionsServer\<RDBMS>\

Open the <driver>.prm file in an XML editor.

Expand sections as required.

</Function>
<Function Name= [Function Name] >
<Message id="Help"> [Help Text] </Message>
<Message id="Name"> [Function Name] </Message>
<Arguments>
<Message id="1"> [Type]:</Message>
<Message id="2"> [Type]:</Message>
</Arguments>

Set values by entering the value in the appropriate tag.

Save and close the file

Universe ParametersLearners Guide

2-9

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 can help optimize queries run against
universes using the target data access driver. As with all parameter files,
please make sure that settings are correctly defined and are compatible with
the RDBMS in use. Certain configuration parameters must not be edited.
These parameters have values set for use internally within a Business Objects
product. Before editing any other PRM file parameter, you should make a
backup copy of the PRM file.
You can view, edit, and add parameters to a PRM file.

To edit PRM file configuration parameters


You can view, edit, and add parameters to a PRM file as follows:
1

Browse to the directory that stores the PRM file for your target database
in:
C\Program Files\Business Objects\BusinessObjects Enterprise
11.5\win32_x86\dataAccess\connectionsServer\<RDBMS>\

Open the <driver>.prm file in an XML editor.

Browse to the parameter that requires to be altered. Make the


appropriate parameter changes.

Save and close the file.

Designer requires to be restarted to get the changes to take effect.

The section below outlines reference information for some of the configuration
parameters that are in the sqlsvr.prm file. Configuration parameters are
grouped together by functionality and usage. Some of the parameters not
listed in this section will be referred to later on in this course.

Sorting, Grouping and format related configuration parameters


The following section lists the configuration parameters from the sqlsrv.prm
that specify sorting and grouping parameters.

SORT_BY_NO

2-10

Value

Yes/No (Default set to No)

Description

This function specifies if users are authorized to sort on


columns (represented as objects in the universe) that are
not included in the SELECT statement. If the parameter
is set to

Yes, users are not authorized to sort on columns


that are not included in the SELECT statement. The
Manage Sorts button is dimmed in the Report
Panel.

No, users are authorized to sort on columns even if


they are not included in the SELECT statement.

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

GROUPBYCOL
Value

Yes/No (Default set to No)

Description

Specifies whether a GROUP BY clause accepts integers


for column names.

Yes: specifies that a GROUP BY clause followed by


an integer is supported by the database.

No: specifies that a GROUP BY clause followed by


an integer is not supported by the database.

GROUPBY_WITHOUT_CONSTANT
Value

Yes/No (Default set to Yes)

Description

Specifies whether or not you authorize the addition of


objects whose SQL definition is a constant in a GROUP
BY clause. Parameter is used by IBM DB2 and Microsoft
SQL Server

Yes: specifies that you can add any constant object


to the query but it will not be present in the GROUP
BY clause.

No: specifies that you can insert all the objects of a


query (i.e. without aggregate functions) in a GROUP
BY clause.

COMMA and CONCAT


COMMA

Specifies what database concatenation operator should be


used to replace a comma for objects that have the following
syntax: Tab.Col1, Tab.Col2.
This parameter is used with all data access drivers.
You can use ||' '|| or +' '+

CONCAT

Specifies the concatenation operator. Parameter is used


with all data access drivers. You can use ||' '|| or +' '+

Universe ParametersLearners Guide

2-11

Join and key configuration parameters


The following section lists the configuration parameters from the sqlsrv.prm
that specify join parameters.

EXT_JOIN
Value

Yes/No (Default set to Yes)

Description

Specifies whether or not outer joins are supported.


Parameter is used by all data access drivers.

Yes: specifies that the database supports outer


joins.

No: specifies that the database does not support


outer joins. The Outer join check boxes in the Edit
Join dialog box of Designer are dimmed

OUTERJOINS_GENERATION
Description

This parameter is only used for compatibility with


previous versions of Designer. The ability to create outer
joins that conform to the ANSI 92 standard can be set at
the universe level by setting the universe parameter
ANSI92 to YES.
MS SQL Server database engine, the sqlsrv.prm file uses
standard outer join generation (in WHERE clause). To
use ANSI 92 outer join generation with MS SQL Server,
modify the sqlsrv.prm file as follows:
EXT_JOIN_INVERT=YES
MODIFY: LEFT_OUTER=
RIGHT_OUTER=
OUTERJOINS_GENERATION=ANSI_92

LEFT_OUTER and RIGHT_OUTER

Value

Description

LEFT_OUTER">$(+) or LEFT_OUTER">$*
RIGHT_OUTER">$(+) or RIGHT_OUTER">*$
Specifies the left outer join syntax.
$(+) This syntax is used with Oracle. $ represents a join
expression.
$* This syntax is used with Sybase, MS SQL Server and
Red Brick. $ represents a join expression.

2-12

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

KEY_INFO_SUPPORTED
Value

Yes/No (Default set to Yes)

Description

This function specifies if you can retrieve primary and secondary key definitions from the database account

Yes: specifies that the database allows designers to


retrieve primary and secondary key definitions from
the database account. This parameter enables
Designer to display the keys in the Structure
window.

No: specifies that the database does not allow


designers to display primary and secondary key
definitions from the database account in the
universe Structure window.

Union, Intersect, and Minus configuration parameters


The following section lists the configuration parameters from the sqlsrv.prm
that specify UNION, INTERSECT and MINUS parameters.

UNION

Specifies if the database supports the UNION set operator.

(default value:
UNION)

If the value is set to UNION the database supports the


UNION set operator, if no value is defined the UNION set
operator is not supported and two queries are generated.

INTERSECT

Specifies if the database supports the INTERSECT set


operator.

(default value:
INTERSECT)

MINUS
(default value:
MINUS)

If the value is set to INTERSECT the database supports the


INTERSECT set operator, if no value is defined the INTERSECT set operator is not supported and two queries are
generated.
Specifies if the database supports the MINUS set operator.
If the value is set to MINUS or EXCEPT the database supports the MINUS set operator.
If no value is defined the MINUS set operator is not supported and two queries are generated.

Note: The UNION_IN_SUBQUERY, INTERSECT_IN_SUBQUERY and


MINUS_IN_SUBQUERY function in the same way. If these parameters
are set to UNION, INTERSECT and MINUS (or EXCEPT) respectively
it will allow use of these functions in subqueries.

Universe ParametersLearners Guide

2-13

There are also a number of functions that are database specific. These
functions should not be edited.

2-14

Value

Description

Datatype_Dtm

Column database data type for Date objects.


(CREATE table command)

Datatype_Int

Column database data type for Numeric objects.


(CREATE table command)

Datatype_Blob

Column database data type for Blob objects. This


parameter is not implemented for this release.

Datatype_Null

Database SQL syntax for Null values.


(INSERT command)

Datatype_Double

Column database data type for Date objects.


(CREATE table command)

Datatype_String

Column database data type for Character and Long


objects. (CREATE table command).

LenMaxForVarchar

Maximum length for VARCHAR column data type.


(CREATE table command).

LenMaxForTableName

Maximum length for VARCHAR column data type.


(CREATE table command).

LenMaxForColumnName

Maximum length for column name


(by default the object name is proposed).
(CREATE table command).

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Activity: Editing the PRM file


Objective

Adding a new functions to the PRM file

Changing a configuration parameter in the PRM File.

Instructions
Adding new functions to the PRM file.
1 Open Microsoft Visual Studio to use and an XML editor.
Go to Start > Programs > Microsoft Visual Studio 2005 > Microsoft
Visual Studio 2005.
2 Click File > Open > File and browse to the location of the sqlsvr.prm file
in: C\Program Files\Business Objects\BusinessObjects Enterprise
11.5\win32_x86\dataAccess\connectionsServer\ODBC\
3 Browse to the end of the file and collapse the DATE_TO_CHAR function.
4 Highlight the collapsed XML element line and copy this.
5 Place your cursor behind the <Function> XML tag above the highlighted
Locate function and press Enter.
6 Paste the copied function in the created space.
7 Add the following function syntax by replacing the relevant element
values in the copied XML syntax:
</Function>
<Function Group="False" ID="CAST($1)" InMacro="True"
Type="String">
<SQL>CAST($1)</SQL>
</Function>

Note: This function can be used as a conversion function for all data
types and does not require specific argument settings.
8

Add a second function to the sqlsvr.prm file using the following syntax:

</Function>
<Function Group="False" ID="DATE_DIFF" InMacro="True"
Type="Numeric">
<Arguments>
<Argument Type="DateTime"></Argument>
<Argument Type="DateTime"></Argument>
</Arguments>
<SQL>DateDiff(day,$1,$2)</SQL>
</Function>

Universe ParametersLearners Guide

2-15

Click Save.
Keep Visual Studio open.

10 Launch Designer.
11 Edit an objects properties and edit the SELECT statement and check
that both functions show up. If they do not, return to Visual Studio to
make sure that all element tags appear in the correct place.

Adding function help text.


1 In Visual Studio click File > Open > File and browse to the location of the
sqlsvren.prm file.
2 Browse to the end of the file.
3 To copy the last function syntax: highlight the function line and the
<Function> tag above, but do not highlight the <Function> tag below.
Select Ctrl + C to copy this.
4 Highlight the collapsed XML element line and copy this.
5 Place your cursor behind the <Function> XML tag above the highlighted
Locate function and press Enter.
6 Place your cursor behind the </Arguments> XML tag above the
highlighted <Function> element tag and press Enter
7 Paste the copied function in the created space.
8 Add the following function help syntax for the CAST function by replacing
the relevant element values in the copied XML syntax:
</Function>
<Function Name="Cast">
<Message id="Help">Converts data types. Use 'as varchar',
'as datetime', or 'as numeric' within the brackets to
specify the data type conversion required.</Message>
<Message id="Name">Cast</Message>
</Function>

Add the following function help syntax for the DateDiff function by
replacing the relevant element values in the copied XML syntax:

</Function>
<Function Name="DATE_DIFF">
<Message id="Help">Calculates the Days Difference Between
two Dates </Message>
<Message id="Name">Date Diff</Message>
<Arguments>
<Message id="1">Start Date:</Message>
<Message id="2">End Date:</Message>
</Arguments>
</Messages>
</Function>

10 Click Save.
Note: You can leave Visual Studio open as this will be used again in the
following section of this activity.
11 Restart Designer.

2-16

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

12 Edit an objects properties and edit the SELECT statement.


13 Check that both function desciptions show up. If they do not, return to
Visual Studio to make sure that all element tags appear in the correct
place.

Changing a configuration parameter in the PRM file.


1 In Visual Studio locate the EXT_JOIN parameter in the sqlsvr.prm file.
This function specifies if you can use outerjoins in Designer or not.
2 Set the value to No.
3 Click Save.
4 Restart Designer.
5 Check in Designer if you can still enable the outer join option in the Join
Editor.

Universe ParametersLearners Guide

2-17

BusinessObjects dynamic SQL parameters


In previous versions of Business Objects products, all SQL parameters were
set in the <RDBMS>.PRM file. This file was a static text file that applied to all
universes.
Parameters used for SQL generation can now also be set for individual
universes. These parameters are referred to as Dynamic SQL Parameters.
After completing this unit, you will be able to:

Describe Dynamic SQL Parameters

Modify Dynamic SQL Parameters

Dynamic SQL Parameters


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 access driver, can have
different SQL generation behavior.
These dynamic SQL parameters are saved in the .unv file, and are accessible
only from the universe.

To edit a dynamic SQL parameter

2-18

Open Motors.unv in Designer.

Select File > Parameters > Parameter from the toolbar menu.
The Parameter menu opens showing the SQL parameters.

Select the appropriate parameter to edit.


The selected parameter is displayed in the Property Name field together
with the parameter default value in the Value field.

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

Click OK to close the Parameter dialog box.

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Adapting Dynamic SQL Parameters


This section will now look at some of the more common dynamic SQL
parameters used and how changing their default values can influence the
BusinessObjects interface and behavior.

END_SQL:
Values

String (Default <empty string>)

Description

The statement specified in this parameter is added at the


end of each SQL statement.

The End_SQL parameter is used to append a string to the SQL sent to the
database each time a query 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 input variables.
By using a parameter like @variable(BOUSER), the DBA can clearly see who
sent the query with what results!
This can aid system optimization, and can also be useful in a situation where
a long running query must be terminated or when the system has to be
stopped for maintenance reasons.

ANSI92
Value

Yes/No (Default is set to No)

Description

Specifies whether the SQL generated complies to the


ANSI92 standard.

Yes: enables the SQL generation compliant to


ANSI92 standard.

No: SQL generation behaves according to the PRM


parameter OUTER_JOIN_GENERATION.

The ANSI92 parameter allows ANSI92 SQL syntax to be used in query


generation. This parameter can only be used for databases that support this
syntax.
It enables complete left, right and full outer join support in universe.

Universe ParametersLearners Guide

2-19

With the ANSI92 parameter set to No the SQL output for a query using Client
Name, Region and Number of Clients is as follows:
SELECT
CLIENT.CLIENT_LASTNAME + ', ' + CLIENT.CLIENT_FIRSTNAME,
COUNTRY_REGION.COUNTRY_NAME,
count(CLIENT.CLIENT_ID)
FROM
CLIENT,
COUNTRY

COUNTRY_REGION

WHERE
(COUNTRY_REGION.COUNTRY_ID=CLIENT.COUNTRY_ID)
GROUP BY
CLIENT.CLIENT_LASTNAME + ', ' + CLIENT.CLIENT_FIRSTNAME,
COUNTRY_REGION.COUNTRY_NAME

Setting the ANSI92 parameter to Yes the same query will output the following
SQL:
SELECT
CLIENT.CLIENT_LASTNAME + ', ' + CLIENT.CLIENT_FIRSTNAME,
COUNTRY_REGION.COUNTRY_NAME,
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 ANSI syntax moves join references from the WHERE clause to the FROM
clause, which can help decrease the quantity of data parsed by the database
One thing to note is that this does not apply to WHERE clause condition
restrictions.

2-20

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

If a query uses a condition object or a quick filter the selected values for this
restriction are still displayed in the WHERE clause:
The SQL will be shown 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 same will happen with join restrictions. Adding the Sales Revenue to a
query will still show the Type = S restriction in the SQL:
SELECT
CLIENT.CLIENT_LASTNAME + ', ' + CLIENT.CLIENT_FIRSTNAME,
REGION.REGION_NAME,
sum(SALE_MODEL.SALE_QTY * MODEL.MODEL_PRICE * ((100 SALE.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)
INNER JOIN CLIENT ON (CLIENT.CLIENT_ID=SALE.CLIENT_ID)
INNER JOIN REGION ON (REGION.REGION_ID=CLIENT.REGION_ID)
WHERE
(SALE.SALE_TYPE='S')
GROUP BY
CLIENT.CLIENT_LASTNAME + ', ' + CLIENT.CLIENT_FIRSTNAME,
REGION.REGION_NAME

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

Universe ParametersLearners Guide

2-21

FILTER_IN_FROM
Values

Yes/No (Default is set to No)

Description

Determines if query conditions are included in the FROM


Clause.

Note: This setting is only applicable if the other universe


parameter setting ANSI92 is set to YES.

Yes: when editing an outer join, the default behavior


property selected in the drop down list box of the
Advanced Join properties dialog box in Designer, is
set to "All objects in FROM".

No: when editing an outer join, the default behavior


property selected in the drop down list box of the
Advanced Join properties dialog box in Designer is
set to "No object in FROM".

Setting the FILTER_IN_FROM parameter to Yes will move the WHERE clause
conditions seen in the previous section to the FROM clause.
When the end user creates a new Web Intelligence report using Client
Name, Region and Number of Clients, with a quick filter applied to
Region the generated SQL will look like this:.

By changing the FILTER_IN_FROM parameters to Yes, this parameter applied


to the whole universe. The FILTER_IN_FROM functionality can however be
applied to individual classes and objects. This functionality is only available if
the ANSI92 parameter has been set to Yes.

2-22

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

To apply Filter in From Clause functionality to individual


classes and objects.
1

Open MotorsAdv.unv in Designer.

Double-click on a join in the Structure pane.


The Edit Join properties open for the selected join.

Click the Advanced button.


Note: This button is only active if the ANSI92 parameter is set to Yes.

Universe ParametersLearners Guide

2-23

The Advanced Join Properties dialog box opens.

2-24

Select the appropriate option from the behavior drop down list.

Select the appropriate classes and objects.

Click OK to apply the changes.

Repeat steps for other joins in the schema.

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Dynamic SQL Parameters reference list


The section below lists reference information describing the dynamic SQL
generation parameters available to the universe.

AUTO_UPDATE_QUERY
Value

Yes/No (Default is set to Yes)

Description

Determines what happens when an object in a query is not


available to a user profile.

Yes: the query is updated and the object is removed


from the query.

No: the object is kept in the query.

BLOB_COMPARISON
Value

Yes/No (Default is set to No)

Description

Specifies if a query can be generated with a DISTINCT


statement when a BLOB file is used in the SELECT statement. It is related to the setting "No Duplicate Row" in the
query properties.

Yes: the DISTINCT statement can be used within


the query.

No: the DISTINCT statement cannot be used within


the query even if the query setting "No Duplicate
Row" is on.

COLUMNS_SORT
Values

Yes/No (Default is set to No)

Description

Determines the order that columns are displayed in tables


in the Structure pane.

Yes: columns are displayed in alphabetical order

No: columns are displayed in the order they were


retrieved from the database

FORCE_SORTED_LOV
Values

Yes/No (Default is set to No)

Description

Retrieves a list of values that is sorted.

Yes: specifies that the list of values is sorted.

No: specifies that the list of values is not sorted.

Universe ParametersLearners Guide

2-25

DECIMAL_COMMA
Values

Yes/No (Default is set to No)

Description

Specifies that Business Objects products insert a comma as


a decimal separator when necessary.

Yes: Business Objects products insert a comma as


a decimal separator when necessary.

No: Business Objects products do not insert a


comma as a decimal separator.

BOUNDARY_WEIGHT_TABLE
Value

Integer 32bits [0-9] (Default is set to -1)

Description

FROM (SELECT col1, col2,...., coln FROM


Table_Name WHERE simple condition).
A simple condition is defined as not having a subquery, and
not having EXCEPT or BOTH operators.

Limitations

Optimization is not implemented when:

the operator OR is in the query condition

only one table is involved in the SQL

the query contains an outer join

no condition is defined on the table that is being


optimized

the table being optimized is a derived table.

COMBINED_WITH_SYNCHRO

2-26

Values

Yes/No (Default is set to No)

Description

Specifies whether to allow a query to execute that contains


UNION, INTERSECTION, or EXCEPT operators, and
whose objects in each subquery are incompatible.

Yes: specifies that you do allow a query to execute


that contains UNION, INTERSECTION and
EXCEPT operators, and whose objects in each
subquery are incompatible. This type of query
generates synchronization (two blocks in the report).

No: specifies that you do not allow a query to


execute that contains UNION, INTERSECTION and
EXCEPT operators, and whose objects in each
subquery are incompatible. When the query is
executed the following error message is displayed:
"This query is too complex. One of the subqueries
contains incompatible objects." This is the default
value.

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

CORE_ORDER_PRIORITY
Values

Yes/No (Default is set to No)

Description

Specifies in which order you want classes and objects to be


organized once two or more universes are linked in
Designer .

Yes: specifies that classes and objects follow the


order defined in the kernel universe.

No: specifies that classes and objects follow the


order defined in the derived universe.

CORRECT_AGGREGATED_CONDITIONS_IF_DRILL
Values

Yes/No (Default is set to No)

Description

Specifies whether Business Objects products can aggregate


measures in queries and conditions.

Yes: Business Objects products can aggregate


measures separately in the main query and the
condition, if the query is drill enabled.

No: Business Objects products cannot aggregate


measures separately in the main query and the
condition, if the query is drill enabled.

CUMULATIVE_OBJECT_WHERE
Values

Yes/No (Default is set to No)

Description

Specifies the order of WHERE clauses that have the AND


connective.

Yes: specifies that WHERE clauses that have the


AND connective are set at the end of the condition.

No: specifies that WHERE clauses follow standard


SQL syntax.

Example:
If this parameter is set to YES, and If the condition is find all
French clients different from John or American cities different from New York, the SQL becomes:
WHERE
(customer.first_name <> `John')
OR (city.city <> `New York')
AND customer_country.country = `France'
AND city_country.country = `USA'

Universe ParametersLearners Guide

2-27

DISTINCT_VALUES
Values

GROUPBY / DISTINCT (Default set to DISTINCT)

Description

Specifies whether SQL is generated with a DISTINCT or


GROUPBY clause in a list of values and query panel when
the option Do not retrieve duplicate rows is active.

DISTINCT: the SQL is generated with a DISTINCT


clause, for example:

SELECT DISTINCT
cust_name
FROM
Customers

GROUPBY: the SQL is generated with a GROUP


BY clause, for example:

SELECT
cust_name
FROM
Customers
GROUPBY cust_name

EVAL_WITHOUT_PARENTHESIS
Values

Yes/No (Default is set to No)

Description

By default, the function @Select(Class\object) is replaced


by the Select statement for the object <Class\object>
enclosed within brackets.
For example, when combining two @Select statements:
@Select(Class\object1) *@Select(Class\object2).
SQL (object1) = A - B
SQL (object2) =C
The @Select(Class\object1) *@Select(Class\object2) operation is: ( A - B) * ( C ).
You avoid the default adding of brackets by setting
EVAL_WITHOUT_PARENTHESIS = YES.
The operation would then become: A - B * C.

2-28

Yes: brackets are removed from the Select


statement for a function @Select(Class\object)

No: Brackets are added around the Select statement


for the function @Select(Class\object).

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

FIRST_LOCAL_CLASS_PRIORITY
Values

Yes/No (Default is set to No)

Description

Note: This parameter is only taken into account when


CORE_ORDER_PRIORITY=YES.

Yes: classes, objects and sub classes in derived


universe are placed first.

No: classes, objects and sub classes from derived


universe appear after those of the core universe.

MAX_INLIST_VALUES
Values

Integer: min 0, max 256 (Default set to 99)

Description

Allows you to increase the number of values you may enter


in a condition when you use the IN LIST operator.

99: specifies that you may enter up to 99 values


when you create a condition using the IN LIST
operator.

256: specifies that you may enter up to 256 values


when you create a condition using the IN LIST
operator. 256 is the maximum authorized value.

REPLACE_COMMA_BY_CONCAT
Values

Yes/No (Default is set to Yes)

Description

In previous versions of Designer, a comma could be used to


separate multiple fields in an object SELECT statement.
The comma was treated as a concatenation operator. For
universes that already use the comma in this way you can
set REPLACE_COMMA_ BY_SEPARATOR = NO to keep
this behavior. In the current version of Designer, this parameter is set to YES by default, so that any expressions using
a comma in this way are automatically changed to use the
concatenation syntax.

Yes: comma is replaced by the concatenation


expression when multi field object is found.

No: keep the comma as it is.

THOROUGH_PARSE
Values

Yes/No (Default is set to No)

Description

Specifies the methodology used for default Parsing in the


Query panel and individual object parsing.

Yes: PREPARE, DESCRIBE, and EXECUTE


statements are used to parse SQL for objects.

No: PREPARE and DESCRIBE statements are used


to parse SQL for objects.

Universe ParametersLearners Guide

2-29

SHORTCUT_BEHAVIOR
Values

Global / Successive (Default set to Global)

Description

Specifies how shortcut joins are applied. This parameter


was formerly listed as GLOBAL_SHORTCUTS in the PRM
files. The values have been changed to GLOBAL instead of
YES, and SUCCESSIVE instead of NO.

Global: specifies that shortcut joins are considered


as one by one. A shortcut join is applied only if it
really bypasses one or more tables, and if it does not
remove a table from the join path used by a following
shortcut join. This is the default value.

Successive: specifies that all shortcut joins are


applied.
Note: If it generates a Cartesian product, no
shortcut joins are applied.

UNICODE_STRINGS
Values

Yes/No (Default is set to No)

Description

Specifies whether the current universe can manipulate


Unicode strings or not.

Note: This parameter only applies to Microsoft SQL


Server and Oracle 9 (and later versions). If the
database character set in the SBO file is set as
Unicode, then it is necessary to modify the SQL
generation to handle specific Unicode column
types like NCHAR and NVARCHAR.

Yes: conditions based on strings are formatted in the


SQL according to the value for a parameter
UNICODE_PATTERN in the PRM file.
For example for MS SQL Server (sqlsrv.prm):
UNICODE_PATTERN=N$
The condition Customer_name='Arai' becomes
Customer_name=N'Arai'.

2-30

No: all conditions based on strings are formatted in


the standard SQL.
For example the condition Customer_name='Arai'
remains Customer_name='Arai'

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

The Join By SQL parameter


The JOIN_BY _SQL is a new parameter added to Business Objects XI
Release 2
This parameter combines split queries into one sentence and makes the
database calculate 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. The microcube 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 can slow down response time, especially if the requested query
needs to process several SQL statements. The returned result sets will
subsequently need to be merged by the microcube into a final report result set.
Example scenario: Using the motors universe, if in a query we need
information on car sales and rental revenue, it will require to run across two
contexts. The default behavior will generate two separate queries for each
context; sales and rental. Assuming the query returns 10,000 rows of car sales
information, and 10,000 rows of car rental information, this will have double
impact on the entire system sending a total of 20,000 rows of data across the
network and the Enterprise server synchronizes them to display 10,000 rows
in your final report. Merging data this way will have a high impact on the
network and Enterprise server performance.
Applying the JOIN_BY_SQL parameter moves the data UNION processing
from the BusinessObjects Enterprise server to the RDBMS. Fewer rows will
will travel the network and as the microcube no longer needs to merge the
data, there will be less impact on the Business Objects Enterprise server.
Use of this parameter can improve performance depending on how well your
RDBMS is set up.
When the query is based on an Oracle data source, the SQL generated will
use NVL to display the dimensions common to both sets of queries. When the
query is based on a MS SQL Server data source, the SQL generated will use
COALESCE as NVL is not supported. The end result is the same.
The JOIN_BY_SQL parameter can also help in taking advantage of the
RDBMS ability to generate derived tables and the full outer join SQL. Despite
generating at least 2 SQL flows, there will be only one global SQL flow.
Finally, this parameter can be used for universes through Crystal Reports.
Multi-flow SQL cannot be applied for Crystal reports. On some databases
there is the possibility to force the generation of a single flow of SQL from the
universe by setting the JOIN_BY_SQL=Yes.

To add the JOIN_BY_SQL parameter


1

Open MotorsAdv.unv in Designer.

Select File > Parameters> Parameter from the menu bar.

Type JOIN_BY_SQL in the property name box.

Type Yes in the property value box.

Click Add.

Click OK to close the Parameter dialog box.

Universe ParametersLearners Guide

2-31

Activity: Dynamic SQL Parameters


Objective

Apply the JOIN_BY_SQL parameter

Apply the END_SQL parameter

Apply the ANSI92 and FILTER_IN_FROM parameters

Instructions
This activity will be using the MotorsAdv.unv file. This universe is based on
SQL Server 2005 and contains all the classes and objects created in the
BusinessObjects XI R1/R2: Universe Design course. Illustrated below are the
classes and objects that are part of the MotorsAdv universe. This should be
used as an aid to locate the objects whenever report testing in Web
Intelligence is required.

2-32

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Apply the JOIN_BY_SQL parameter


7 Create a new Web Intelligence document based on the MotorsAdv
universe. Drag the Client Name, Number of Clients, and Number of
Cars Sold objects to the Result Objects pane.
8 Click View SQL to see the results. The query generates two statements.
9 Log out of Web Intelligence.
10 Launch Designer and import the MotorsAdv.unv file.
11 In File> Parameters> Parameter add the JOIN_BY_SQL = Yes
parameter. Click Add.
12 Click OK to close the Parameters dialog box.
13 Save and export the universe.
14 Launch Web Intelligence and create a new Web Intelligence document
based on the MotorsAdv universe. Drag the Client Name, Number of
Clients, and Number of Cars Sold objects to the in the Result Objects
pane.
15 Click View SQL to see the results. The data is merged into one SQL
statement and the result should look as follows:

16 Log out of Web Intelligence.


17 Launch Designer and import the MotorsAdv.unv file.

Apply the END_SQL parameter


1 Open MotorsAdv.unv in Designer.
2 Click the Parameters toolbar button.
3 Click the Parameter tab

Universe ParametersLearners Guide

2-33

Click the arrow down button to navigate the list of parameters.


Select the END_SQL parameter.

In the Value box add the following syntax:


/*@Variable('BOUSER'); @Variable('UNVNAME');
@Variable('DOCNAME'); @Variable('DPNAME'); @Variable('DPTYPE')*/

Click Replace.
The Parameter syntax for the END_SQL has now been modified.

Note: The End_SQL parameter in universe property allows inserting a


string at the end of the SQL generated by a query. The variables
are stated in a comment field and evaluated when running a query.
The query is generated with the explicit sentence.

2-34

Click OK to close the Parameter dialog box.

Save the universe

Select File > Export from the menu bar. Export the universe to the CMS.

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

10 Launch InfoView and create a new Web Intelligence document.


11 Select the MotorsAdv universe.
12 Add Showroom and Sales Revenue to the Results Objects pane.
13 Click the View SQL icon.
The generated SQL will appear in the SQL Viewer:.

Note: The last line in the SQL contains the syntax added to the
END_SQL parameter in the Parameters menu.

Apply the ANSI92 and FILTER_IN_FROM parameters


14 In File> Parameters> Parameter change the ANSI92 parameter to Yes.
Click Replace.
15 Change the FILTER_IN_FROM parameter to Yes. Click Replace.
16 Click OK to close the Parameters dialog box.
17 Launch Web Intelligence and create a new Web Intelligence document
based on the MotorsAdv universe. Drag the Client Name, Number of
Clients, and Number of Cars Sold objects to the in the Result Objects
pane.
18 Click View SQL to see the results. The merged SQL statement contains
the INNER JOIN statements and there is no longer a WHERE clause
generated.
19 Log out of Web Intelligence.
20 Launch Designer and import the MotorsAdv.unv file.
21 Set the FILTER_IN_FROM back to No.
22 Double-click the join between the CLIENT and the REGION tables.
23 Click Advanced
24 Choose the Selected objects in FROM option.
25 Select the Region object and the Client Name objects only.
26 Click OK twice. Save and export the universe.
27 Create a new Web Intelligence document using the Client Name and
Region objects. Apply a Quick Filter on the Region object.

Universe ParametersLearners Guide

2-35

28 View the SQL. Is the Region object condition showing up in the FROM
clause?

29 Remove the filter and apply a Quick Filter on the Client Name object.
30 View the SQL. Is the Client Name condition showing up in the FROM
clause?

31 Remove the filter and drag in the Area Code detail object.
32 Apply a Quick Filter on the Region object and select the East Coast
value.
33 Apply a second Quick Filter on the Area Code object and select the
values 10011 and 10012.
34 View the SQL. What is happening with the WHERE and FROM clauses?

35 Why is this happening?

36 Return to Designer and import the MotorsAdv.unv file.


37 Change all altered parameters back to their default settings.

2-36

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Connection and user credential parameters


The universe connection determines how users connect to the data source
and access the database. A number of connection options can be setup to
either use an explicit database user account or delegate the authentication to
user specific credentials. This unit will look 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

Describe the different settings in the Advanced connection menu

Describe the different parameter setting in the Custom connection menu

Use data source credentials for the


connection
In the connection Login Parameters there are two options that can be specified
for passing user credential data through the universe connection.

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


When selected, the user name and password used to access the CMS
are automatically used as database login parameters. Once users are
logged on to BusinessObjects Enterprise, single sign-on to the database
enables them to perform actions that require database access, for
example, viewing and refreshing Web Intelligence documents without
having to provide their logon credentials again.

Universe ParametersLearners Guide

2-37

Use database credentials associated with BusinessObjects user


account:
This option is used in a deployment where each Enterprise user is bound
to a Database user to 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 this connection will require having their database user
credentials set in the CMS. Those credentials are known as DBUSER and
DBPASS variables and can also be used with @variable function.
Updating the database credentials can be done manually or by batch
using the import wizard. This can be handy when regularly updating user
credentials with new passwords, however, the downside of it is that the
import fileexposes passwords in plain text.

2-38

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Activity: User Credentials


Objective

Setting up a Business Objects trace

Define SQL Server user security

Define Business Objects Enterprise user credentials

Define user credentials in the connection properties

Test user credentials in Web Intelligence

Test user credentials in Designer

Instructions
Setting up a Business Objects trace
1 Declare the following environment variables:
Variable Name

Variable Value

BO_TRACE_CONFIGDIR

C:\

BO_TRACE_CONFIGFILE

C:\BO_trace.ini

BO_TRACE_LOGDIR

C:\

Copy over the BO_trace.ini file from the resource CD to the C:\ location
as specified in the environmental variable.

Open the cs.cfg file in Microsoft Visual Studio.

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

Click Save.

Universe ParametersLearners Guide

2-39

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

Define SQL Server user security


1 Login to SQL Server Management Studio. Go to Start > Programs>
Microsoft SQL Server 2005 > SQL Server Management Studio.
2 Enter the sa login credentials and click on Connect.
3 Expand the Security section and right-click on Logins.
4 Select New Login...
5 In the new login window choose SQL server authentication.
6 Create a user called User1 with password bobj.
7 Deselect the enforce password policy option.
Make sure the change password at next login option is disabled.
8 Click OK.
9 Add a SQL Server user for the MotorsAdv database corresponding to the
login above. Click the plus sign in front of the Databases section and
then click the plus sign in front of the MotorsAdv database section.
10 Right-click the Security item within the expanded MotorsAdv section and
select New > User.
11 In the User name box type User1.
12 Select the corresponding login using the ellipsis button or manually type
User1 in the second field.
13 For the Default Schema manually type MotorsAdv.
14 Set the database role members to db_datareader.

15 Click OK.
16 Expand Tables.

2-40

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

17 Right-click on ANNUAL FIGURES.


18 Select Properties.
19 Set a restriction to deny Select for User1.

20 Click OK to commit the changes.

Define Business Objects Enterprise user credentials


1 Log onto the Central Management Console. Select Start > Programs >
Business Objects XI Release 2 > Business Objects Enterprise >
Business Objects Enterprise Java Administration Launchpad.
2 A new user John will have specific credentials assigned that bind his
account to User1 Database user. Click Users.
3 Create user John with no password.
Deselect the option User must change password at next logon.
4 Click OK.
5 Check the box for Enable Data Source Credentials for Business
Objects Universes.
6 Add DB Credentials as

DBUSER (account name) = User1

DBPASS (password) = bobj


7 Click Update.
8 Add user to Administrator Group and make sure the change has been
updated.
9 Close CMC.

Universe ParametersLearners Guide

2-41

Define user credentials in the connection properties


1 Log onto Designer and select Tools > Connections from the toolbar
menu.
2 Edit the MotorsAdv Connection and enable the use of Database
credentials.
3 A message box will appear. Click OK.
Note: The database credentials option also applies to Web Intelligence
and Designer.
4

Click Next and Finish to exit the Connection Wizard.

Test user credentials in Web Intelligence


1 Logon to Info view as user John.
2 Create a new Web Intelligence document.
3 Add Showroom and Sales Revenue to the Result Objects pane.
4 Click View SQL.
The generated SQL uses the ANNUAL_FIGURES table.
5 Click Run Query.
A message will appear that permission is denied to the
ANNUAL_FIGURES table.
Test user credentials in Designer
1 Log into Designer as user John.
2 Import the MotorsAdv.unv file.
3 Right-click on the ANNUAL_FIGURES table and select View Table
Values. A message should appear.
4 Open the Connection and deselect the database credentials option.
5 Set the login name and password back to the sa login and associated
password.
6 Select Tools > Login As.
7 Log back in as Administrator.
Check the Trace files
Check the trace results. Open the WI Report Server log file.
You should see User1 in the trace of the CS SQL transactions.
Look for the SQL Database error - -1 (make sure there is a space before the
-1) which is a common error code or look for Error you should find the info
as:
"[Microsoft][ODBC SQL Server Driver][SQL Server]SELECT
permission denied on object 'ANNUAL_FIGURES', database
'MotorsAdv', schema 'dbo'."

2-42

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Connection Parameters
In the previous section we looked at how you can set parameters in the
different data access files to manipulate the performance and enhance other
database specific features. Making changes to the RDBMS data access files
applies to all universes in general.
You can set certain parameter values in individual universe connections
instead, as some universes would require a higher array fetch size or an array
bind size setting to enhance data performance.
Individual connection parameter settings can be altered in the Advanced
Parameters and Custom Parameters menus. If no values are changed in these
menus when defining the universe connection, the default settings from the
cs.cfg will be used instead.

Advanced Connection Parameters


When creating or editing a new connection you can set certain parameters to
optimize the connection against the database in use. The Advanced page
contains parameters used to over ride the following common configuration
options:

Defining the duration of a connection into a pool

Defining how Business Objects products respond when database


resources are not available

Defining the size of the array fetch

To access the advanced connection parameters


1

Open the MotorsAdv.unv file in Designer.

Select File > Parameters from the toolbar menu.

In the Definition tab edit the connection. Click Edit.

Universe ParametersLearners Guide

2-43

Click Next twice. The Advanced Parameters menu opens.

You can set the following advanced parameters:

2-44

Parameter

Description

Disconnect after
each transaction

Check this box if you want your connection to disconnect


immediately after the transaction is completed. Users will
have to reconnect each time they want to access data.

Keep the connection active for x


minutes

Check this box if you want your connection to stay active


for a defined period of time. You must also enter a value
for the number of minutes. This is the default Connection
Property.

Keep the connection active during


the whole session
(local mode only)

Check this box if you want your connection to stay active


during the entire session of the product. The connection
ends when the user exits the application.

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Parameter

Description

Array fetch size

Enter 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 retrieve your 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 safest way of
retrieving your data but row-by-row retrieval slows
down server performance. The greater the value
in the Array fetch size option, the faster your rows
are retrieved; you must, however, ensure you
have adequate client system memory.
Note: If a query retrieves data containing blob or long
text types, the array fetch is automatically reset to
1. The default value is 20.

Array bind size

Enter the size of the bind array that Connection Server


uses before sending to the repository. The bind array is
the area in memory that Connection Server stores a
batch of data to be loaded (sent to the repository). When
the bind array fills, it is transmitted to the database. Generally, the larger the bind array, the more 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 error message is displayed.

Universe ParametersLearners Guide

2-45

Custom Connection Parameters


You can also add custom connection parameters in the Custom Parameters
menu. These parameters should only be modified by an advanced user, DBA,
or BusinessObjects administrator.

To access the custom connection parameters


1

Open the MotorsAdv.unv file in Designer.

Select File > Parameters from the toolbar menu.

In the Definition tab edit the connection. Click Edit.

Click Next three times.

The Custom Parameters menu opens.

This menu contains certain parameters that can be used to override


connection settings. Parameters set in this menu are database specific. The
following outlines a few parameters options that can be set:

2-46

Binary Slice Size


This is a legacy parameter that appears by default in the Advanced
Connection menu for all data access drivers. This parameter was used to
specify the storage of the binary content for all documents sent to the
legacy repository database. This is only used for migration purposes.

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

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

The syntax shown in the example below is based on an Oracle database


syntax.

The syntax is defined in the Universe Custom connection menu


The string can contain 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)


It can also be used with Informix to add SQL statements to a connection
that are executed once the connection is opened. For example:
ConnectInit=SET PDQPRIORITY HIGH
ConnectInit=SET OPTIMIZATION FIRST ROWS

The ConnectInit parameter can be useful for:

Auditing

Query Banding

Setting session specific database parameters

Enforcing Oracle Virtual Private Database

Hint (Oracle only)


A Hint is commented information that is embedded in a query, and used
by the Oracle optimizer to choose an execution plan. You should consult
your Oracle documentation for full information on 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, immediately after the comment delimiter, with no space
between the comment delimiter and the plus sign:
/*+ <hint> */

Universe ParametersLearners Guide

2-47

Some useful Hints that you can use are as follows. Consult your Oracle
documentation for a full list:

Hint

What it does...

FIRST_ROWS

Optimizes response time.

RULE

Use rule-based optimization and not cost.

FULL

Does a full table scan on the table.

ROWID

Scans table by rowid.

INDEX_FFS

Perform a fast full scan on the index rather than


on the table.

Example: FIRST_ROWS
On the Custom page, click Hints and type /* FIRST_ROWS */ in the
values box under the parameter list, and click on Set.
The SQL will become:
SELECT /* FIRST_ROWS */
CLIENT.CLIENT_ID
FROM
CLIENT

2-48

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Activity: ConnectInit
Objective

Setting the ConnectInit parameter

Tracing the parameter

Instructions
1

Open the MotorsAdv.unv file in Designer.

Select File > Parameters from the toolbar menu.

In the Definition tab edit the connection. Click Edit.

Click Next three times.


The Custom Parameters menu opens

Highlight the ConnectInit parameter and add the following syntax to the
box.
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ

Click Set to apply the changes.

Click Finish.

Click OK.

Login to Web Intelligence as Administrator.

10 Create a new Web Intelligence document.


11 Run a query with Client Name and Sales Revenue.
12 Open the WI Report Server log file.
13 Search for the parameter:
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ.
Note that this parameter is passed to the database when the connection
is established.
Note: You can also trace these parameters in ODBC using the following
steps:.
1

From the Start menu select Program > Administrative Programs >
ODBC

Select the Tracing tab.

Click Start tracing now.

The default tracing directory will be under

C:\Documents and Settings\Administrator\Local


Settings\Temp\SQL.LOG

Refresh a LOV in the universe to make sure a connection to the


database is established.

Check the generated log file.

Universe ParametersLearners Guide

2-49

Lesson summary
Review
Quiz: Universe Parameters
1

Which Enterprise server manages data access?

The Join_By_SQL is a new parameter added to XIR2. What is its


function?

Provide a brief description on what do the following files do?

File

Description

*.stg

*.sbo

cs.cfg

*.prm

2-50

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Summary
After completing this lesson, you are now able to:

Describe what the different data access files are

Describe the SBO parameter file

Describe the CS.CFG parameter file

Describe the PRM parameter file

Modify parameters in the PRM file

Describe Advanced Connection Parameters

Describe Custom Connection Parameters

Describe Dynamic SQL Parameters

Modify Dynamic SQL Parameters

Describe the different data source credentials that can be applied in the
connection

Describe the different settings in the Advanced connection menu

Describe the different parameter setting in the Custom connection menu

Universe ParametersLearners Guide

2-51

2-52

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Lesson 3

Advanced Objects Scenarios


This lesson will look at how we can create advanced objects, that will aid users
to answer more specific questions in their reports. This lesson will also look at
how database functions can be combined to create complex objects, how we can
create relative date-time objects and how we can utilize Transact_SQL functions.
In this lesson you will learn about:

Combining database functions in objects

Constructing relative date-time objects

Working with Transact_SQL functions

Duration: 1.5 hours

Copyright 2007 Business Objects. All rights reserved.

3-1

Combining database functions in objects


Initially universes may only contain the basic dimension and detail objects that
reflect the tables and column names in the universe structure, together with
some more advanced measure objects that combine columns for aggregation
of revenue or cost.
When end users start building reports based on this universe, it may turn out
that several business questions can not be answered using the available
objects.
This often results in having end users define variables and complex formulas
in their reports to get the required information shown.
As a designer it is important to identify what type of additional object
functionality is needed to allow end users to generate the data in their report.
In many cases instead of using report variables and functions, these reporting
needs can be added in the universe in the form of more advanced objects.
This unit will describe 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


As seen in Lesson 2, when connecting your universe to a specific RDBMS the
<driver>.PRM file will make a list of database functions available in the
universe.

The functions are divided into Number, Character and Date types, which
reflect the PRM functions layout discussed in the prior lesson.
In this section we will look at some of the most commonly used numeric and
character functions that can be used for complex dimension and detail objects.
The list of numeric functions consists of a number aggregate functions that can
be used in measure objects, and several mathematical and statistical
functions. The list of character functions consists of several functions that allow
you to extract data-parts and some conversion functions.
On their own each function may give limited functionality, but when combining
two or more functions in a SELECT statement, they allow designer to construct
complex objects that will benefit the end users in their report creations.

3-2

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Ceiling, Floor and Round Functions


These functions can be used to round down or round up to a last digit or integer
of a number value.

Function

Description

Ceiling

Returns smallest integer greater than or equal to n.

Floor

Returns largest integer equal to or less than n.

Round

Returns a number rounded to n decimal places.

Rounding up and rounding down of values can be useful to make sure that
number formats do not have unnecessary decimal places. This can be useful
for end user object formatting displays, and possibly for certain measure
calculations. There is also another good use of these functions; they can be
used in creating data range objects.
For example in the CLIENT table there is a value for CLIENT_AGE, and the
end user would like to be able to run a query showing the customer age and
the age range the customer falls into. For example 10-20, 20-30, 30-40, and
so forth.
Use the CAST function, that was added to the sqlsvr.prm file in Lesson 2, 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) AS Varchar)

This will allow end users to run an age range object in their reports.

This would be a static data range that will set the range by a range increase
band 10.

Advanced Objects ScenariosLearners Guide

3-3

CharIndex, Length, Left, Right and Substring function


Function

Description

Fn_Left (or
Left(,))

Returns a number of character values from the left hand


side of a string.

Fn_Right (or
Right(,))

Returns a number of character values from the right hand


side of a string.

Charindex

Returns the position of an expression in a character string.

Fn_Length

Returns the length of a character string.

Substring

Returns part of a character string. The substring starts at a


specified character position and has a specified length.

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 from either the start or end part of a character
string. CharIndex can establish the position of a character value in a string.
Combining these functions can allow designers to extract string values from
any part of a table column. For example, if for a Zoning Improvement Plan
(ZIP) code only the first number of digits are required to be retrieved in an
object, but the first digits can be either 2 or 3, this can pose a problem with
using the left or substring function as it is unknown how many character values
are in need to be extracted.
The common delimiter is the space or hyphen that separates the first part of
the ZIP code from the second. If the position of the space is known, then this
will be the deciding factor of how many values to extract from the left hand side.
You can now define data up to the space from either left or right. The following
syntax will provide the first digits of the ZIP code up to the dividing space:
substring(CLIENT.CLIENT_AREA_CODE,1,charindex(' ',
CLIENT.CLIENT_AREA_CODE))

3-4

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

CASE WHEN THEN ELSE END


Function

Description

CASE WHEN
THEN ELSE
END

Evaluates a list of conditions and returns one of multiple


possible result expressions.
CASE input_expression
The input_expression is any valid expression.
WHEN when_expression
Is a simple expression to which input_expression is compared to. The data types of input_expression and each
when_expression must be the same.
THEN result_expression
Is the expression returned when input_expression equals
when_expression evaluates to TRUE, or
Boolean_expression evaluates to TRUE. result expression
is any valid expression.
Note: multiple WHEN Boolean_expression THEN
result_expression clauses can be used.
ELSE else_result_expression
Is the expression returned if no comparison operation evaluates to TRUE. If this argument is omitted and no comparison operation evaluates to TRUE, CASE returns NULL.
else_result_expression is any valid expression. The data
types of else_result_expression and any result_expression
must be the same or must be an implicit conversion.

The CASE statement allows designers to locate a value and replace it by


something else. This is a powerful SQL syntax function that can aid in complex
conditional syntaxes. In the Universe Design course we have see a similar
function in MS Access, the IIF, that would allow creating sales revenue by year
if the year is a certain value.
The CASE statement can be used in objects, condition, joins and derived
tables allowing for great flexibility in universe design.
An example syntax for the CASE statement is:
CASE WHEN @Select(Client\Client Country)='United Kingdom'
THEN 'UK' ELSE @Select(Client\Client Country) END

Advanced Objects ScenariosLearners Guide

3-5

Activity: Database functions in objects


Objective

Creating a static data range object

Modifying the range object and making this a dynamic range

Using the CASE statement

Using the left, right, length, substring and charindex functions.

Instructions
Creating a static data range object
1 Create a lower range value for the CLIENT.CLIENT_AGE column.
The lower range value is created by dividing the CLIENT.CLIENT_AGE
value by 10, and by rounding the value down to the integer by using the
floor function. The formula syntax becomes as follows:
floor(CLIENT.CLIENT_AGE/10)

If the CLIENT_AGE value is 44, this will result in a value of 4.


2

To complete the lower range value syntax, multiply this by 10.


The formula syntax becomes as follows:
floor(CLIENT.CLIENT_AGE/10)*10

If the CLIENT_AGE value is 44, this will result in a value of 40.


3

Create the upper range value for the CLIENT.CLIENT_AGE column.


This would be done in the same way as the lower range, but now we will
add a value of 1 before multiplying by 10. The upper range formula
syntax becomes:
(floor(CLIENT.CLIENT_AGE/10)+1)*10

If the CLIENT_AGE value is 44 then this will result in a value of 50.


Note: Make sure that the brackets are in the right location to get the
correct calculation order.
This will give the two range values, but they now need to be combined to
create a range or 40-50.
The functions and the column values are of numeric format, and to
combine these we need to convert the value to character type.
4

Use the CAST function, that was added to the sqlsvr.PRM file in
Lesson 2, 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) AS Varchar)

This will allow end users to run an age range object in their
5

3-6

Launch Web Intelligence and test the new object.

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Modifying the range object and making this a dynamic range


We will now modify the object to make it a dynamic data range.
6

In Designer create a new object called Dynamic Age Range.

Use the CAST function created for the static Age Range object:
CAST((floor(CLIENT.CLIENT_AGE/10)*10) AS Varchar)+'-'+
CAST(((floor(CLIENT.CLIENT_AGE/10)+1)*10) AS Varchar)

Replace the value 10 by the following @prompt function syntax:


(@Prompt('Enter Age Range Band Width','N',,,))
The formula used in the object will now become:
CAST((floor(CLIENT.CLIENT_AGE/(@Prompt('Enter Age Range
Band Width','N',,,)))*(@Prompt('Enter Age Range Band
Width','N',,,))) AS Varchar)+'-'+
CAST(((floor(CLIENT.CLIENT_AGE/(@Prompt('Enter Age Range
Band Width','N',,,)))+1)*(@Prompt('Enter Age Range Band
Width','N',,,))) AS Varchar)

Note: Remember that it will be useful to add a help text for this type of object
to let the end user know what type of value they are expected to fill into
the prompt, for example in this case it can be noted that the end user
can enter into the prompt values like 5, 10, 15, 20, and so forth.
9

Test the results in Web Intelligence.

Using the CASE statement


In the Universe Design course there were a number of measure objects
created using the IIF function for MS Access. For SQL Server the CASE
statement would be used instead.
1

Recreate the following objects in the Annual Figures class using the
CASE WHEN THEN ELSE END statement:

Object Name

Original IIF syntax

Sales Revenue for


FY04-05

sum(IIf(FINANCE_PERIOD.FP_YEAR='FY04-05',SALE_MODEL.SALE_QTY *
MODEL.MODEL_PRICE * ((100-SALE.SALE_SALE_DISCOUNT)/100),0))

Sales Revenue for


FY03-04

sum(IIf(FINANCE_PERIOD.FP_YEAR='FY03-04',SALE_MODEL.SALE_QTY *
MODEL.MODEL_PRICE * ((100-SALE.SALE_SALE_DISCOUNT)/100),0))

Sales Revenue
2003

sum(IIf(year(SALE.SALE_DATE)=2003,SALE_MODEL.SALE_QTY *
MODEL.MODEL_PRICE * ((100-SALE.SALE_SALE_DISCOUNT)/100),0))

Sales Revenue
2004

sum(IIf(year(SALE.SALE_DATE)=2004,SALE_MODEL.SALE_QTY *
MODEL.MODEL_PRICE * ((100-SALE.SALE_SALE_DISCOUNT)/100),0))

Using the left, right, length, substring and charindex functions


1 Using any combination of the functions mentioned above in combination
with the Case statement, create a new Phone Area Code object that
extracts the area code value from the Phone NO.
If there is no area code value make sure the entire Phone NO is
displayed.

Advanced Objects ScenariosLearners Guide

3-7

Constructing relative date-time objects


Every universe will have a need for relative time objects that end users can use
to make calculations based on current dates or based on a prompted dynamic
period. This unit will look at how we can create different types of relative datetime 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. For example, end users might need to determine what date is the
first day of the month, or need to know the last day of the month. There are a
number of functions listed in the Number list that can apply to these needs, for
example:

fn_year: this function will return the year values of a date object. For
example:
{fn year(FINANCE _PERIOD.FP_START)}

This will return the values 2003, 2004, and 2005 in numeric format.

fn_month: this function will return the month values of a date object. For
example:
{fn month(FINANCE _PERIOD.FP_START)}

This will return the values 1-12 in numeric format.

fn_week: this function will return the month values of a date object. For
example:
{fn week(FINANCE _PERIOD.FP_START)}

This will return the values 1-52 in numeric format.


Note: If there is no date values in the database FP_START column for a
particular month or week, this month or week value will not be
included in the LOV.

datepart(qq, ): this function will return the quarter values of a date object.
For example:
Datepart(qq, FINANCE _PERIOD.FP_START)

This will return the values 1-4 in numeric format.


Note: The datepart function can also be used to extract year, month,
week and day numeric values.
You can also use the Dateadd and Datediff functions to calculate a number of
different dates you might need to use in your applications. And for a current
date value the function Getdate can be used.
These functions do not appear in the PRM file. You can add them to the PRM
file to make sure that they show up, but as these are standard SQL Server
functions you can actually use them by typing these directly in the SELECT
statement.

3-8

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

The functions in the PRM file help support designers that are less familiar with
the database function syntaxes and can be a good help for frequently used
functions.
Note: If database functions are typed in directly do make sure that the object
parses and run test queries to make sure the object does not cause
any errors.
The Datediff function calculates the amount of time between two dates, where
the time part is based on an interval of time, such as hours, days, weeks,
months, years.
The Dateadd function calculates a date by taking an interval of time, and
adding it to a date, where the interval of time will be the same as those used
by the Datediff function.
Combining these two functions and Getdate, a SQL Server function that
returns the current date and time, can aid retrieving first- and last day of the
month or year information, for example:

First Day of Month


Dateadd(mm, Datediff(mm,0,Getdate()), 0)

Explanation: the Datediff(mm,0,Getdate()) section of the syntax above


calculates the number of months between the current date and the date
"1900-01-01 00:00:00.000". In SQL Server date and time variables are
stored as the number of milliseconds since "1900-01-01 00:00:00.000".
This is why you can specify the first date-time expression of the Datediff
function as "0." The Dateadd function adds the number of months
between the current date and '1900-01-01". By adding the number of
months between our pre-determined date '1900-01-01' and the current
date it is possible to arrive at the first day of the current month. In addition,
the time portion of the calculated date will be "00:00:00.000."

Monday of the Current Week


Note: this example assumes Sunday is the first day of the week
Dateadd(wk, Datediff(wk,0,Getdate()),0)

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 different dates that might be valuable.
Here are some examples that adds an additional DATEADD function to
calculate the last day dates for both the current and prior intervals.

Last Day of Prior Month


Dateadd(ms,-3,Dateadd(mm, Datediff(mm,0,Getdate()),0))

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,6Datepart(day,Getdate()),Getdate())),0)

Using the 6th day of the month instead of the current date in the formula
allows this calculation to return the first Monday of the current month.

Advanced Objects ScenariosLearners Guide

3-9

Relative date-time objects


To use relative date-time date function syntaxes in objects it can be helpful to
outline which type of date-time syntaxes are going to most needed in
calculations or object references. This can be done initially as separate objects
that can later be used in calculations of complex date time objects. For
example:.

Date Object

SELECT
syntax

Current Date

Description

Type

Getdate()

Returns the
current date
and time

Date

Current Year

Datepart(yyyy,
Getdate())

Returns the
current year

Number

Current Month

Datepart(mm,G
etdate())

Returns the
current month

Number

Next Year

Dateadd(mm,1
2, Getdate())

Returns the
todays date a
year ahead.

Date

In addition to this you may need to have specific date-time prompts that will
allow users to input a date of their choice. You can create a base date prompt
object that can be hidden if needed, and use this as reference in additional
objects. For example:

Prompt
Object
Date Prompt

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

This prompt object can now be referenced in measure or date objects to


compare a user input date with an existing date in the database.

3-10

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Activity: Relative date-time objects


Objective

Create relative date-time objects

Use these objects as a base to build relative date-time measures

Create YTD objects

Instructions

Prompt
Object
Sales Date
Prompt

Launch Designer and import the MotorsAdv.unv file.

Create the following sale date prompt objects in the Sales Dates
subclass:

SELECT syntax

Description

Type

@Prompt('Select Date
or Type Date (dd/mm/
yyyy)','D','Sales
Dates\Sale
Date',mono,free)

Prompts the user to


choose a Sales Date
from the list of values
or manually type in a
date value. (YYYYMM)

Date

Note: This objects requires a


reference table. Use
the Tables button and
select the SALE table.

Note: The Sales Date prompt


will not parse when
defining the object type
to Date. The @prompt
function is not designed
to go into the SELECT
and as the date input
generates quotes
around the field it is
seen as character
string.

Sales Year
Prompt

Datepart(yyyy,@Select(
Sales Dates\Sales Date
Prompt))

Subtracts the year


from the entered
Sales Date Prompt
value

Number

Sales Month
Prompt

Datepart(mm,@Select(
Sales Dates\Sales Date
Prompt))

Subtracts the month


from the entered
Sales Date Prompt
value

Number

Advanced Objects ScenariosLearners Guide

3-11

Boolean Flag
Object
Sales Date in
Prompt flag

In the Sales Dates subclass, create the following indicator or boolean


flag objects that will be used to create relative date-time measure objects
in the remaining activity steps:

SELECT syntax

Description

CASE @Select(Sales Dates\Year of Sale Date)

Indicator that returns 1 if both


the year and the month of the
Sale Date are equal to the year
and month in the entered
prompt date. Otherwise it
returns 0.

WHEN @Select(Sales Dates\Sales Year


Prompt)
THEN 1
ELSE 0 END
*
CASE @Select(Sales Dates\Month of Sale
Date)
WHEN @Select(Sales Dates\Sales Month
Prompt)

Note: The asterisk works as


boolean; making sure
that both CASE
statement return a 1
value.

THEN 1
ELSE 0 END

Sales Date in
Prompt flag 1yr

CASE sign(@Select(Sales Dates\Year of Sale


Date)+1 - @Select(Sales Dates\Sales Year
Prompt))
WHEN 0
THEN 1
ELSE 0 END

Indicator that returns 1 if the


year of the Sales Date equals
the year in the entered prompt
date minus one year, and the
month of the Sales Date equals
the month of the reference
period. Otherwise it returns 0.

*
CASE sign(@Select(Sales Dates\Month of Sale
Date) - @Select(Sales Dates\Sales Month
Prompt))
WHEN 0
THEN 1
ELSE 0 END
Sales Year in
Prompt flag

CASE @Select(Sales Dates\Year of Sale Date)


WHEN @Select(Sales Dates\Sales Year
Prompt)
THEN 1
ELSE 0 END

Indicator that returns 1 if the


month of the Sales Date <
Sales Month Prompt, and the
year of the Sales Date is equal
to the Sales Year Prompt.
Otherwise it returns 0.

*
CASE sign(@Select(Sales Dates\Month of Sale
Date) - @Select(Sales Dates\Sales Month
Prompt))
WHEN 1
THEN 1
ELSE 0 END

3-12

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Note: The boolean flag objects can be created in a separate class and can be
hidden in the universe. They should not be used by end users as
objects on their own.
4

Create the following relative date-time measure objects in the Sales


Figures subclass.:

Measure
Object

SELECT Syntax

Sales Total

sum(SALE.SALE_TOTAL)

Total Sales in
prompted yyyymm period

sum((SALE.SALE_TOTAL)

Total Sales in
prompted year
period

sum((SALE.SALE_TOTAL)

Total Sales in
prompted year
period - 1yr

sum((SALE.SALE_TOTAL)

* @Select(Sales Dates\Sales Date in Prompt flag))

* @Select(Sales Dates\Sales Year in Prompt flag))

* @Select(Sales Dates\Sales Date in Prompt flag - 1yr))

Save and export the universe.

Launch Web Intelligence.

Create a new query using Sale Date and Sales Total and Total Sales in
prompted yyyy-mm period.

Select a date from the LOV.

The Total Sales in prompted yyyy-mm period object returns only sales
data for the month and year values that equal the month and year values
entered in the prompt, all other rows will return 0. This way end users can
compare the total sales revenue for all dates to the sales revenue
returned for the selected yyyy-mm period.
Note: If you wish to restrict the data to only return the selected period
sales revenue, you adapt the Total Sales in prompted yyyy- mm
period object to:

SELECT sum(SALE.SALE_TOTAL)
WHERE @Select(Sales Dates\Sales Year in Prompt flag)=1

10 Run a new query using the Sale Date, Sales Total and Total Sales in
prompted year period objects.
11 Select a date from the LOV.
Note: There is no data for 2002, so make sure to select a date from 2004
or 2005 to see the last year values.
12 The Total Sales in prompted year period object returns only sales data
for the month and year values that equal the month and year values
entered in the prompt. All other rows will return 0.
13 Run a new query using the Sale Date, Sales Total and Total Sale- 1yr
objects.
14 Select a date from the LOV.

Advanced Objects ScenariosLearners Guide

3-13

Note: There is no data for 2002, so make sure to select a date from 2004
or 2005 to see the last year values.
15 The Total Sales in prompted year period - 1yr object returns only sales
data for the month and year values that equal the month and year values
entered in the prompt minus 1 year. All other rows will return 0.

Create Year to Date objects


1 Create a new class called Current Dates and insert the following
objects:.

Date Object

SELECT
syntax

Current Date

Description

Type

Getdate()

Returns the
current date
and time

Date

Current Year

Datepart(yyyy,
Getdate())

Returns the
current year

Number

Current Month

Datepart(mm,
Getdate())

Returns the
current month

Number

Note: These objects are not based on any database columns and will not
parse as they are lacking a reference table. To check if the syntax
is correct click Tables, select the SALE table, apply the changes
and click Parse.
2

There are no current date values in the MotorsAdv database. To make


sure that we can create YTD objects we will create a new derived table.
Select Insert > Derived Tables from the toolbar menu.

Name the table SALE_YTD.

Add the following syntax to the derived table SELECT statement:


SELECT CLIENT_ID,SALE_ID, SALE_TOTAL, Getdate() AS
SALE_DATE
FROM SALE
WHERE CLIENT_ID = (1089)
UNION
SELECT CLIENT_ID,SALE_ID, SALE_TOTAL,Dateadd(mm,-1
,Getdate()) AS SALE_DATE
FROM SALE
WHERE CLIENT_ID = (1088)
UNION
SELECT CLIENT_ID,SALE_ID, SALE_TOTAL,Dateadd(mm,-2
,Getdate()) AS SALE_DATE
FROM SALE
WHERE CLIENT_ID = (1087)
UNION
SELECT CLIENT_ID,SALE_ID, SALE_TOTAL,Dateadd(yy,-1
,Getdate()) AS SALE_DATE
FROM SALE
WHERE CLIENT_ID = (1086)

3-14

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Check the syntax and click OK.

As we need to make sure that all tables are part of a context we need to
join the SALE_YTD table to the CLIENT table via the CLIENT_ID.

Detect the cardinality and create a new context for the join between the
SALE_YTD and CLIENT tables. Name the context SALE_YTD.

Create a YTD Objects class add the following objects based on the
SALE_YTD derived table.:

Object

SELECT Syntax

Sales Total
(SALE_YTD
table)

sum(SALE_YTD.SALE_TOTAL)

Sale Date
(SALE_YTD
table)

SALE_YTD.SALE_DATE

Double-click the Sale Date (SALE_YTD table) object and click on the
Properties tab.

10 Select the Automatic Time Hierarchy button and create a year and
month object.
11 Create the following indicator or boolean flag objects in the YTD Objects
class that will be used to create YTD measure objects in the remaining
activity steps:

Boolean Flag
Object
Sales in YTD
flag

SELECT syntax
CASE @Select(YTD Objects\Year of Sale Date (SALE_YTD table))
WHEN

@Select(Current Dates\Current Year)

THEN 1
ELSE 0 END
Sales in YTD
flag - current
month

CASE @Select(YTD Objects\Year of Sale Date (SALE_YTD table))


WHEN

@Select(Current Dates\Current Year)

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

Advanced Objects ScenariosLearners Guide

3-15

12 Create the following relative date-time measure objects:

Measure Object

SELECT Syntax

Total Sales YTD

sum((SALE_YTD.SALE_TOTAL)*@Select(YTD Objects\Sales in
YTD flag))

Total Sales YTD - current


month

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

13 Save and export the universe.


14 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. This should bring back the following results:

Note: The new derived table and context can be removed as they are not
used in subsequent activities.

3-16

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Working with Transact_SQL functions


This unit will look at Transact_SQL functions and how these can be used in
objects.
After completing this unit, you will be able to:

Identify Transact_SQL functions

Enable Designer to use Transact_SQL functions

Use Transact_SQL functions in objects

Transact_SQL functions
Unlike the Oracle PRM file, the SQL Server PRM file does not have any
Analytical Functions (or what you may call Transact_SQL functions in SQL
Server), for example RANK () OVER (PARTITION BY()), DENSE_RANK ()
OVER (PARTITION BY () ORDER BY()), and so forth.
SQL Server 2005 now allows the functionality of adding a Ranking expression
to your result set that is based on a ranking algorithm being applied to a
specified column. These functions are not standard available in Designer as
the sqlsrv.prm does not contain all new RDBMS function features.

How do Transact_SQL functions work?


Transact_SQL functions compute an aggregate value based on a group of
rows. They differ from aggregate functions in that they return multiple rows for
each group. The group of rows is called a window and is defined by the
analytic_clause. For each row, a sliding window of rows is defined. The window
determines the range of rows used to perform the calculations for the current
row. Window sizes can be based on either a physical number of rows or a
logical interval such as time.

analytic_clause:
Use OVER analytic_clause to indicate that the function operates on a
query result set. That is, it is computed after the FROM, WHERE, GROUP
BY, and HAVING clauses. You can specify Transact_SQL functions with
this clause in the select list or ORDER BY clause.
Note: You cannot specify any Transact_SQL function in any part of the
analytic_clause. That is, you cannot nest Transact_SQL functions.

query_partition_clause
Use the PARTITION BY clause to partition the query result set into groups
based on one or more value_expr. If you omit this clause, then the function
treats all rows of the query result set as a single group. Valid values of
value_expr are constants, columns, non-Transact_SQL functions,
function expressions.

Advanced Objects ScenariosLearners Guide

3-17

order_by_clause
Use the order_by_clause to specify how data is ordered within a partition.
you can order the values in a partition on multiple keys, each defined by a
value_expr and each qualified by an ordering sequence.
Note: Aggregate Transact_SQL functions for SQL Server do not allow
the use of the ORDER BY. This may differ with other RDBM that
support these type of functions.

Transact_SQL functions are the last set of operations performed in a query


except for the final ORDER BY clause. All joins and all WHERE, GROUP BY,
and HAVING clauses are completed before the analytic functions are
processed. Therefore, analytic functions can appear only in the select list or
ORDER BY clause.

3-18

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Using Transact_SQL functions


This section will look at some of the ranking and aggregate functions that can
be added to the sqlsrv.prm file.

ROW_NUMBER()
The most basic ranking function is ROW_NUMBER(). ROW_NUMBER()
returns a column as an expression that contains the rows number within the
result set. This is only a number used in the context of the result set, if the
result changes, the ROW_NUMBER() will change.
The ROW_NUMBER() expression is used with the following additional
clauses:

OVER: Determines the partitioning and ordering of the rowset before the
associated window function is applied.

PARTITION BY: Divides the result set into partitions. The window
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 nonunique column, it will break the tie and still produce a running count so
no rows will have the same number.
An example ROW_NUMBER SQL Statement is as follows:
SELECT ROW_NUMBER() OVER (PARTITION BY 1 ORDER BY
CLIENT_ID) AS SURROGATE, * FROM dbo.CLIENT

This will output the following result set:

RANK()
RANK() works a lot like ROW_NUMBER() and uses the same expression
clauses as described in the ROW_NUMBER() section.
The main difference is that the RANK() function will not break ties, you will not
get a unique value for ties. The RANK() function assigns the same key if the
value is the same.

Aggregate Transact_SQL functions


Additional to the ranking options you can use the Over () and Partition By()
elements in combination with aggregate functions like Count, Sum, Min, Max
and Average.

Advanced Objects ScenariosLearners Guide

3-19

To add Transact-SQL functions to Designer


Note: These functions may be called differently according to the RDBMS
used. For SQL Server 2005 they are referred to as Transact_SQL
functions, Oracle refers to them as Analytical Functions, and Red
Brick refers to these as RISQ functions.
You can add Transact-SQL functions to Designer by amending the relevant
<driver>.PRM file as follows:
1

Locate the appropriate PRM file. Browse to the directory that stores the
PRM file for your target database in:
C\Program Files\Business Objects\BusinessObjects Enterprise
11.5\win32_x86\dataAccess\connectionsServer\<RDBMS>\

Open the <driver>.prm file in an XML editor.


To allow use of Transact-SQL functions to be used in Designer, additional
parameters need to be added to the Configuration section.

Add the following parameter to the Configuration section:


<Parameter Name="RISQL_FUNCTIONS">RANK,SUM,AVG,COUNT,
MIN,MAX,DENSE_RANK,NTILE,ROW_NUMBER</Parameter>

This parameter lists the RISQL functions supported by the database. The
above list for SQL Server may not be complete and additional functions
that are supported by the database can be added at any stage in time.
4

Add a second parameter to the Configuration section:


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

The Over Clause parameter allows Business Objects products to include


RISQL functions when generating SQL.
5

To add new RDBMS supported Transact-SQL functions, expand sections


as required.

</Function>
<Function Group= [False] ID= [Function Name] InMacro=
[False] Type= [Type(Numeric,Alphanumeric,Date)] >
<Arguments>
<Argument Type= [Type (ALL)] ></Argument>
<Argument Type= [Type (ALL)] ></Argument>
</Arguments>
<SQL> [SQL Syntax (function () Over (Partition By() )] </
SQL>
</Function>

3-20

Set values by entering the value in the appropriate tag.

Save and close the file.

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Activity: Working with Transact_SQL functions


Objective

Query with Transact_SQL functions in SQL Server

Add Transact_SQL functions to the PRM file

Create objects using Transact_SQL functions

Instructions

Query with Transact_SQL functions in SQL ServerLogin to SQL


Server Management Studio. Go to Start > Programs> Microsoft SQL
Server 2005 > SQL Server Management Studio.
Enter the sa login credentials and click on Connect.
Select the New Query button.
Select MotorsAdv from the databases dropdown list.

Enter the following SQL Statement:

2
3

SELECT ROW_NUMBER() OVER (PARTITION BY 1 ORDER BY


CLIENT_ID) AS SURROGATE, * FROM dbo.CLIENT

You should get the following results:

Advanced Objects ScenariosLearners Guide

3-21

Enter the following SQL Statement:


SELECT
RANK() OVER (PARTITION BY 1 ORDER BY
CLIENT.CLIENT_LASTNAME) as RANK, *
FROM dbo.CLIENT

You should get the following results:

Add Transact_SQL functions to the PRM file


You can add RISQL functions to Designer by amending the relevant
<driver>.PRM file as follows:
1

Open the sqlsvr.prm file in Microsoft Visual Studio.


To allow use of RISQL functions for SQL Server 2005 additional
parameters need to be added to the Configuration section.

Add the following parameter to the Configuration section:


<Parameter Name="RISQL_FUNCTIONS">RANK,SUM,AVG,COUNT,
MIN,MAX,DENSE_RANK,NTILE,ROW_NUMBER</Parameter>

This parameter lists the RISQL functions supported by the database. The
above list for SQL Server may not be complete and additional functions
that are supported by the database can be added at any stage in time.
3

Add a second parameter to the Configuration section:


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

The Over Clause parameter allows Business Objects products to include


RISQL functions when generating SQL.
4

To add the ROW_NUMBER() function add the following syntax in the


Function section of the sqlsrv.prm file:

</Function>
<Function Group="False" ID="ROW_NUMBER" InMacro="False"
Type="Numeric">
<Arguments>
<Argument Type="All"></Argument>
<Argument Type="All"></Argument>
</Arguments>
<SQL>ROW_NUMBER() OVER (PARTITION BY ($1) ORDER BY ($2))
as Row_Number</SQL>
</Function>

3-22

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

To add the RANK() function add the following syntax in the Function
section of the sqlsrv.prm file:

</Function>
<Function Group="False" ID="RANK" InMacro="False"
Type="Numeric">
<Arguments>
<Argument Type="All"></Argument>
<Argument Type="All"></Argument>
</Arguments>
<SQL>Rank() Over (Partition By 1 Order By ($1)) as Rank</
SQL>
</Function>

To add the SUM() function add the following syntax in the Function
section of the sqlsrv.prm file:

<Function Group="False" ID="SUM_OVER" InMacro="False"


Type="Numeric">
<Arguments>
<Argument Type="All"></Argument>
<Argument Type="All"></Argument>
</Arguments>
<SQL>SUM() OVER (PARTITION BY ($1)) as Sum_Over</SQL>
</Function>

Save and close the file.

Note: RISQ (Transact_SQL) functions can not have descriptions added in the
<driver>.<language>.prm files. Added descriptions for RISQL functions
will not show up in Designer.

Create objects using Transact_SQL functions


1

Make sure that Designer is restarted after making the changes in the PRM
file.

Import the MotorsAdv universe.

Create a new Row Number detail object in the Client class.


Associate the detail with the Client Name dimension.

Set the data type to numeric.

Edit the SELECT statement and expand the Numeric functions list. The
new Row Number function will now show up.

Enter the following syntax:


Row_Number() Over (Partition By 1 Order By
(CLIENT.CLIENT_LASTNAME)) as Row_Number

Create a new Rank detail object in the Client class.


Associate the detail object with the Client Name dimension.

Set the data type to numeric.

Edit the SELECT statement and expand the Numeric functions list. The
new Rank function shows up in the list.

Advanced Objects ScenariosLearners Guide

3-23

10 Enter the following syntax:


Rank() Over (Partition By 1 Order By
(CLIENT.CLIENT_LASTNAME)) as Rank

11 Save and export the universe.


12 Launch Web Intelligence and create a new query using Client Name,
Row Number and Rank objects.
13 In Designer, import the MotorsAdv universe.
14 Create a new measure object in the Sales Figures subclass called Sales
Total per Client.
15 Add the following SELECT statement to the object:
SUM(SALE.SALE_TOTAL) OVER (PARTITION BY SALE.CLIENT_ID)
as Sum_Over

16 Save and export the universe.


17 Create a new Web Intelligence document using the Sales Total per
Client, Client ID (detail object), Sales Total, and Invoice ID Number.
18 Add a break on the Client ID column and add a sum calculation to the
Sales Total column. The sum value should return the same value as the
Sales Total per Client.

3-24

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Lesson summary
Review
Quiz: Advanced Objects
1

True or False: You can use all database functionality over and above
what is listed in the functions list in the Select and Where windows.

List three different Transact-SQL functions

Summary
After completing this lesson, you are now able to:

Use and combine database functions in objects

Create static and dynamic data ranges

Create relative date-time objects based on a prompted period

Create current date-time objects

Create YTD objects

Identify Transact_SQL functions

Enable Designer to use Transact_SQL functions

Use Transact_SQL functions in objects

Advanced Objects ScenariosLearners Guide

3-25

3-26

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Lesson 4

Complex Predefined Conditions,


LOVs and Joins
This lesson will look at how we can create complex Predefined Conditions, that
will aid users to answer more specific questions in their reports. This lesson will
also look at how LOVs can be customized to have an ALL values entry, and at
prompts and conditional uses in Joins.
In this lesson you will learn about:

Complex predefined conditions

Advanced LOVs

Advanced Join syntaxes

Duration: 1.5 hours

Copyright 2007 Business Objects. All rights reserved.

4-1

Complex predefined conditions


In this unit, you will be able to recognize the use of a sub query within a
condition and build sub queries via a manual and/or wizard method.
After completing this unit, you will be able to:

Define subqueries in predefined conditions

Define @Prompt syntaxes in predefined conditions

Subqueries in Predefined Conditions


End users may wish to see the most recent sale details, for example the most
recent sales date and the revenue that was made on that date.
In Web Intelligence the end user can run a report with Sale Date and Sales
Revenue, and apply a Maximum for the Sale Date. However, as shown in the
example below, the Sales Revenue that gets returned for the maximum date
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 table with =Max([Sale Date]) and
another column with Sales Revenue, you will notice that the Sales Revenue
showing for the maximum Sale Date is actually the total revenue for all sale
dates.
This can be solved by using a subquery. Instead of having the end user
struggle with the appropriate subquery syntax, this can be done in a predefined
condition.

4-2

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

The subquery condition will need to contain the following syntax:


SALE.SALE_DATE

ALL

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

)
This predefined condition will make sure that the result in Web Intelligence
appears correct. When the end user creates a new Web Intelligence document
using Sale Date and Sales Revenue in the Result Objects pane, and the new
condition in the Query Filter pane, the end result shows the maximum Sale
Date and the correct Sales Revenue value of 17,505.

The benefit of using this method is that it allows the end user to combine
several objects in a report and get the correct maximum date and sales
revenue values.

Using subqueries this way allows designers to use aggregate functions in the
WHERE clause. It is also possible to extend this syntax and generate a
condition that will allow end users to retrieve the maximum sales date for each
client together with the corresponding sales revenue.
In the MotorsAdv database there are a number of clients that have more than
one sales date record.

Complex Predefined Conditions, LOVs and JoinsLearners Guide

4-3

Using a predefined subquery filter will allow end users to return the maximum
date per client. The sunquery condition will need to contain the following
syntax:
( CLIENT.CLIENT_ID=SALE.CLIENT_ID
AND

SALE.SALE_DATE

ALL

(
SELECT
max( SALE.SALE_DATE )
FROM
SALE,
CLIENT

SubAlias__1

WHERE
(SubAlias__1.CLIENT_ID=SALE.CLIENT_ID)
AND

(SALE.SALE_TYPE='S')

AND SubAlias__1.CLIENT_LASTNAME + ', ' +


SubAlias__1.CLIENT_FIRSTNAME = CLIENT.CLIENT_LASTNAME + ', '
+ CLIENT.CLIENT_FIRSTNAME
)
)

When the end user creates a new Web Intelligence document using Client
Name, Sale Date and Sales Revenue in the Result Objects pane, and the
new condition in the Query Filter pane, the end result shows the maximum
Sale Date and the corresponding Sales Revenue value for each Client Name.

4-4

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Creating complex subqueries


The subquery shown in the previous example can seem rather complex. How
do you know which columns to reference to get the correct result in a report.
The Designer Query Panel can aid in creating complex subqueries or
correlated queries.
Correlated queries are queries where the inner level query is dependent on the
main query, making it necessary to execute the nested query once for each
row in the main query and at the same time tying the two queries together.
SELECT
CLIENT.CLIENT_LASTNAME + , + CLIENT.CLIENT_FIRSTNAME,
SALE.SALE_DATE
FROM
CLIENT,
SALE
WHERE
(CLIENT.CLIENT_ID=SALE.CLIENT_ID)
AND (SALE.SALE_TYPE=S)
AND

SALE.SALE_DATE

ALL

(
SELECT
max( SALE.SALE_DATE )
FROM
SALE,
CLIENT

SubAlias__1

WHERE
(SubAlias__1.CLIENT_ID=SALE.CLIENT_ID)
AND

(SALE.SALE_TYPE='S')

AND SubAlias__1.CLIENT_LASTNAME + ', ' +


SubAlias__1.CLIENT_FIRSTNAME = CLIENT.CLIENT_LASTNAME + ', '
+ CLIENT.CLIENT_FIRSTNAME
)
)

As this subquery is used in the WHERE clause, there is no outer SELECT for
this subquery. The only reference needed is the Join between the two tables
used in this subquery.

Complex Predefined Conditions, LOVs and JoinsLearners Guide

4-5

To define a corrolated subquery syntax for a predefined


condition
1

Open the MotorsAdv.unv file in Designer.

Open the Designer Query Panel via Tools> Query Panel.

Drag the objects that are needed to define the subquery into the Result
Objects pane. In our example Client Name and Sale Date.

Drag the Sale Date to the Conditions pane.

Select the Equal to operator.

Select the Calculation operand.The Complex Condition Wizard opens

In the Select an Object dialog box, select the Sale Date object.
This object represent the following section in the syntax:
SALE.SALE_DATE

Click Begin.

In the Select a Function dialog box select Maximum.


This function represent the following section in the syntax:
max( SALE.SALE_DATE )

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

ALL

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


the comparison is true for every value returned by the subquery.

ANY - Is a keyword that denotes that the search condition is true if


the comparison is true for at least one of the values returned.
Select the All values option and click Finish.
16 Click View SQL. The SQL displays the syntax to be used for the
subquery. Copy the SQL.
Note: As the syntax is going to be used for a WHERE clause only the
statement below the WHERE needs to be copied.
17 Create a new condition object and paste the syntax into the WHERE
clause.

4-6

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Activity: Subqueries in Predefined Conditions


Objective

Create a new predefined condition that returns the maximum Sale


Date per Client Country and Region.

Instructions
1

Open the MotorsAdv.unv file in Designer.

Open the Designer Query Panel via Tools> Query Panel.

Drag the objects outlined in the objective into the Result Objects pane.

Drag the appropriate object to the Conditions pane.

Select the Equal to operator.

Select the Calculation operand.


The Complex Condition Wizard opens

In the Select an Object dialog box, select the appropriate object.

Click Begin.

In the Select a Function dialog box select Maximum.

10 Click Next.
11 The Define the Level of Calculation dialog box opens. Select Globally.
12 Click Next.
13 The Synchronize your Calculation dialog box opens.
This dialog box is in essence asking us which object we would like to tie
our nested query to. Select the For each value of one or more objects
option.
14 When selecting this option the objects added to the Results Objects pane
in step 3, are shown in their related universe class.
Based on the objective select the appropriate two objects and click Next.
15 The Set the Number of Values to Compare dialog box opens.
Select the All values option and click Finish.
16 Click View SQL.
The SQL displays the syntax to be used for the subquery.
17 Copy the SQL.
Note: As the syntax is going to be used for a WHERE clause only the
statement below the WHERE needs to be copied.
18 Create a new Maximum Sale Date for each Country and Region
condition object and paste the syntax into the WHERE clause.
19 Launch Web Intelligence and create a new Web Intelligence document.
20 Drag the Client Country, Region, Sale Date and Sales Revenue objects
into the Result Objects pane and click Run Query.
21 Apply a break on the Client Country column and also on the Region
column. Apply a maximum calculation on the Sale Date column.
22 Click Edit Query.
23 Click Add Query and drag the Client Country, Region, Sale Date and
Sales Revenue objects into the Result Objects pane, and the Maximum
Sale Date for each Country and Region condition into the Query Filters
pane.
24 Click Run Queries.

Complex Predefined Conditions, LOVs and JoinsLearners Guide

4-7

25 Select the 3rd option.


26 Drag the Query 2 Client Country, Region, Sale Date objects, together
with the Sales Revenue from the Data pane to the Report pane, next to
first table.
27 A new table will appear next to the first table containing only the
maximum sale date values for each country and region.

4-8

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

@Prompt scenarios in Predefined Conditions


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

To create an ALL Values prompt in a Predefined Condition.


1

Open the MotorsAdv.unv file In Designer.

Click in the Filter icon at the bottom of the Classes and Objects pane.

The Classes and Objects pane changes to show the Condition Object
View.

Click the class in which you wish the condition to appear.

Insert a new condition via the Insert Condition toolbar icon, or by


selecting Insert Condition from the drop-down menu.
This opens the Edit Properties dialog box for condition objects.

In the Name field, enter a name for the condition object.

In the Description field, enter a help message for users describing the
condition and any effect it will have on queries they make.

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

The syntax to insert is as follows:


TABLENAME.COLUMN_NAME IN
@Prompt('message','type','{Class\Object}',multi, free)
OR
('*') IN
@Prompt('message','type','{Class\Object}',multi, free)

So how does this syntax work?

When the user selects a value from the LOV or enters a value
directly in the box, the first part of the condition is valid. The second
part will not be valid at this point. However due to the use of the OR
statement, the condition is valid if one of the two parts is valid.

When the user enters an asterisk (*), the second part of the condition
is valid. Due to the use of the OR statement, the condition is always
valid (* = *) and all values will be returned

10 Click Parse.
11 Click OK.
12 Save and export the universe.
13 When using the new Prompt condition in the Query Filter pane in a new
Web Intelligence document, it allows end users to select one or more
values from the list or type * in the Type a value box. This will return all
values of the object.
Note: You can make sure that end user can select ALL from the LOV. This
will be covered in the LOV section of this lesson.

Complex Predefined Conditions, LOVs and JoinsLearners Guide

4-9

To create a Predefined Condition that returns a pattern


selection.
1

In Designer open the MotorsAdv.unv file.

Click in the Filter icon at the bottom of the Classes and Objects pane.

The Classes and Objects pane changes to show the Condition Object
View.

Click the class in which you wish the condition to appear.

Insert a new condition via the Insert Condition toolbar icon, or by


selecting Insert Condition from the drop-down menu.
This opens the Edit Properties dialog box for condition objects.

In the Name field, enter a name for the condition object.

In the Description field, enter a help message for users describing the
condition and any effect it will have on queries they make.

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

The syntax to insert is as follows:


((TABLENAME.COLUMN_NAME) LIKE
(@Prompt('message','type',,,)+'%')

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

4-10

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Activity: @Prompt syntaxes in Predefined


Conditions
Objective

Create a new predefined condition using an ALL values prompt

Create a new predefined condition using a match pattern prompt.

Instructions
Create a new predefined condition using an ALL values prompt
1 In Designer open the MotorsAdv.unv file.
2 Click in the Filter icon at the bottom of the Classes and Objects pane.
3 Click the Client class.
4 Insert a new condition via the Insert Condition toolbar icon, or by
selecting Insert Condition from the drop-down menu.
This opens the Edit Properties dialog box for condition objects.
5 In the Name field, enter Client ALL values prompt.
6 In the Description field, enter a help message for users describing the
condition and any effect it will have on queries they make, for example:
Select one or more values from the list, enter asterisk (*) to return all
value.
7 Enter the condition directly in the WHERE field or via the Edit Where
Clause box by selecting the << button.
The syntax to insert is as follows:
@Select(Client\Client Name) 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)

Click Parse.

Click OK.

10 Save and export the universe.


11 Launch Web Intelligence.
12 Create a new Web Intelligence document using Client Name in the
Result Objects pane, and the new Client ALL values prompt condition
in the Query Filter pane.
13 Click Run Query.
14 In the Type a value box enter * and click the arrow.
15 Click Run Query.
The report returns all Client Name values.
16 Edit the query and re-run. Remove the asterisk and test that the end user
can also select multiple values from the LOV.
Note: You may need to click on Refresh List if the values are not shown.
17 Log out of Web Intelligence and return to the MotorsAdv universe in
Designer.

Complex Predefined Conditions, LOVs and JoinsLearners Guide

4-11

Create a new predefined condition using a match pattern prompt


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

Enter the first letter of the surname.

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

Enter a pattern like: T%, K%


3 Enter the condition directly in the WHERE field or via the Edit Where
Clause box by selecting the << button.
The syntax to insert is as follows:
(@Select(Client\Client Name)
LIKE (@Prompt('enter','A',,,)+'%')

Click Parse.

Click OK.

Save and export the universe.

Launch Web Intelligence.

Create a new Web Intelligence document using Region and Client


Name in the Result Objects pane, and the new Client Name Pattern
Prompt condition in the Query Filter pane.

Click Run Query.


The Prompts dialog box appears.

10 In the box enter T%, K%.


11 Click Run Query.
12 The report returns all clients with a lastname starting with T and a
firstname starting with K.
Note: This syntax can be extended to make sure the user can either user
upper or lower case letters:
13 Edit the Client Name Pattern Prompt condition in Designer.
14 Modify the syntax as follows:
(@Select(Client\Client Name) LIKE
lower(@Prompt('enter','A',,,))+'%') OR
(@Select(Client\Client Name) LIKE
upper(@Prompt('enter','A',,,))+'%')

15 Save and export the universe and test in Web Intelligence using upper
and lower case patterns.

4-12

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Advanced LOVs
This unit explains different techniques for customizing your list of values.
After completing this unit, you will be able to

Add an ALL values entry to an LOV

Sort LOVs chronologically

Arranging LOVs using an index

Customize LOVs
As shown in the Predefined Conditions section you can create prompt that
allows users to enter an asterisk (*) to return all values. You can modify the
LOV to also show an ALL values entry. When selecting this it will also return
the full list of values of the object.

To modify the LOV to have an ALL values entry


1

Create a new object.


Note: This object will only serve as an ALL values object for use in an
ALL values prompt syntax.

Use the following SELECT syntax for this object:


CASE TABLENAME.COLUMN_NAME WHEN TABLENAME.COLUMN_NAME
THEN 'ALL' ELSE TABLENAME.COLUMN_NAME END

The same TABLENAME.COLUMN_NAME is referenced in all sections of


the CASE statement. This syntax will convert each of the column values
to a generic ALL value.
3

Click the Properties tab.

Click Edit.

In the List of Values query panel select the Combine Queries toolbar
icon. This will now generate a second query tab with the UNION symbol.

In the Query 2 tab, remove the newly created ALL values object and drag
in the original object used in the ALL values prompt.

Click View SQL. The SQL shows the UNION between the ALL values
object and the original prompt object.
SELECT DISTINCT
CASE TABLENAME.COLUMN_NAME WHEN TABLENAME.COLUMN_NAME
THEN 'ALL' ELSE TABLENAME.COLUMN_NAME END
FROM
TABLENAME
UNION
SELECT DISTINCT
TABLENAME.COLUMN_NAME
FROM
TABLENAME

Click OK to close the SQL Viewer.

Click Run.

Complex Predefined Conditions, LOVs and JoinsLearners Guide

4-13

10 Click Display. The LOV contains a list of all individual column values and
the value ALL.
11 Click OK twice.
12 Click the Show or Hide Item toolbar icon to hide the ALL values object.
13 Click in the Filter icon at the bottom of the Classes and Objects pane.
14 Open the ALL values prompt condition.
15 The prompt syntax will now need to reference the ALL values object LOV.
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 will make sure that when the ALL value is selected in the
LOV it has a reference and the query will return all object values.
When used in Web Intelligence, the end user will see the value ALL as
part of the LOV of the prompted object. Selecting this will return all
values.

4-14

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Activity: Modifying LOVs


Objective

Create an Client ALL values object.

Modify the LOV for the Client ALL values prompt.

Instructions
1

In Designer open the MotorsAdv.unv file.

Create a new class called LOV Objects.

Create a new Client_ALL object in the LOV Objects class.

Click Apply.

Use the following SELECT syntax for the Client_ALL object:


CASE @Select(Client\Client Name) WHEN
@Select(Client\Client Name) THEN 'ALL'
@Select(Client\Client Name) END

ELSE

This syntax will convert all Client Name values to ALL


6

Click the Properties tab.

Click Edit.

In the List of Values query panel select the Combine Queries toolbar
icon. This will now generate a second query tab with the UNION symbol.

In the Query 2 tab, remove the Client_ALL object and drag in the Client
Name object instead.

10 Click View SQL. The SQL shows the UNION between the Client Name
object and the Client_ALL object. Click OK to close the SQL Viewer.
11 Click Run.
12 Click Display. The LOV now contains a list of all individual client names
and the value ALL.
13 Click OK.
14 Select the Export with universe option.
15 Click OK.
16 Click the Show or Hide Item toolbar icon to hide the LOV Objects class.
17 Click in the Filter icon at the bottom of the Classes and Objects pane.
18 Open the Client ALL values Prompt condition.
19 The prompt syntax will now need 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)

Complex Predefined Conditions, LOVs and JoinsLearners Guide

4-15

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 will make sure that when the ALL value is selected in the
LOV it has a reference and the query will return all client name
values.The complete modified syntax should read:
@Select(Client\Client Name) IN
@Prompt('Select value or type * for all values','A','LOV
Objects\Client_ALL',multi, free)
OR ('*') IN
@Prompt('Select value or type * for all values' ,'A','LOV
Objects\Client_ALL',multi, free)
OR ('ALL')
IN @Prompt('Select value or type * for all values)
','A','LOV Objects\Client_ALL',multi, free)

21 Save and export the universe.


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

4-16

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Sorting and arranging LOVs


List of values are sorted alphabetically by default. This section will look at a
date object and how to sort these in the LOV in chronological order instead.
This section will also look at how an ABC index can be set up to help end users
navigate through values easier when dealing with a larger LOV.

Sorting LOVs Chronological


List of Values are sorted alphabetically. When you edit the list of values you
can choose to sort the list descending or ascending, but there is no custom
sorting option.

To retrieve alphabetically listed values works fine for most objects, however
this poses a problem for month and weekday string values.

Complex Predefined Conditions, LOVs and JoinsLearners Guide

4-17

To chronologically sort month values in a LOV


1

In Designer open the MotorsAdv.unv file.

Edit the Rental Month object.

In the Properties tab of the Rental Month object, click Display.


The values are shown in alphabetical order instead of chronological
order. Click OK to close.

Click the Edit button.


The way to sort the data would be by using an ORDER BY clause, using
a month number function. The restriction in SQL Server is that you can
not use a SELECT DISTINCT together with an ORDER BY clause when
the object in the SELECT differs from the object used in the ORDER BY.
To get around this you can generate a GROUP BY clause.

Click the View SQL toolbar icon and modify the SQL to the following
syntax:
SELECT
max(Datename(mm,RENTAL.SALE_DATE))
FROM
SALE RENTAL
WHERE
( RENTAL.SALE_TYPE='R'

GROUP BY Datename(mm,RENTAL.SALE_DATE),
Datepart(mm,RENTAL.SALE_DATE)
ORDER BY Datepart(mm,RENTAL.SALE_DATE)

The use of the max() function will act as a SELECT DISTINCT, however
as this is an aggregate a GROUP BY has to be added. This will now
allow you to use the ORDER BY to create the chronically list of values.
Note: Make sure the option Do not regenerate SQL before running is still
checked.
6

Click OK. No error should be returned.

Click Run.

Click Display to see the results.

Note: Sorting the LOV in chronological order will only affect what is viewed
via the Value(s) in List option when creating a report filter. This does not
ensure that the Month object displays the values in chronological order
in the report.

4-18

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Arranging LOV data as a index


Large LOVs can become difficult to navigate through for end users. To make
the list smaller and easier to navigate is by using an index.

In Designer an LOV can be viewed tabular or hierarchical, however the


hierarchical option is not available for Web Intelligence end users. The same
list hierarchy can be achieved in Web Intelligence by using a Cascading List of
Values.

To create an index in a Cascading List of Values


1

Open the MotorsAdv.unv file in Designer.

Insert a new object using the Insert Object toolbar icon.

In the SELECT use the following syntax:


Substring(TABLENAME.COLUMN_NAME, 1, 1)

This will syntax will return the first letter of the column.
4

Click OK.

Click the Show or hide item toolbar icon to hide the object.

Select Tools > List of Values > Create cascading list of values.

Complex Predefined Conditions, LOVs and JoinsLearners Guide

4-19

Add the first letter object to the cascading list of values menu, followed by
the original object.

Verify that the Hierarchical View check box is selected.

Click Generate LOVs.


As the selected objects may already contains LOVs, a message appears
asking whether you want to overwrite the existing values.

10 Click OK.
11 Save and export the universe.

4-20

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Activity: Sorting and arranging LOVs


Objective

Sorting the LOV of a weekday object.

Create a cascading index LOV.

Instructions
Sorting the LOV of a weekday object
1 In Designer open the MotorsAdv.unv file.
2 Create a new Weekday of Sale Date object using the following SELECT
syntax:
Datename(weekday,SALE.SALE_DATE)

In the Properties tab of the new Weekday of Sale Date object, click
Display.
The values are shown in alphabetical order instead of chronological
order. Click OK to close.

Click the Edit button.

Click the View SQL toolbar icon.


The way to sort the data would be by using an ORDER BY clause,
however the ORDER BY can not be used in conjunction with the
SELECT DISTINCT. By removing the DISTINCT, values will be
duplicated. This is why we will use a Max() function to make sure distinct
values are returned and to make sure an ORDER BY clause can be
added to sort the data chronologically.

Modify the SQL to the following syntax:


SELECT
max(datename(weekday,SALE.SALE_DATE))
FROM
SALE
WHERE
( SALE.SALE_TYPE='S'

GROUP BY Datename(weekday,SALE.SALE_DATE),
{fn dayofweek(SALE.SALE_DATE)}
ORDER BY{fn dayofweek(SALE.SALE_DATE)}

The use of the max() function will act as a SELECT DISTINCT, however
as this is an aggregate a GROUP BY has to be added. This will now
allow you to use the ORDER BY to create the chronological list of values.
7

Tick the Do not regenerate SQL before running box.

Click OK.

Click Run.

Complex Predefined Conditions, LOVs and JoinsLearners Guide

4-21

10 Click Display to see the results.

Note: Sorting the LOV in chronological order will only affect what is viewed
via the Value(s) in List option when creating a report filter. This does not
make sure that the Weekday object displays the values in chronological
order in the report.
To get the order in the object you can use a concatenation syntax:
CAST({fn dayofweek(SALE.SALE_DATE)} as Varchar) + '- '
+ datename(weekday, SALE.SALE_DATE)

Or if the number values are not to be shown this can be done with a
longer CASE replacement statement:
CASE CAST({fn dayofweek(SALE.SALE_DATE)}as Varchar)
WHEN 1 THEN 'Sunday' ELSE
CASE CAST({fn dayofweek(SALE.SALE_DATE)}as Varchar)
WHEN 2 THEN 'Monday' ELSE
CASE CAST({fn dayofweek(SALE.SALE_DATE)}as Varchar)
WHEN 3 THEN 'Tuesday' ELSE
CASE CAST({fn dayofweek(SALE.SALE_DATE)}as Varchar)
WHEN 4 THEN 'Wednesday' ELSE
CASE CAST({fn dayofweek(SALE.SALE_DATE)}as Varchar)
WHEN 5 THEN 'Thursday' ELSE
CASE CAST({fn dayofweek(SALE.SALE_DATE)}as Varchar)
WHEN 6 THEN 'Friday' ELSE
CASE CAST({fn dayofweek(SALE.SALE_DATE)}as
Varchar)WHEN 7 THEN 'Saturday' ELSE
CAST({fn dayofweek(SALE.SALE_DATE)}as Varchar)END END
END END END END END

4-22

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Create a cascading index LOV


11 in the LOV Objects class
12 Drag the Manager object into the Result Objects pane.
13 Select Manager and apply a Quick Filter. Select the ellipsis button to
see the values. Note that the values to select from are listed in A-Z
format.
14 Select B and click the arrow.
The list now only contains names starting with a letter B to select from.
15 Select a name from the list to return back to the Report Panel.
16 Test the same by using the prompt operator. Select Prompt as the
operator and click Run Query.
The LOV to select from is shown as an indexed A-Z list.
17 Return to Designer and restore the old Manager LOV using the following
steps:

Edit the Manager object and select the Properties tab

Click Edit.

Remove the cascading LOV generated condition.

Click Run.

Complex Predefined Conditions, LOVs and JoinsLearners Guide

4-23

Advanced Join syntaxes


This unit explains joins with prompts and methods to accomplish a join strategy
that is selected by the user.
After completing this unit, you will be able to:

Define @prompt functions in joins

Define conditional joins

Defining an @prompt condition in a join


Just as you can use prompts in object definitions and in predefined conditions
you can define prompts in joins. If a prompt has to be applied to all objects for
that table you can define a self join containing a prompt. Sometimes you want
a prompt to limit the result set when 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 you can 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 for prompts in objects or predefined conditions:
Note: In join definitions you cant use the @Select and @Where functions.

4-24

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Defining conditional join paths


In some cases designers might want to define conditional joins. Some tables
may have several identification categories keys for products.
A complex join can be defined between the Product table and the different
levels of categories.

The prompt will get end users to select the category they need to query on and
depending on the selection the CASE statement will link the relevant joins.

Complex Predefined Conditions, LOVs and JoinsLearners Guide

4-25

Activity: Complex Joins


Objective

Add a prompt to a join.

Create a conditional join.

Instructions
Add a prompt to a join
1 In Designer open the MotorsAdv.unv file.
2 Drag a join line from CLIENT.CLIENT_TOWN to
CLIENT.CLIENT_ADDRESS.
3 Double-click the new join and click Edit.
4 Remove the CLIENT.CLIENT_ADDRESS entry.
5 Replace this by the following @prompt syntax:
CLIENT.CLIENT_TOWN=@Prompt('enter town','A',,mono,free)

Click Parse.

Click OK three times to commit the changes.

Make sure the new join has been added to the relevant contexts.

Save and export the universe.

10 Create a new Web Intelligence document.


11 Drag the Client Name and the Sales Revenue objects to the Result
Objects pane.
12 Click View SQL to show the prompt in the join.
13 Click Run Query.
14 The user is prompted to enter a town. Type the value Malibu.
15 In Designer open the MotorsAdv.unv file and remove the
CLIENT.CLIENT_TOWN join.

Create a conditional join


16 Double-click the join between the CLIENT and EMPLOYEE table.
17 Modify the join using the following syntax:
CLIENT.EMPLOYEE_ID = CASE @prompt('Manager or Employee?
','A',{'Manager','Employee'},,) WHEN 'Manager' THEN
EMPLOYEE.EMP_MGR_ID ELSE EMPLOYEE.EMP_ID END

18 Click OK to close.
19 To see the full effect of the join drag the CLIENT.EMPLOYEE_ID,
EMPLOYEE.EMP_ID and EMPLOYEE.EMP_MGR_ID to the Employees
class as temporary objects.
20 Make sure the new join has been added to the relevant contexts.
21 Save and export the universe.
22 Launch Web Intelligence and create a new query using the three ID
objects created in step 19, the Client Name and the Sales Person.
23 In Designer open the MotorsAdv.unv file and remove the conditional join.

4-26

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Lesson summary
Review
Quiz: Complex Predefined Conditions and LOVs
1

What is the difference between ALL and ANY when creating a sub
query?

When setting up a predefined condition that returns a pattern, what 2


important syntaxes are required to achieve this?

What functions can not be used in a Join definition?

Summary
After completing this lesson, you are now able to:

Define subqueries in predefined conditions

Define @Prompt syntaxes in predefined conditions

Add an ALL values entry to an LOV

Sort LOVs chronologically

Arranging LOVs using an index

Define @prompt functions in joins

Define conditional joins

Complex Predefined Conditions, LOVs and JoinsLearners Guide

4-27

4-28

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Lesson 5

SQL Traps revisited


This lesson deals with two common SQL Traps: Chasm and Fan. Chasm traps
and fan traps are problems inherent in SQL that are caused by the order in which
the elements of the SELECT statement are processed.
In this lesson you will learn about:

Chasm Traps

Fan Traps

Duration: 1 hour

Copyright 2007 Business Objects. All rights reserved.

5-1

Chasm Traps
In all Universes with two or more fact tables containing measures and relating
to at least one common dimension table, chasm traps occur. This unit will look
a resolving chasm traps in a universe schema.
After completing this unit, you will be able to:

Identify chasm traps in a universe schema

Resolve chasm traps

Chasm traps in a universe schema


A chasm trap is a common problem in relational database schemas in which a
join path returns more data than expected.
A chasm trap is a type of join path between three tables when two many-toone joins converge on a single table, and there is no context in place that
separates the converging join paths.
You only get incorrect results when the following circumstances all exist
simultaneously:
1

There is a many-to-one-to-many relationship between three tables in


the universe structure.

The query includes objects based on the two many tables.

There are multiple rows returned for a single dimension value.

For example, in this diagram there is no loop, but the flow around the three
tables is many-to-one-to-many.

Note: A chasm trap is not dependent on the object types. The query could be
made up of only dimensions, only details, or only measures, or any
combination of the three types with the many tables for a chasm to
occur.
When a query that uses objects Y and Z is run, the inferred SQL includes
tables B, C, and A that have a many-one-many relationship respectively. The
chasm trap causes a query to return every possible combination of rows for
one measure with every possible combination of rows for the other measure.
This results in the values for each object being multiplied by the other. The
effect is similar to a Cartesian product but is known as a chasm trap.
The chasm trap is resolved by executing separate SELECT statements for
object Y and object Z.

5-2

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

The schema below shows an example chasm trap.

Chasm traps can be identified by analyzing the one-to-many (1-N) join paths
in your schema. In this unit we will look at two of the Chasm traps shown in the
schema:

Products, Store_Facts and Order Position.

Products, Store_Facts and Invoice.

The chasm trap occurs when both fact tables are queried together in the same
SQL. To illustrate this problem we will look at the Products Store_Facts and
Order Position trap.
To look at how a chasm trap affects query results query is run using the
following columns:

Table

Column / SQL Syntax

PRODUCTS

Product_ID

PRODUCTS

Product_Name

ORDER_POSITION

Order_Position

ORDER_POSITION

sum(ORDER_POSITION.Order_Pos_Value)

This query results in the following rows:

SQL Traps revisitedLearners Guide

5-3

A second query is run using the following columns:

Table

Column / SQL Syntax

PRODUCTS

Product_ID

PRODUCTS

Product_Name

STORE_FACTS

Store_ID

STORE_FACTS

sum(STORE_FACTS.Difference_in_Store)

This query results in the following rows:

Each query on its own returns accurate results. Combining data from the two
queries will result in a Chasm Trap:

The Order Position Values are multiplied by the respective number of store fact
lines for the product.
Note: The Multiple SQL statements for each measure option in File >
Parameters > SQL must be deactivated to show the chasm trap.

Resolving Chasm Traps


A chasm trap can be resolved by:

5-4

using the Multiple SQL for each measure option

using Contexts

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Using multiple SQL for each measure


Ticking the option Multiple SQL for each measure in File> Parameters> SQL.
This option will split the SQL into sections, one for each fact table measure.

This solution is limited as it will only be possible to use when you are
referencing measure objects from the fact tables. As soon as additional
dimension objects that reference the fact tables are included in the query
results in incorrect data.

The first statement is correct and will deliver the order position value per order
position and product.
SELECT
Products.Product_ID,
Products.Product_Name,
Order_Position.Order_Number,
Order_Position.Order_Position,
sum(Order_Position.Order_Pos_Value)
FROM
Products,
Order_Position
WHERE
( Order_Position.Product_ID=Products.Product_ID

GROUP BY
Products.Product_ID,
Products.Product_Name,
Order_Position.Order_Number,
Order_Position.Order_Position

SQL Traps revisitedLearners Guide

5-5

Unfortunately, the second generated statement is wrong:


SELECT
Products.Product_ID,
Products.Product_Name,
Order_Position.Order_Number,
Order_Position.Order_Position,
sum(Store_Facts.Difference_in_Store)
FROM
Products,
Order_Position,
Store_Facts
WHERE
( Products.Product_ID=Store_Facts.Product_ID
AND

( Order_Position.Product_ID=Products.Product_ID

GROUP BY
Products.Product_ID,
Products.Product_Name,
Order_Position.Order_Number,
Order_Position.Order_Position

The difference in store is correctly joined to the products, but it is also joined
to the order position which means that the figures of the difference in store per
product are repeated for every order position that orders the respective
product.

Using Contexts
The basic problem is that there is no connection between the
ORDER_POSITION table and the measures of the STORE_FACTS table from
a content point of view and vice versa for the dimensions of the
STORE_FACTS and the measures of the ORDER_POSITION table.

5-6

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

We therefore need a way to prevent a combination of these objects.To do this,


we will define a context for every fact table.

Using context will allow users to get correct results for queries that use
dimension and measures from different fact tables.
The Product Id and Product name columns can be connected to all other
information, as they can be connected to both fact tables.
The Order Number, Order Position columns have to be separated from the
store fact information (Store ID, Difference in Store).
By defining the two contexts this separation happens in the two synchronized
queries. The first SQL statement generates a combination of the PRODUCTS
ORDER_POSITIONS tables, and the second SQL statement generates a
combination of PROCDUCTS and STORE_FACTS information.

Summary: How to resolve a chasm trap

Define a new context for every fact table.

Make sure that the option File > Parameters > SQL > Multiple SQL
statements for each context is activated in the universe designer.

SQL Traps revisitedLearners Guide

5-7

Fan Traps
After completing this unit, you will be able to:

Identify fan traps in a universe schema

Resolve fan traps

Fan traps occur when there is a one-to-many join to a table that fans out
into another one-to-many join to another table.

Fan traps can fan out into multiple tables as shown in the diagram above,
however a fan trap may still occur with a one-to-many join between two tables.
One example for that is the join between ORDER_HEADER and
ORDER_POSITION in the sample universe.

The Order_Number is the primary key in the ORDER_HEADER table. The


ORDER_POSITION table references the Order_Number as foreign key.
The problem occurs when measures from the ORDER_HEADER are
combined with information from the ORDER_POSITION table.
To look at how a fan trap affects query results query is run using the following
columns:

5-8

Table

Column / SQL Syntax

ORDER_HEADER

sum(Discount)

ORDER_HEADER

sum(Order_Total_Value)

ORDER_HEADER

Order_Number

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

This query returns the following results:

A second query is run using only columns from the ORDER_POSITION table:

Table

Column / SQL Syntax

ORDER_POSITION

sum(Order_Pos_Value)

ORDER_POSITION

Order_Position

ORDER_POSITION

Order_Number

This query returns the following results:

When the Order Position Value is removed from the table, one can see that the
sum of the Order Position Value per Order is equal to the Order Total Value of
the first query:

SQL Traps revisitedLearners Guide

5-9

We will now combine both tables in one query: the Order Number objects from
the ORDER_HEADER and ORDER_POSITION tables, the Order Position
object and the two measures:.

Note that the Order Total Value is repeated for every Order Position. The totals
are respectively multiplied by the number of Order Positions for every Order.
This also happens when only the Order Number of the Order Position is used
together with both measures:

Resolving Fan traps


.The problem of the fan trap is that as soon as the measures of
ORDER_HEADER are combined with the ORDER_POSITION table. This is
because the join between the two tables will lead to a multiplication of the
measures by the number of Position for the respective Order.
The problem occurs as soon as the Measures of the Order Header are
combined with any information of the ORDER_POSITION table as the join
between the two tables will lead to a repetition of the measures for every order
position.
As we have seen, the real problem in a fan trap is to combine the measures of
a higher aggregated table with a less aggregated table that references the
table of the measure via a foreign key. In our example, the measures on the
higher aggregated fact table ORDER_HEADER may not be combined with the
less aggregated fact table ORDER_POSITION that references the
ORDER_HEADER via the primary key Order_Number).
On the other hand, a combination of the ORDER_HEADER dimensions with
the ORDER_POSITION is not only correct but can also be very useful.

5-10

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

The solution therefore is to separate the dimension and measure objects of the
ORDER_HEADER by retrieving them from two tables.
In a classical data warehouse schema, this is done by defining a line item
dimension that contains all dimension information for the single order and has
the same primary key as the fact table.
In our schema we do not have a line item dimension. Instead the dimension
and measure information are combined in one common table (the
ORDER_HEADER table). If we do not want to create a new table (or a view),
the easiest way to do something similar is to use Aliases.
For clarity reasons, always create two aliases: one for the dimensions and one
for the facts (measures). Using two aliases allows us to name them in a more
clearly understood way but leaves us with tables (the original ones) that are
unconnected.

Note: The Order_Header_Dim and Order_Header_Fact are joined by a 1:1


relation
The next step is to redefine the objects:

All Order header dimension objects are defined on Order_Header_Dim

All Order header measures are defined on Order_Header_Fact

All Order Position measures and dimensions are defined on


Order_Position.

SQL Traps revisitedLearners Guide

5-11

Finally, we define one context for every fact table:

5-12

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

A query using the Order Number (Order_Header_Dim) together with the Order
Total Value (Order_Header_Facts) and the Order Position Value (Order_
Position) generates two SQL statements and returns the correct measure and
dimension results:

Summary: How to resolve fan traps

Identify the fact tables that build the fan trap. Delete the respective joins
and Objects.

Define two aliases for every of these fact tables; one alias is used as a
dimension table, one as a fact table.

Define joins from all dimension aliases to all fact aliases where the
foreign key exists.

Define the measures on the fact aliases and the dimension objects on the
dimension aliases.

Include the other dimension tables and link them to the fact tables where
possible. Define the dimension objects

If this direct link is not possible (due to a missing foreign key in the fact
table) and a link is still necessary, use an indirect link via one of the other
dimension aliases.

Delete all Dimension Objects on the Dimension aliases that are no more
needed because they are retrieved now from the (small) dimension
tables.

Define one context per Fact table. Every context contains all joins that
can be used together with the fact table. If indirect joins are defined in the
universe, they have to be included in the respective contexts.

SQL Traps revisitedLearners Guide

5-13

Activity: Resolving SQL Traps


Objective

Resolve SQL Traps

Instructions
1

Launch Designer and create a new universe called SQL_Traps.unv.

Use the ChasmFan universe connection.

Insert the following tables:

Products

Order_Position

Invoice

Invoice_red

Define the following joins:

Products.Product_ID=Invoice.Product_ID (1:N)

Products.Product_ID=Order_Position.Product_ID (1:N)

Invoice.Invoice_Number=Invoice_red.Invoice_Number (1:1)

Create the classes and objects as shown in the diagram below:.

Tip: Drag and drop tables to the Classes and Objects pane to create a
quick list of classes and objects. The measures shown in the diagram
above are all referencing single column values using a sum() aggregation
function.
5

5-14

How many chasm traps can be found in the structure?

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

How many fan traps can be found in the structure?

Which objects might cause the fan traps to happen?

Resolve the traps using your chosen method.

Test resolutions by running queries in Web Intelligence

SQL Traps revisitedLearners Guide

5-15

Lesson summary
Review
Quiz: SQL traps
1

How would you describe a chasm trap?

How would you describe a fan trap?

What is the recomended way to solve SQL traps?

Summary
After completing this lesson, you are now able to:

5-16

Identify chasm traps in a universe schema

Resolve chasm traps

Identify fan traps in a universe schema

Resolve fan traps

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Lesson 6

Extended Index Awareness and


Derived Tables
This lesson will have more in depth look at Index Awareness. Looking at how
Index Awareness works behind the scenes and interacts with object list of
values. This lesson will also look at how derived tables can be further utilized.
In this lesson you will learn about:

Applying Index Awareness

Derived Tables

Duration: 1.5 hours

Copyright 2007 Business Objects. All rights reserved.

6-1

Applying Index Awareness


This unit describes how to set up a universe in Designer to take advantage of
primary and foreign keys that may already exist in the data source.
After completing this unit, you will be able to:

Understand index awareness for both primary and foreign keys

Apply index awareness for both primary and foreign keys

Work with multiple foreign key entries

Apply where clause conditions for indexed keys

Identify index awareness rules and limitations

What is Index Awareness


Index awareness is the ability to take advantage of the database indexes on
key columns to speed data retrieval. The objects that you create in the
universe are based on database columns that are meaningful to an end user.
For example, a Customer object retrieves the field that contains the customer
name. 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. When you set up index awareness in
Designer, you tell Designer which database columns are primary and foreign
keys. This can have a dramatic effect on query performance in the following
ways:

6-2

Designer can take advantage of the indexes on key columns to speed


data retrieval.

Designer can generate SQL that filters in the most efficient way. This is
particularly important in a star schema database. If you build a query that
involves filtering on a value in a dimension table, Designer can apply the
filter directly on the fact table by using the dimension table foreign key.
This eliminates unnecessary and costly joins to dimension tables.

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Index Awareness on a Primary Key


End users in your organization want to build a report using the Motors universe
that returns the Highest Priced Value retail price by maker, based on a specific
maker country.

Without index awareness, Designer generates the following SQL:


SELECT
MAKER.MAKER_NAME,
max(MODEL.MODEL_PRICE)
FROM
MAKER,
MODEL,
COUNTRY COUNTRY_MAKER
WHERE
(MODEL.MAKER_ID=MAKER.MAKER_ID)
AND (MAKER.COUNTRY_ID=COUNTRY_MAKER.COUNTRY_ID)
AND
COUNTRY_MAKER.COUNTRY_NAME In
('Germany','Italy','Japan','Sweden','United
Kingdom','USA')
GROUP BY
MAKER.MAKER_NAME

The query SQL is generated as expected without the use of indexes.


If it is known to the universe designer that the COUNTRY_NAME column is not
indexed, this column may not be a good candidate for a WHERE clause
restriction.
The COUNTRY_MAKER table contains a COUNTRY_ID as its primary key
which is indexed. Using the primary key of a table is one of the fastest ways of
retrieving the rows of that table.
If the SQL could automatically use the primary key of the COUNTRY_MAKER
table, faster retrieval of the records can be achieved.

Extended Index Awareness and Derived TablesLearners Guide

6-3

After setting up Primary Key Index Awareness for Region, the query SQL will
be changed to:
SELECT
MAKER.MAKER_NAME,
max(MODEL.MODEL_PRICE)
FROM
MAKER,
MODEL,
COUNTRY COUNTRY_MAKER
WHERE
(MODEL.MAKER_ID=MAKER.MAKER_ID)
AND (MAKER.COUNTRY_ID=COUNTRY_MAKER.COUNTRY_ID)
AND
COUNTRY_MAKER.COUNTRY_ID In (1,37,39,44,48,81)
GROUP BY
MAKER.MAKER_NAME

To set up primary key index awareness


1

Double-click the object on which you want to set up index awareness


The objects Edit Properties dialog box displays.

Click the Keys tab.

Click Insert.
A key line is inserted in the list of keys box.

To define key awareness for the primary key:

6-4

Click the drop-down arrow next to Primary Key and select Primary in
the Key Type list.

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Click within the line under Select field, and then click the... button
that appears, to open the SQL editing dialog box.

In the Edit Select Statement dialog box, use the SQL Editor to build
the primary key SQL Select clause or type it directly. For example, for
the Maker Country object, the primary key SQL is

The Edit Select statement dialog box appears.

COUNTRY_MAKER.COUNTRY_ID.

Click OK.

The Edit Select statement dialog box appears.

Select Number from the drop-down list of key types.

Select Enabled.

Click OK.

Extended Index Awareness and Derived TablesLearners Guide

6-5

What happens behind the scenes?


By applying index awareness for the Maker Country, by identifying the primary
key to use, Business Objects is prompted to add an alternative piece of SQL
in the WHERE clause whenever a query uses Maker Country as a condition.
Instead of using COUNTRY_MAKER.COUNTRY_NAME it will now use
COUNTRY_MAKER.COUNTRY_ID. This is determined from the KEYS entries
made in the object.
But how did Business Objects convert the Maker Country names selected in
the LOV into the primary key values necessary for the SQL?
The default SQL query that is generated to retrieve the Country Maker LOV is:
SELECT DISTINCT
COUNTRY_MAKER.COUNTRY_NAME
FROM
MAKER,
COUNTRY COUNTRY_MAKER
WHERE
(MAKER.COUNTRY_ID=COUNTRY_MAKER.COUNTRY_ID)

In order to convert the Country Names to primary keys, the Primary Key that
was defined in the KEYS tab is added to the query.

To View the Altered LOV


1

6-6

Double-click the indexed object to access the Object Properties.

Click the Properties tab.

Click Edit
The Designer Query Panel opens displaying the indexed object in the
Result Objects pane.

Click View SQL.

The SQL Viewer Opens.


It now displays both the indexed object value and its index key as
generated columns in the LOV. In this example the COUNTRY_MAKER.
COUNTRY_NAME and the COUNTRY_MAKER.COUNTRY_ID objects

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

This way Business Objects matches the Maker Country Names to the Primary
Key values.
Note: This SQL is visible by either editing the LOV for the Maker Country
object and/or tracing SQL that passes through the middleware to the
database.
With index awareness defined, if you select Maker Country names from the
LOV dialog you indirectly select the Primary Key values as well. The Primary
Key values acts like a hidden column in the LOV dialog.The operand Value(s)
from list dialog returns the Primary Key values that match the visible values in
the LOV dialog
Index Awareness allows universe designers to automatically redirect a
WHERE clause condition to another column that is known to provide better
performance at query time.
The index awareness option can be used to determine which column to
choose as an alternative based on database schema knowledge and the
RDBMS optimizer.
The LOV values that end users select actually tell Business Objects what
Primary Key values to substitute in final query SQL. The KEYS tab tells
Business Objects which SQL syntax to substitute in the final query SQL.

Avoiding joins in tables


Another use of Index Awareness is to reduce the number of tables or joins
involved in a query. Reducing the number of joins in a query can help improve
query performance.
The SQL from the last example improved performance by restricting on the
Primary Key (indexed) of the COUNTY_MAKER table.
SELECT
MAKER.MAKER_NAME,
max(MODEL.MODEL_PRICE)
FROM
MAKER,
MODEL,
COUNTRY COUNTRY_MAKER
WHERE
(MODEL.MAKER_ID=MAKER.MAKER_ID)
AND (MAKER.COUNTRY_ID=COUNTRY_MAKER.COUNTRY_ID)
AND
COUNTRY_MAKER.COUNTRY_ID In (1,37,39,44,48,81)
GROUP BY
MAKER.MAKER_NAME

This query has the MAKER and COUNTRY_MAKER tables in it which both
can provide the COUNTRY_ID column.
The COUNTRY_MAKER table is only needed to satisfy the WHERE clause
and is not needed in the SELECT or GROUP BY clauses.

Extended Index Awareness and Derived TablesLearners Guide

6-7

Using Index Awareness it is possible to remove the COUNTRY_MAKER table


from the query completely, by telling BusinessObjects to use the MAKER table
to retrieve COUNTRY_ID data from.

To set up foreign key index awareness

6-8

Double-click the object on which you are setting up index awareness and
select the Keys tab.

Click Insert.
A key line is inserted in the list of keys box.

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.

Select Number from the drop-down list of key types.

Select Enabled.

Click OK.

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

By defining also the foreign key in the Maker Country object the same query
will return the following SQL:
SELECT
MAKER.MAKER_NAME,
max(MODEL.MODEL_PRICE)
FROM
MAKER,
MODEL
WHERE
(MODEL.MAKER_ID=MAKER.MAKER_ID)
AND
MAKER.COUNTRY_ID In (1,37,39,44,48,81)
GROUP BY
MAKER.MAKER_NAME

The COUNTRY_MAKER table is no longer referenced in the SQL. This table


no longer shows up in the FROM clause, nor in the WHERE clause as join to
the MAKER table or as table used to retrieve the condition values from.
The LOV SQL is only affected by the primary key entry and will always return
the primary key entries behind the scenes. Therefore all columns you provide
in foreign key entries must have the same type of values and column type as
the column referenced by the primary key entry.

Extended Index Awareness and Derived TablesLearners Guide

6-9

Foreign key indexing is not always applied. If the Primary key table is still
needed in the querys RESULT OBJECTS, SORTS or CONDITIONS that do
not have Index Awareness applied on the same table, then the primary key
table will remain in the query and the foreign key entry will not be applied.

If the primary key table (the original objects table) is not needed anywhere but
the WHERE clause, then the Foreign Key entry will be applied.
As a general rule, you can note that a foreign key entry will be ignored if it does
not result in less tables being used. The SQL engine can use less tables, if the
primary key table is only referenced inside the WHERE clause.

6-10

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Multiple Foreign Key entries


The KEYS dialog allows more than one foreign key entry which allows us to
deal with repeated values in multiple tables (denormalized data).
Database designers may denormalize primary key values beyond what is
necessary to satisfy constraints or to assist in performance and simplification
of SQL generation.
It is expected to see an entity repeated twice. Initially in the entitys own table
as its primary key 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 has more than 2 instances of the value in a schema.
In the Motors.mdb schema you can find such a scenario with the following
tables:
CLIENT
REGION
COUNTRY_REGION
All three table contain a COUNTRY_ID column.
If we setup the KEYS for the Client Country object we can give Business
Objects 3 choices from which it can retrieve these values for the purposes of
restricting data in the WHERE clause (and hopefully speeding up the query).

A primary key has been defined for the COUNTRY_REGION.COUNTRY_ID


and two foreign keys have been defined; one for CLIENT.COUNTRY _ID and
one for REGION_COUNTRY_ID.

Extended Index Awareness and Derived TablesLearners Guide

6-11

When running the Web Intelligence query shown above, the SQL generated
will be as follows:
SELECT
CLIENT.CLIENT_LASTNAME + ', ' + CLIENT.CLIENT_FIRSTNAME,
REGION.REGION_NAME
FROM
CLIENT,
REGION
WHERE
(REGION.COUNTRY_ID=CLIENT.COUNTRY_ID)
AND
REGION.COUNTRY_ID In (1,44)

The REGION table is used to restrict on COUNTRY_REGION (COUNTRY_ID)


as it is one of the foreign key entries and the COUNTRY_REGION table is not
used anywhere else in the query and is subsequently dropped from the SQL.
But why does Business Objects use the REGION table and not the CLIENT
table? Both tables exist in the FROM clause, but 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 REGION.COUNTRY_ID key was the last one defined in the list and this is
the one that will be used in the SQL generation.

6-12

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Re-arrange the keys by placing the CLIENT.REGION_KEY last will result in


the following SQL instead:

SELECT
CLIENT.CLIENT_LASTNAME + ', ' + CLIENT.CLIENT_FIRSTNAME,
REGION.REGION_NAME
FROM
CLIENT,
REGION
WHERE
(REGION.COUNTRY_ID=CLIENT.COUNTRY_ID)
AND
CLIENT.COUNTRY_ID In (1,44)

Note: If a shortcut join has been defined between the COUNTRY_REGION


and CLIENT table, this shortcut key takes precedence as the foreign key, even
if the last foreign key defined is the REGION key instead.

Extended Index Awareness and Derived TablesLearners Guide

6-13

Activity: Multiple foreign key entries


Objective

Apply multiple foreign key entries.

Instructions
1

Open the MotorsAdv.unv file in Designer.

Remove the shortcut join between the CLIENT and COUNTRY_REGION


tables. A message about the join being used in contexts will appear. Click
Yes.

Double-click the Client Country object and click the Keys tab.
This object already has a primary key and foreign key index applied.

Click Insert. This will insert a new foreign key entry.

Double-click on the Type your SELECT here... box and enter the
following syntax in the box:
REGION.COUNTRY_ID

Click OK.

Save and export the universe.

Launch Web Intelligence and create a new Web Intelligence document.

Add Client Name, Region and Sales Revenue to the Result Objects
pane, and drag Country into the Query Filters pane.

10 Select United Kingdom and USA as country values.


11 Click View SQL
12 Which table is used to return the index values for the Client Country?

13 Close Web Intelligence and import the MotorsAdv.unv file in Designer.


14 Edit the Client Country object and click the Keys tab.
15 Delete both foreign key entries.
16 Click Insert.
17 Double-click on the Type your SELECT here... box and enter the
following syntax in the box:
REGION.COUNTRY_ID

18 Click Insert again.


19 Double-click on the Type your SELECT here... box and enter the
following syntax in the box:
CLIENT.COUNTRY_ID

20 Click OK.
21 Save and export the universe.
22 Launch Web Intelligence and create a new Web Intelligence document.
23 Add Client Name, Region and Sales Revenue to the Result Objects
pane, and drag Country into the Query Filters pane.
24 Select United Kingdom and USA as country values.
25 Click View SQL

6-14

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

26 Which table is used to return the index values for the Client Country?

27 Both CLIENT and REGION have a COUNTRY_ID column. How does


BusinessObjects select the table to use for the COUNTRY_ID column?

28 Close Web Intelligence and import the MotorsAdv.unv file in Designer.


29 Re-create the shortcut join between the CLIENT and
COUNTRY_REGION table.
Note: Make sure that you add the join back to the contexts.
30 Edit the Client Country object and click the Keys tab.
31 Delete both foreign key entries.
32 Click Insert.
33 Double-click on the Type your SELECT here... box and enter the
following syntax in the box:
CLIENT.COUNTRY_ID

34 Click Insert again.


35 Double-click on the Type your SELECT here... box and enter the
following syntax in the box:
REGION.COUNTRY_ID

36 Click OK.
37 Save and export the universe.
38 Launch Web Intelligence and create a new Web Intelligence document.
39 Add Client Name, Region and Sales Revenue to the Result Objects
pane, and drag Country into the Query Filters pane.
40 Select United Kingdom and USA as country values.
41 Click View SQL
42 Which table is used to return the index values for the Client Country?

43 Why did Business Object select this table?

Extended Index Awareness and Derived TablesLearners Guide

6-15

Unique and non-unique values


In the previous examples, all the restricted values were unique. We will now
look at an example where the values are not unique.
When applying primary key index awareness to the MODEL.MODEL_NAME
column, using MODEL_ID as the key, will generate duplicated values in the
LOV:.

Normally the LOV generation SQL uses a SELECT DISTINCT and no


duplicates are allowed.
Editing the Model LOV and viewing the generated SQL shows that the primary
key entry has been added to the SELECT of the LOV SQL and it the SQL is
set to SELECT DISTINCT:
SELECT DISTINCT
MODEL.MODEL_NAME,
MODEL.MODEL_ID
FROM
MODEL

So why did defining the index awareness generate duplications in the LOV?

6-16

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

By examining the MODEL table we will see the reason for this:.

The MODEL table shows that there are duplicate Model Name values.
For example V70 is repeated for MODEL_ID =1093, 1092, and 1091. This is
due to the fact that there are different Model trim values and/or engine size
values for each of the V70 MODEL_ID values. The MODEL_ID is therefore
dependent on more columns and in order to get a distinct list of values based
on the primary key the other columns need to be somehow involved.
To solve this you can:
1

Add the additional columns in the LOV.

This will allow end users to select the distinct rows required in their report
and the SQL generated for this implements the index awareness set for
the MODEL_ID primary key behind the scenes.

Extended Index Awareness and Derived TablesLearners Guide

6-17

Concatenate the columns for the Model object. (as was done in the
Universe Design course):
MODEL.MODEL_NAME + ' '+MODEL.MODEL_TRIM +
''+MODEL.MODEL_ENGINE

This way the LOV shows the concatenated values for the end users to
choose from and the SQL generated implements the index awareness set
for the MODEL_ID primary key behind the scenes.
Both solutions will output the following SQL:
SELECT
MAKER.MAKER_NAME,
sum(QUARTER_FIGURES.QTR_SALE_NUMBER)
FROM
MAKER,
QUARTER_FIGURES,
MODEL
WHERE
MODEL.MAKER_ID=MAKER.MAKER_ID)
AND (QUARTER_FIGURES.MODEL_ID=MODEL.MODEL_ID)
AND
MODEL.MODEL_ID In (1014,1015,1053,1052)
GROUP BY
MAKER.MAKER_NAME

6-18

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Using Index Awareness objects as result


object
In the previous examples, the index awareness objects were placed in the
Query Filter pane as a condition object. This is the main use of Index
Awareness, but what happens when those same objects are used in the Result
Objects pane?
Building a query with Maker Country and Sales Revenue in the result objects
pane generates the following SQL:

without index awareness applied:


SELECT
COUNTRY_MAKER.COUNTRY_NAME,
sum(ANNUAL_FIGURES.ANNUAL_SALE_VALUE)
FROM
MAKER,
COUNTRY COUNTRY_MAKER,
ANNUAL_FIGURES
WHERE
(MAKER.COUNTRY_ID=COUNTRY_MAKER.COUNTRY_ID)
AND (ANNUAL_FIGURES.MAKER_ID=MAKER.MAKER_ID)
GROUP BY
COUNTRY_MAKER.COUNTRY_NAME

with index awareness applied:


SELECT
max(COUNTRY_MAKER.COUNTRY_NAME),
sum(ANNUAL_FIGURES.ANNUAL_SALE_VALUE)
FROM
MAKER,
COUNTRY COUNTRY_MAKER,
ANNUAL_FIGURES
WHERE
(MAKER.COUNTRY_ID=COUNTRY_MAKER.COUNTRY_ID)
AND (ANNUAL_FIGURES.MAKER_ID=MAKER.MAKER_ID)
GROUP BY
COUNTRY_MAKER.COUNTRY_ID

Notice that the SELECT of the query has changed, a MAX function has been
added to the COUNTRY_MAKER.COUNTRY_NAME (the Maker Country
object does not have a MAX function in its SELECT definition).
Also the GROUP BY clause has been changed;
COUNTRY_MAKER.COUNTRY_NAME has been replaced by
COUNTRY_MAKER.COUNTRY_ID.

Extended Index Awareness and Derived TablesLearners Guide

6-19

Note: If a query does not have a GROUP BY clause the MAX function is not
applied.
What affect does this have on our results? None for this query. With or without
Index Aware this query will return the same results, as the
COUNTRY_MAKER.COUNTRY_NAME is unique across the whole data set;
COUNTRY_MAKER.COUNTRY_ID has a 1-to-1 relationship to
COUNTRY_MAKER.COUNTRY_NAME.

Using an Index Awareness WHERE clause


The previous examples have ignored the WHERE clause part of the Primary
Key and Foreign Key entries within the KEYS dialog. In this section we will look
at using a WHERE clause for the primary and foreign key. Using a WHERE
clause condition in either primary or foreign key index will act as a data
restriction. This may be useful if there is a large amount of data returned for a
particular object.

To add a WHERE clause to primary key index awareness


1

Double-click the object on which you are setting up index awareness and
select the Keys tab.:

Double-click on the primary key Where clause field.

Type in the required Where clause syntax.

Click Apply.

To add a WHERE clause to foreign key index awareness

6-20

Double-click the object on which you are setting up index awareness and
select the Keys tab.

Double-click on the foreign key Where clause field.

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Type in the required Where clause syntax.

Click OK.

SQL Editor dialog


The SQL editor available to the management of Index Aware is the same SQL
editor dialog available to predefined conditions, objects SELECT and objects
WHERE clauses.
This dialog provides normal SQL constructs as well as more complex items
such as the list of @functions, for example a primary or foreign key index can
have a Where clause defined using @variable(BOUSER)
If your target database allows them, you can add SQL comments to the
Primary Key and Foreign Key entries so that they easily identifiable in the final
query SQL for example: /* Index Awareness Foreign Key */

A query using Region in the Result Objects pane and Client Country in the
Query Filter pane will generate the following SQL:
SELECT
COUNTRY_REGION.COUNTRY_NAME
FROM
COUNTRY COUNTRY_REGION
WHERE
COUNTRY_REGION.COUNTRY_ID /* Index Awareness Primary Key
*/ In (33,1)
AND (COUNTRY_REGION.COUNTRY_ID IN (1, 33, 44))

If Client Name is used instead of Region in the Result Objects pane the SQL
becomes:
SELECT
CLIENT.CLIENT_LASTNAME + ', ' + CLIENT.CLIENT_FIRSTNAME
FROM
CLIENT
WHERE
CLIENT.COUNTRY_ID /* Index Awareness Foreign Key */ In
(33,1)
AND (CLIENT.COUNTRY_ID IN (33, 44, 1))

The Index Awareness foreign key entry is clearly identifiable due to the
appended /* Index Awareness Foreign Key */ text in the SQL statement.

Extended Index Awareness and Derived TablesLearners Guide

6-21

Activity: Add WHERE clauses to key entries


Objective

Add a WHERE clause condition to a primary key entry.

Add a WHERE clause condition to a foreign key entry.

Adding text entries for primary and foreign keys

Instructions
Add a WHERE clause condition to a primary key entry
1 Open the MotorsAdv.unv file in Designer.
2 Edit the Client Country object and click the Keys tab.
3 Double-click on the primary key Where clause field.
4 Type in the following Where clause syntax:
COUNTRY_REGION.COUNTRY_ID IN (1,33,44)

Click Apply.

Click the Properties tab.

Click Edit.

Click the View SQL toolbar icon. The LOV SQL now shows the additional
Where clause condition.

Click OK three times to close the Client Country properties.

10 Save and export the universe.


11 Launch Web Intelligence and create a new Web Intelligence document
based on the MotorsAdv.unv.
12 Add Client Name and Region to the Result Objects pane and add
Country Region to the Query Filters pane.
13 Select the Value(s) from list operand. The list of values dialog box
opens. It will now only display the values USA, United Kingdom and
France to choose from. Select the value USA and United Kingdom.

Add a WHERE clause condition to a foreign key entry


1 Edit the Client Country object.
The Edit Properties of Client Name dialog box displays.
2 Click the Keys tab.
3 Double-click on the CLIENT.COUNTRY_ID foreign key Where clause
field.
4 Type in the following Where clause syntax:
CLIENT.COUNTRY_ID IN (33,44,1)
5

Click OK.
Note: Adding a Where clause to the foreign key index does not affect the
LOV SQL.

6-22

Save and export the universe.

Launch Web Intelligence and create a new Web Intelligence document


based on the MotorsAdv.unv.

Add Region to the Result Objects pane and add Client Country to the
Query Filters pane.

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Select the Value(s) from list operand. The list of values dialog box opens.
Select the value USA and United Kingdom.
The AND clause should refer to the primary key. The order of the IDs
should show this.

10 Close the SQL Viewer.


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

Adding text entries for primary and foreign keys


If your target database allows them, you can add SQL comments to the
Primary Key and Foreign Key entries so that they easily identifiable in the final
query SQL for example: /* Index Awareness Foreign Key */

Edit the Client Country object and click the Keys tab.

Double-click on the primary key select statement and append the


following syntax:
/*Index Awareness Primary Key*/

Double-click on the CLIENT.COUNTRY_ID foreign key select statement


and append the following syntax:
/*Index Awareness Foreign Key*/

Save and export the universe.

Launch Web Intelligence and create a new Web Intelligence document


based on the MotorsAdv.unv.

Add Region to the Result Objects pane and add Client Country to the
Query Filters pane.

Select the Value(s) from list operand. The list of values dialog box opens.
Select the value USA and United Kingdom.
The AND clause should refer to the primary key. The order of the IDs
should show this.

Close the SQL Viewer.

Replace the Region object by the Client Name object in the Result
Objects pane. View the SQL.
The AND clause should refer to the foreign key.

Extended Index Awareness and Derived TablesLearners Guide

6-23

Index Awareness - rules and limitations


There are a few rules and limitations to note when using Index Awareness.

Index Awareness Limitations:

Index Awareness SELECT and WHERE clause syntaxes are limited to


the following set of operands. Index Awareness will only apply with the
following operands:

Equal to

Different From

In List

Not In List

When the operands above are used, only value(s) selected from the
Value(s) from list operator or the Quick Filter option will trigger Index
Awareness functionality.
Typing or entering a value will not trigger it, even if the values are
identical to those in the LOV.
This is because Index Awareness uses the selection from the LOV dialog
to obtain the primary key value for each entry. If you entered your
selection using Type a new constant Index Awareness would need to go
via the database in order to locate the matching primary key value.

Does not work with prompts due to the following reasons:

Complexity prompt population takes place after all the tables in


a query have been decided upon. Where Index Awareness helps
build the overall query, changing tables etc, the point in the
query workflow where these things happen is entirely different.

Shared LOVs if more than one prompt exists in the report and/
or universe with the same name it is reduced to a single prompt
display and common LOV. But what if the prompt was related to
different objects with completely different LOVs and KEY
definitions? This complication has not been overcome in the
current version of Index Awareness

Prompt definition prompts can be defined in the universe with


hard coded LOV or LOVs that come from another object entirely.
This complication has not been overcome in this feature.

6-24

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Index Awareness behavior rules:

A Foreign key entry will be ignored if it does not result in less tables being
used. Business Objects can only use less tables if the primary key table
is referenced only inside the WHERE clause.

The sequence of foreign key entries in the Keys dialog box determines
which entry is given preference, for example the last enabled entry in the
list that results in the least number of tables. If the best foreign key entry
does not result in a table count reduction compared to the original query,
the primary key entry will be the only one that applies.
Note: Shortcut joins will take precedence over the last enabled foreign
key entry.

Use of primary key entries in LOV can only be used with accuracy when
the value is unique, for example customer social security number,
product code.

Extended Index Awareness and Derived TablesLearners Guide

6-25

Derived Tables
A derived table is a dynamic, virtual table that you create within the universe
structure. It consists of a set of SQL statements that you create in Designer,
and that you can then use as a logical table to create objects.
In the derived tables SQL set, you can put a SELECT statement in place of a
table name in the From clause. The SQL set can also contain embedded
prompts, and you can create joins between the virtual derived table and the
physical tables, just as you can with other tables.
After completing this unit, you will be able to:

Use derived tables to bypass context

Use derived tables to create percentages

Adding Derived Tables


Derived tables are similar to views in the database, but as they are defined in
the universe, they give universe designers more flexibility. You can see a
derived table as a query that can be referenced as a table. The table definition
SQL is inserted into an end user query at run time.
Note: As it is a query and not a physical table, it is important to understand
that the same performance issues that can affect queries can also
affect derived tables.
Derived tables may be most useful when you want to merge two queries
together, when you want to include @Variable (for example
@Variable(BOUSER) ) or @Prompt functionality in the query logic, and in
some cases, when you have different aggregation levels. Derived tables can
be also be useful for multistep SQL.
Derived tables can also be useful to combine data from two separate fact
tables. If fact tables are spread across two separate contexts, combining
measures from each of these tables will result in separate SQL statements.

Derived tables as lookup for multiple contexts


In the Motors schema we have a Sales and Rentals contexts. End users may
wish to see Clients with both Rental Total (RENTAL.SALE_TOTAL) and Sales
Total (SALE.SALE_TOTAL) data.
You can combine the data in a derived table and by basing the Sales and
Rental total objects the derived table will avoid users having to select
measures from multiple context.

6-26

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

To create a derived table with fact fields from multiple


contexts
1

Select Insert > Derived Tables.


The Derived Tables dialog box displays.

The derived table will act as a shortcut between the Client and Model
table. The SELECT, FROM and WHERE syntax therefore needs to
contain the following:
SELECT CLIENT.CLIENT_ID,MODEL.MODEL_ID
FROM CLIENT, MODEL,SALE,SALE_MODEL
WHERE CLIENT.CLIENT_ID = SALE.CLIENT_ID
AND MODEL.MODEL_ID = SALE_MODEL.MODEL_ID
AND SALE_MODEL.SALE_ID = SALE.SALE_ID

The RENTAL table is in fact ALIAS table of the SALE table and cannot be
referenced in the Derived Table. To get the SALE and RENTAL values for
SALE.SALE_TOTAL, we need to use the SALE.SALE_TYPE column that
indicates which row is sales and which row is rental data.
The Derived Table SQL Syntax will become:
SELECT CLIENT.CLIENT_ID, MODEL.MODEL_ID,
(SELECT CASE SALE.SALE_TYPE WHEN 'R' THEN
SALE.SALE_TOTAL ELSE 0 END) AS Rental_Total,
(SELECT CASE SALE.SALE_TYPE WHEN 'S' THEN
SALE.SALE_TOTAL ELSE 0 END) AS Sales_Total
FROM CLIENT, MODEL,SALE,SALE_MODEL
WHERE CLIENT.CLIENT_ID = SALE.CLIENT_ID
AND MODEL.MODEL_ID = SALE_MODEL.MODEL_ID
AND SALE_MODEL.SALE_ID = SALE.SALE_ID

The data for SALES and RENTAL have been combined into a derived
table using two sub selects, each using a different SALE_TYPE indicator.
4

Join the new table to the CLIENT and the MODEL tables.

Create a new context.

Create a new class create the Sales Total and Rental Total objects based
on the new columns of the derived table.

Sales Total: sum(Derived_Table.Sales_Total)

Rental Total: sum(Derived_Table.Rental_Total)

Save and export the universe.

Extended Index Awareness and Derived TablesLearners Guide

6-27

Run a new report in Web Intelligence using the Client Name, Sales Total
and Rental Total objects. The data is returned as one SQL statement and
displays in one table.

When a query returns a joined SQL statement, the rows where there is no
equivalent data are returned as empty cells. These cells can not be filtered
on as technically they do not exist. Using the derived table method, the
cells where there is no data returns a value of 0. This means that a quick
filter in the report panel can be used.

This will now only return the clients that have both rental and sales values
in a single SQL statement.

Note: If you use derived tables to create different aggregation levels, be


careful to consider the impact on joins, contexts, and many-to-many
relationships.

6-28

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Derived tables as substitute for VIEWS


In the Motors universe the designer has access to different levels of
aggregated tables - annual and quarterly figures. However, if users request
aggregations over monthly periods the designer would prefer to have the DBA
create a monthly aggregated table. This can then be introduced into the
aggregate navigation through a continuous time based level of detail as Yearly
- Quarterly - Monthly level. This being not always possible or easy to
implement, the designer has the flexibility to leverage database and SQL
capabilities that would normally be done via database VIEWs or SYNONYMS
without needing the database access (create table rights) to answer such
needs using Derived tables.
A Derived Table can be created for a Monthly based aggregation using the
following syntax:
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_SALE_DISCOUNT) / 100)) as Monthly_Sales_Revenue
FROM
SALE_MODEL,
MODEL,
SALE
WHERE
( SALE.SALE_ID=SALE_MODEL.SALE_ID

AND

( SALE_MODEL.MODEL_ID= MODEL.MODEL_ID )

AND

( SALE.SALE_TYPE='S'

GROUP BY
datepart(yy,SALE.SALE_DATE),datepart(mm,SALE.SALE_DATE),
SALE.SHOWROOM_ID,MODEL.MAKER_ID

Extended Index Awareness and Derived TablesLearners Guide

6-29

Activity: Derived Tables


Objective

Create a new Monthly_Figures derived table

Instructions
1

Open the MotorsAdv.unv file in Designer.

Create a new Derived Table called Monthly_Figures.

Add the following SQL Syntax for the table:


The derived table Select Statement as
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_SALE_DISCOUNT) / 100)) as Monthly_Sales_Revenue
FROM
SALE_MODEL,
MODEL,
SALE
WHERE
( SALE.SALE_ID=SALE_MODEL.SALE_ID

AND

( SALE_MODEL.MODEL_ID= MODEL.MODEL_ID

AND

( SALE.SALE_TYPE='S'

GROUP BY
datepart(yy,SALE.SALE_DATE),datepart(mm,SALE.SALE_DATE),
SALE.SHOWROOM_ID,MODEL.MAKER_ID

Create a new subclass in the Sales class called Monthly Figures.

Create the following objects:


Months = MONTHLY_FIGURES.Month
Years = MONTHLY_FIGURES.Year
Monthly Sales Revenue =
SUM(MONTHLY_FIGURES.Monthly_Sales_Revenue)

6-30

Join the derived table with the Maker and Showroom tables using the
appropriate foreign keys and update the Sales context.

Save and export the universe.

Create a new Web Intelligence document using the Maker, Showroom,


Months, Years, and Monthly Sales Revenue objects.

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

The SQL generated should look as follows:


SELECT
MAKER.MAKER_NAME,
SHOWROOM.SHOWROOM_NAME,
MONTHLY_SALES.Month,
MONTHLY_SALES.Year,
SUM(MONTHLY_SALES.Monthly_Sales_Revenue)
FROM
MAKER,
SHOWROOM,
(
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_SALE_DISCOUNT) / 100)) as Monthly_Sales_Revenue
FROM
SALE_MODEL,
MODEL,
SALE
WHERE
( SALE.SALE_ID=SALE_MODEL.SALE_ID

AND

( SALE_MODEL.MODEL_ID= MODEL.MODEL_ID

AND

( SALE.SALE_TYPE='S'

Group By
datepart(yy,SALE.SALE_DATE),datepart(mm,SALE.SALE_DATE),
SALE.SHOWROOM_ID,MODEL.MAKER_ID
)

MONTHLY_SALES,

MODEL,
SALE_MODEL,
SALE
WHERE
( SHOWROOM.SHOWROOM_ID=SALE.SHOWROOM_ID

AND

( SALE.SALE_ID=SALE_MODEL.SALE_ID

AND

( SALE_MODEL.MODEL_ID= MODEL.MODEL_ID

AND

( MODEL.MAKER_ID=MAKER.MAKER_ID

AND

( SALE.SALE_TYPE='S'

AND

( MONTHLY_SALES.SHOWROOM_ID=SHOWROOM.SHOWROOM_ID

Extended Index Awareness and Derived TablesLearners Guide

6-31

AND

( MONTHLY_SALES.MAKER_ID=MAKER.MAKER_ID

GROUP BY
MAKER.MAKER_NAME,
SHOWROOM.SHOWROOM_NAME,
MONTHLY_SALES.Month,
MONTHLY_SALES.Year

10 Return to Designer.
11 In the MotorsAdv universe, update the existing Sales Revenue measure
SQL syntax to include a month value aggregation level.
Tip: Check other objects that reference the monthly aggregate, for example
year in the Financial Period.
12 Test the aggregation level generations by running test queries in the
Designer Query Panel. Use the View SQL button to verify if the
generated SQL is correct. Alternatively save and export the unibverse
and test in Web Intelligence.

6-32

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Lesson summary
Review
Quiz: Index Awareness and Derived Tables
1

What is Key Index Awareness?

What happens to the SQL and the LOV when you define primary key
index awareness?

When using multiple foreign key entries, which foreign key is the one
used?

When using multiple foreign key entries of which one is a shortcut join,
which foreign key is the one used?

After completing this lesson, you are now able to:

Summary

Understand index awareness for both primary and foreign keys

Apply index awareness for both primary and foreign keys

Work with multiple foreign key entries

Apply where clause conditions for indexed keys

Identify index awareness rules and limitations

Use derived tables to bypass context

Use derived tables to create percentages

Extended Index Awareness and Derived TablesLearners Guide

6-33

6-34

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Lesson 7

External Strategies
Designer uses built-in automated routines to automatically create universe
components based on the database structure. These routines are called
strategies and are available from the Strategies page of the Parameters dialog
box. These strategies are built-in to Designer. You cannot access or modify
them.
You can however create SQL scripts that follow a defined output structure to
perform customized automatic universe creation tasks. You can select these
from the Strategies page with the other strategies.
These user defined and customized scripts are called External strategies. This
lesson describes external strategies and their use.
In this lesson you will learn about:

Creating and using external strategies

Duration: 1 hour

Copyright 2007 Business Objects. All rights reserved.

7-1

Creating and using external strategies


There are different types of external strategies that can be defined, and this
unit will provide an overview what these three types are and how they can be
defined.
After completing this unit, you will be able to:

Define what external strategies are.

Describe how to access strategies in Designer.

Describe the different strategy types that can be used.

Describe the different output formats.

Create different types of external strategies.

What is an external strategy?


An external strategy is an SQL script stored externally to the .unv file, and
structured so that it can be used by Designer to automate object or join
creation, and table detection tasks 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 BusinessObjects installation directory:
C\Program Files\Business Objects\BusinessObjects Enterprise
11.5\win32_x86\dataAccess\connectionsServer\<RDBMS>\
External strategy files are in XML format. They can be edited or viewed in
notepad or wordpad, but it is recommended to use an XML editor to make
modifications.

Accessing External Strategies in Designer


External strategies appear in the drop down list boxes that also list the built-in
strategies on the Strategies page. Each drop down list box corresponds to a
strategy type category in the XML file. An external strategy appears in the list
with External Strategy prefixing the strategy name as follows:
External Strategy:<strategy name>

For example, an external strategy for join creation called Constraints in the
Strategy file, appears as External Strategy: Constraints in the Joins drop down
list on the Strategies page.
Instructor Note(s):

To access external strategies in Designer

7-2

Open MotorsAdv.unv in Designer.

Select File > Parameters from the menu bar.

In the Universe Parameters dialog box select the Strategies tab.

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

The Strategies dialog box opens:

The drop-down arrows allow designers to select Object, Join or Table


strategies that were defined in the sqlsrv.stg file. The example below
shows two external Join strategies: External Strategy: Constraints and
External Strategy: Database_Relationships.

External StrategiesLearners Guide

7-3

The Strategies Tab


The Strategies tab of the Universe Parameters dialog box defines how the
universe uses information from the data dictionary to help you build the
universe. A data dictionary is a set of system tables that your RDBMS
automatically creates and maintains about the objects (tables, views,
synonyms, owners) in your data source.
The information in the Strategy dialog box is accessed by 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), you will need to create external strategies to
ensure Designer can see those synonyms as tables in the table browser.
Built-in strategies can not be modified, so in order to get data source specific
requirements added to the universe, designers can create customizable
external strategies to reflect their needs.
Strategies are SQL statements that read the data dictionary tables in your
source system. The returned query results use that dictionary information to
form of a list of potential tables, joins, classes and objects.
In some cases Data warehouse tables have a DW prefix, for example
DW_Sales_fact. If a built-in strategy is used to identify potential classes and
objects, the proposed classes will also have a DW prefix. Classes and objects
need to remain end users focussed and should not be portrayed with confusing
prefixes. Instead of using the built-in strategy and manually remove the
prefixes, designers can create a customized strategy that identifies potential
classes and objects, and that drops the DW from the proposed classes
automatically.

Types of strategies
There are three universe components that strategies interact with: objects,
joins, and tables. To learn more about how strategies interact with these
components we will look at how these are used in the built-in strategies.

Objects
The built-in object strategy determines how Designer reads the table and
column information from the data dictionary to come up with potential classes
and objects (either when using the wizard or when inserting tables). By default,
the data source table names are used as 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.

7-4

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Joins
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 these columns are not designated primary
or foreign keys.

All matching numeric column names: When using this strategy, joins
are created automatically between columns that are numeric and have
matching names. In some schemas primary and foreign keys can be a
date or char type, rather than a numeric value. This strategy would only
propose join candidates for numeric fields. If you wish joins to be
proposed 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 in the connection parameters. If the owner of the tables in your
DBMS is System, then you must log in with the user ID System for Designer to
find these tables. To avoid users to see Owner prefixes on tables you DBA can
create synonyms (depending on the DBMS used), or can change the OWNER
parameter in the <driver>.PRM file. When setting this parameter to N it drop
the owner name from your table prefix and will cause the built-in strategies to
look for public synonyms and views (for example, the user name specified in
the connection parameters does not necessarily own the physical tables).
Note: Setting the parameter OWNER to N without customizing an external
strategy can also pick up unwanted system tables. If owner prefixes
need to be excluded from tables names it is better to use an external
table strategy that adapts to those needs instead of using the built-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 useful solution for:

database public synonyms

extracting column comments from your source system and use them as
object descriptions.

importing metadata from a text file

External StrategiesLearners Guide

7-5

The output formats of external strategies


This section will look at how the STG file is structured and how the different
strategy type formats are defined.
The following extract shows a sample SQL Server strategy for defining joins
based on database constraints:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Strategies SYSTEM "../strategy.dtd">
<Strategies>
<Strategy Name="Constraints">
<Type>JOIN</Type>
<SQL>
SELECT
a.name as tablename, '|' as x1,

/* table name */

b.name as columnname, '|' as x2, /* column name */


a.name as classname, '|' as x3,

/* class name in BO */

b.name as objectname, '|' as x4, /* object name in BO */


case
/* when name has amount or value and no DIM_ table,
then sum() */
when (charindex('amount',lower(b.name)) > 0 or
charindex('value',lower(b.name)) > 0) and
lower(left(a.name,5)) = 'fact_' then
'sum(' + a.name + '.' + b.name + ')'
/* convert datetime to char NOT USED!!!!*/
/*when c.name = 'datetime' or c.name = 'smalldatetime'
then
'convert(char(12),' + a.name + '.' + b.name +',106)'
*/
/* basic select */
else a.name + '.' + b.name
end as selectstatement, '|' as x5, /* select statement
for object in BO */
NULL as wherestatement, '|' as x6, /* where statement for
object in BO */
case c.name
when 'char' then 'C'
when 'datetime' then 'D'
when 'nchar' then 'C'
when 'ntext' then 'C'
when 'nvarchar' then 'C'

7-6

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

when 'smalldatetime' then 'D'


when 'text' then 'C'
when 'timestamp' then 'D'
when 'varchar' then 'C'
else 'N'
end as objecttype, '|' as x7,/* type for object in BO */
case
when d.value Is Null then a.name + '\' + b.name /* if
there is no description property, then use table and
column name */
else cast(d.value as varchar) /* if there is description
property, then use it */
end as descriptiontext, '|' as x8, /* description for
object in BO */
case
/* when name has amount or value and no DIM_ table,
then Measure */
when (charindex('amount',lower(b.name)) > 0 or
charindex('value',lower(b.name)) > 0) and
lower(left(a.name,5)) = 'fact_' then'M'
else 'D'
end as objecttype, '|' as x9 /* qualification for object
in BO */
FROM
sysobjects a /* table objects */
join syscolumns b on a.id = b.id /* column objects */
join systypes c on c.xtype = b.xtype /* types */
left outer join sysproperties d on a.id = d.id and
d.smallid = b.colid /* properties */
WHERE
(a.type = 'U' or a.type = 'V') and /* usertables and
views */
a.status > 1
ORDER BY
a.name,b.name
</SQL>
</Strategy>

External StrategiesLearners Guide

7-7

As shown in the preceding example, these are the main elements of the
<driver>.STG file. These elements are standard for all RDBMS:

Component

Description

Strategy Name

Appears in the drop-down list of the universe parameters,


Strategies tab.

Type of Strategy

Determines how the strategy is used in building the universe. The three types are OBJECTS, JOIN, STRUCT.
STRUCT is used to build the list of tables.

SQL Statement Output or


Text File

The SQL code for the script. This is the SQL script that
Designer runs when the strategy is selected. The SQL script
must follow a specific output format for object and join creation, and table detection routines to run correctly.

In addition to the above mentioned elements you can add a Connection


element that references a personal connection to a database.
The SQL section is the core element of the strategy. This is where you can use
SQL functions to remove unwanted table prefixes or rename columns to
automatically become more meaningful objects for the end users.
Each strategy type requires a precise layout for the SQL output in order to
function correctly. You write or copy the SQL script within the <SQL> tag in the
external strategies file. The order and type of information returned by the SQL
script depends on whether you are creating an object, join, or table strategy.
Designer has different information needs for each of the different types of
strategies. When you create the SQL script for a strategy, you must ensure that
the generated output for the script matches the Object, Join or Table output
formats.
The script output is formatted as a series of columns. Each column
corresponds to a unit of generated information used to create the object, join,
or table components.
The following section will look at the SQL layout required for:

7-8

Object strategies (OBJECT)

Join strategies (JOIN)

Table browser strategies (STRUCT)

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Object Strategy output format


The Object strategy has nine output columns with a vertical bar (|) as a
delimiter between each column.

Column

Output

Description

Table

Table, view, or synonym.

Column

Field from the object or table.

Class Name

The class name is converted from the physical table name, view, or synonym by applying
all initial caps and converting underscores (_)
to spaces.

Object Name

The object name is converted from the column name by applying all initial caps and
converting underscores (_) to spaces.

SQL SELECT
(Table.Column)

The table and column names are concatenated to form the SQL Select statement for
each object.

SQL WHERE
Clause

If you leave the Select column empty, but


include Where clause, then a predefined condition and its description are created.

Object Type

The object type is determined from the data


type in the source data and converted to N for
Numeric, D for Date, C for Character, or L for
Long Text.

Description

The object description is taken from the column comments.

Objects Type
(D,M,I)

The object type is D for Dimension, M for


Measure, and I for Information.

External StrategiesLearners Guide

7-9

The following extract shows a sample SQL Server strategy that helps build
object definitions:
<Strategy Name="Classes and Objects">
<Type>OBJECT</Type>
<SQL>
SELECT DISTINCT
dbo.sysobjects.name,'|',
dbo.syscolumns.name,'|',
replace(Upper(Left(
dbo.sysobjects.name,1))+Lower(SubString(
dbo.sysobjects.name,2,len(dbo.sysobjects.name))),'_',
' '),'|',
replace(Upper(Left(dbo.syscolumns.name,1))+Lower(SubS
tring(dbo.syscolumns.name,2,len(dbo.syscolumns.name))
),'_',' '),'|',
dbo.sysobjects.name+'.'+dbo.syscolumns.name,'|',
'

','|',

case
when dbo.syscolumns.xtype in
(127,104,106,62,56,60,108,59,52,122,48) then 'N'
when dbo.syscolumns.xtype in (175,167) then 'C'
when dbo.syscolumns.xtype in (61,58) then 'D'
when dbo.syscolumns.xtype in (35) then 'T'
when dbo.syscolumns.xtype in
(173,34,165,36,189,231,239,99) then 'B'
else 'C'
end,'|',
' ','|',
'D','|'
FROM
dbo.sysusers,
dbo.sysobjects,
dbo.syscolumns,
INFORMATION_SCHEMA.TABLES isTable
WHERE
(dbo.syscolumns.id=dbo.sysobjects.id)
and dbo.syscolumns.xtype not in
(173,34,165,36,189,231,239,99)
and (dbo.sysusers.name = isTable.table_schema)
and (dbo.sysobjects.name = isTable.table_name)
and (dbo.sysusers.name = current_user)order by 5,7;
</SQL>
</Strategy>

7-10

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

An external strategy for object creation can be helpful to read column


comments from the dictionary tables, which is something that the built-in
strategies can not provide.

Join Strategy output format


Join strategies use five output columns with each column separated with a
vertical bar (|).

Column

Output

Description

Table1

Table 1 forms the left side of the join


statement.

Table2

Table 2 forms the right side of the join


statement.

Join Operator

The Join operator, usually = but can also


be >=, <>, and so forth.

Outer_Type
(L,R)

If the join is an outer join, then an indication if it is left outer join or right; otherwise
blank if it is not an outer join.

Cardinality

An indication of the cardinality between


the tables, such as one to one (11), one
to many (1N), or many to one (N1).

External StrategiesLearners Guide

7-11

The syntax below outlines an example join strategy for SQL Server:
<Strategies>
<Strategy Name="Database_Relationships">
<Type>JOIN</Type>
<SQL>
SELECT
object_name(fkeyid) as table1,'|' as x1,
object_name(rkeyid) as table2,'|' as x2,
object_name(fkeyid) + '.' + col_name(fkeyid,fkey) +
'=' + object_name(rkeyid) + '.' +
col_name(rkeyid,rkey) as joinstring,'|' as x3,
' ' as cardinality,'|' as x4
FROM sysforeignkeys
</SQL>
</Strategy>
</Strategies>

Table Browser Strategy output format


A structure or table strategy is used when you insert tables into the universe
pane. It has six output columns with each column separated by a vertical bar
(|).

7-12

Column

Output

Description

Table Qualifier

Database name

Owner

Owner of the tables if OWNER=Y is set in


the .prm file

Table

Name of table, view, or synonym

Column

Column name

Data Type

Data type to appear in structure window as


C, N, or D

Null?

Indicator if the column can be null. Valid


values are No or blank

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

The syntax below outlines an example table strategy for SQL Server:
<Strategy Name="Tables">
<Type>STRUCT</Type>
<SQL>
SELECT DISTINCT
sTable.table_catalog,'|',
sTable.table_schema,'|',
dbo.sysobjects.name,'|',
dbo.syscolumns.name,'|',
case
when dbo.syscolumns.xtype in
(127,104,106,62,56,60,108,59,52,122,48) then 'N'
when dbo.syscolumns.xtype in (175,167) then 'C'
when dbo.syscolumns.xtype in (61,58) then 'D'
when dbo.syscolumns.xtype in (35) then 'T'
when dbo.syscolumns.xtype in
(173,34,165,36,189,231,239,99) then 'B'
else 'C'
end,'|',N','|'
FROM
dbo.sysusers,
dbo.sysobjects,
dbo.syscolumns,
INFORMATION_SCHEMA.TABLES isTable
WHERE
( dbo.syscolumns.id=dbo.sysobjects.id
AND

( dbo.sysobjects.uid=dbo.sysusers.uid

and (dbo.sysusers.name = isTable.table_schema)


and (dbo.sysobjects.name = isTable.table_name)
and (dbo.sysusers.name = current_user)
ORDER BY
1,3,5
</SQL>
</Strategy>

Note: For your external strategies to work, you must use the exact output
layout. If you forget a column, mix up the order, or forget the delimiter,
you will get unusual results or an error.

External StrategiesLearners Guide

7-13

Creating external strategies


External strategies are stored in an external strategy file with the extension
<driver>.STG in the BusinessObjects installation directory:
C\Program Files\Business Objects\BusinessObjects Enterprise
11.5\win32_x86\dataAccess\connectionsServer\<RDBMS>\
External strategy files are in XML format. They can be edited or viewed in
notepad or wordpad, but it is recommended to use an XML editor to make
modifications.
There are three main steps to declaring and creating a strategy file.

Modify the <driver>.STG file with an appropriate Table, Object or Join


strategy.

Modify the <driver><language>.STG file with the appropriate strategy


help text.

Make sure that the strategy parameter in the <driver>.SBO points to the
correct <driver>.STG file.

It is recommended that you make a backup of the files prior to making any
changes.

To create an external strategy


You can view, edit, and add strategies to a STG file as follows:
1

Locate the appropriate STG file. Browse to the directory that stores the
STG file for your target SQL Server database in:
C\Program Files\Business Objects\BusinessObjects Enterprise
11.5\win32_x86\dataAccess\connectionsServer\ODBC\

Open the sqlsvr.stg file in an XML editor


Note: The <RDBMS>.STG files reference the strategy.dtd file in the
C\Program Files\Business Objects\BusinessObjects Enterprise
11.5\ win32_x86\ dataAccess\connectionsServer\ directory. Make
sure that this file is available.

Add an OBJECT, JOIN or STRUCT strategy using the following XML


element syntax:

<Strategy Name=[Name of Strategy]>


<Type>[OBJECT/JOIN/STRUCT]</Type>
<SQL>[SQL Syntax]
</SQL>
</Strategy>

Check the validity of the XML file, then save and close the file.

The strategy has been created in the sqlsrv.stg file, but to make sure that this
strategy can be used in Designer you also need to declare the help text in the
sqlsrven.stg file.

7-14

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Add a help text for the new strategy.


Locate the appropriate STG file. Browse to the directory that stores the
STG file for your target SQL Server database in:
C\Program Files\Business Objects\BusinessObjects Enterprise
11.5\win32_x86\dataAccess\connectionsServer\ODBC\

Open the sqlsvren.stg file in an XML editor.


Note: The <RDBMS><language>.STG files reference the
strategy_localization.dtd file in the C\Program Files\Business
Objects\BusinessObjects Enterprise 11.5\ win32_x86\
dataAccess\connectionsServer\ directory. Make sure that this file is
available.The elements in the external strategy XML file are
defined in the external strategy DTD file. If you are using certain
XML editors, for example XML SPY, the available parameters are
listed in a drop down list when you create a new strategy element.

Add the appropriate helptext help text syntax using the following XML
element syntax:

<Strategy Name=[Name of Strategy]>


<Message id="Help">[Help text]</Message>
<Message id="Name">[External Strategy: {Strategy Name} ]
</Message>
/<Strategy>

Check the validity of the XML file, then save and close the file.

Designer needs to be restarted in order to see the new external strategy


in the Strategies tab.

External StrategiesLearners Guide

7-15

Activity: External Strategies


Objective

Create an OBJECT and JOIN strategy

Test the strategies in Designer

Instructions
1

Browse to the directory that stores the STG file for your target SQL
Server database in: C\Program Files\Business Objects\BusinessObjects
Enterprise 11.5\win32_x86\dataAccess\connectionsServer\ODBC\

Open the sqlsvr.stg file in Microsoft Visual Studio.

Add the following JOIN strategy syntax:


</Strategy>
Strategy Name="Same Column Name">
<Type>JOIN</Type>
<SQL>
SELECT T1.name,'|',
T2.name,'|',
T1.name+'.'+C1.name+' = '+T2.name+'.'+C2.name,'|',
' ','|'
FROM sysobjects T1 , sysobjects T2 , syscolumns C1,
syscolumns C2
WHERE T1.type IN ('U','V')
AND T1.id=C1.id
AND T2.id=C2.id
AND C1.type IN
(47,39,35,45,37,62,109,56,38,59,52,48,60,110,122,50)
AND C1.type = C2.type
AND C1.name = C2.name
AND C1.id > C2.id
AND T1.name not like 'sys%'
ORDER BY 1;
</SQL>
</Strategy>

7-16

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Add the following OBJECT strategy syntax:


<Strategy Name="Classes and Objects">
<Type>OBJECT</Type>
<SQL>
SELECT distinct
dbo.sysobjects.name,'|',
dbo.syscolumns.name,'|',
replace(Upper(Left(
dbo.sysobjects.name,1))+Lower(SubString(
dbo.sysobjects.name,2,len(dbo.sysobjects.name))),'_',
' '),'|',
replace(Upper(Left(dbo.syscolumns.name,1))+Lower(SubS
tring(dbo.syscolumns.name,2,len(dbo.syscolumns.name))
),'_',' '),'|',
dbo.sysobjects.name+'.'+dbo.syscolumns.name,'|',
'

','|',

case
when dbo.syscolumns.xtype in
(127,104,106,62,56,60,108,59,52,122,48) then 'N'
when dbo.syscolumns.xtype in (175,167) then 'C'
when dbo.syscolumns.xtype in (61,58) then 'D'
when dbo.syscolumns.xtype in (35) then 'T'
when dbo.syscolumns.xtype in
(173,34,165,36,189,231,239,99) then 'B'
else 'C'
end,'|',
' ','|',
'D','|'
FROM
dbo.sysusers,
dbo.sysobjects,
dbo.syscolumns,
INFORMATION_SCHEMA.TABLES isTable
WHERE
(dbo.syscolumns.id=dbo.sysobjects.id)
and dbo.syscolumns.xtype not in
(173,34,165,36,189,231,239,99)
and (dbo.sysusers.name = isTable.table_schema)
and (dbo.sysobjects.name = isTable.table_name)
and (dbo.sysusers.name = current_user)order by 5,7;
</SQL>
</Strategy>

Check the validity of the XML file, then save and close the file.

External StrategiesLearners Guide

7-17

Add a help text for the new strategies


Locate the appropriate STG file. Browse to the directory that stores the
STG file for your target SQL Server database in:
C\Program Files\Business Objects\BusinessObjects Enterprise
11.5\win32_x86\dataAccess\connectionsServer\ODBC\

Open the sqlsvren.stg file in Microsoft Visual Studio.

Add the following help text syntax for the JOIN strategy:
<Strategy Name="Same Column Name">
<Message id="Help">This strategy is based on the name
parity of the column and provides a list of joins.</
Message>
<Message id="Name">External Strategy: Same Column
Name</Message>
</Strategy>

Add the following help text syntax for the OBJECT strategy:
<Strategy Name="Classes and Objects">
<Message id="Help">This strategy reads the database
structure. It associates tables with classes as well
as columns with objects.</Message>
<Message id="Name">External Strategy: Classes and
Objects</Message>
</Strategy>

10 Check the validity of the XML file, then save and close the file.
11 Add the following STRUCT strategy syntax:
</Strategy>
<Strategy Name="Tables">
<Type>STRUCT</Type>
<SQL>
SELECT DISTINCT
isTable.table_catalog,'|',
isTable.table_schema,'|',
dbo.sysobjects.name,'|',
dbo.syscolumns.name,'|',
case
when dbo.syscolumns.xtype in
(127,104,106,62,56,60,108,59,52,122,48) then 'N'
when dbo.syscolumns.xtype in (175,167) then 'C'
when dbo.syscolumns.xtype in (61,58) then 'D'
when dbo.syscolumns.xtype in (35) then 'T'
when dbo.syscolumns.xtype in
(173,34,165,36,189,231,239,99) then 'B'
else 'C'
end,'|',
'N','|'

7-18

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

FROM
dbo.sysusers,
dbo.sysobjects,
dbo.syscolumns,
INFORMATION_SCHEMA.TABLES isTable
WHERE
(dbo.syscolumns.id=dbo.sysobjects.id)
AND

(dbo.sysobjects.uid=dbo.sysusers.uid)

and (dbo.sysusers.name = isTable.table_schema)


and (dbo.sysobjects.name = isTable.table_name)
and (dbo.sysusers.name = current_user)
ORDER BY
1,3,
5
;
</SQL>

12 Check the validity of the XML file, then save and close the file.
13 Add a help text for the new strategies
Locate the appropriate STG file. Browse to the directory that stores the
STG file for your target SQL Server database in:
C\Program Files\Business Objects\BusinessObjects Enterprise
11.5\win32_x86\dataAccess\connectionsServer\ODBC\
14 Open the sqlsvren.stg file in Microsoft Visual Studio.
15 Add the following help text syntax for the STRUCT strategy:
<Strategy Name="Tables">
<Message id="Help">
This table strategy reads the current user tables.
</Message>
<Message id="Name">
External Strategy: Tables
</Message>
/<Strategy>

16
17 Test the strategies. Launch Designer and create a new universe.
Note: Designer requires to be restarted in order for it to see the new
strategies.
18 Select File > Parameters from the menu bar.
19 In the Definition dialog box select the MotorsAdv connection
20 Click the Strategies tab.
21 In the strategies menu, change the Join strategy to: External Strategy:
Same Column Name.
22 Change the Object strategy to: External Strategy: Classes and
Objects.

External StrategiesLearners Guide

7-19

23 Click OK.
24 Select Insert > Candidate Objects from the menu.
25 The Candidate Objects Browser opens with a list of possible objects and
classes mapped to the tables in the MotorsAdv database.

26 Insert the following candidate classes:

Client

Country

27 Detect joins by selecting Tools > Automated Detection > Detect Joins
from the menu, or click the Detect Joins toolbar icon.
28 The Candidate Joins menu will detect all joins between the tables in the
MotorsAdv database according to the specifications declared in the
strategy.

7-20

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

29 You can either click Insert to insert all associated joins with the tables
currently in the schema, or browse to the appropriate join, select the join
in the list and click Insert..

External StrategiesLearners Guide

7-21

Lesson summary
Review
Quiz: External Strategies
1

What are the three key files that are involved in defining External
Strategies?

What format is used to define External Strategy files?

Where are the External Strategy control files located?

After completing this lesson, you are now able to:

7-22

Define what external strategies are.

Describe how to access strategies in Designer.

Describe the different strategy types that can be used.

Describe the different output formats.

Create different types of external strategies.

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Appendix A

Answer Key
This appendix contains the answers to review questions in the applicable
lessons.

Copyright 2007 Business Objects. All rights reserved.

A-1

Lesson 1
Activity: Implementing a Universe
Testing phase
Perform tests in Web Intelligence to make sure the following questions can be
answered:
1

What was the net sales revenue for all stores in the UK in 1999?

Answer: To get this result a query needs to be run using Store Name(store
table), Store Country (geography table) filtered on UK. Order Date Year (using
start date in the facts_orders table set as a year object or via a predefined
condition) filtered on 1999 and Net Sales (sum(facts_orders.sales_actual) sum(facts_orders.cost) ). This should give a net sales revenue result of
117,424.38.
2

How many Canadian customers purchased Compaq products in 2000?

Answer: To get this result a query needs to be run using Manufacturer


(product table) filtered on Compaq, Number of Clients (count of customer_id),
Client Country (based on the geography alias table) Order Date Year (using
start date in the facts_orders table set as a year object or via a predefined
condition) filtered on 2000. This should give a result of 25 clients.
3

What was the (actual) sales value for ACER 17in Monitors for stores in
the US in 2000?

Answer: To get this result a query needs to be run using Description (product
table) filtered on ACER 17in Monitor, Sales Actual
(sum(facts_orders.sales_actual)), Store Country (geography table) Order Date
Year (using start date in the facts_orders table set as a year object or via a
predefined condition) filtered on 2000. This should give an actual sales result
of 1,587.60.
4

How many UK Clients purchased laptops from the Aiden Soft store?

Answer: To get this result a query needs to be run using Category (product
table) filtered on Laptop, Number of Clients (count of customer_id), Client
Country (based on the geography alias table) filtered on UK and Store Name
(store table) filtered on Aiden Soft. This should give a result of 93 clients.

Quiz: Universe Development Process


1

True or False: The role of the universe is to present a business focused


front end to the SQL structures in the database?
Answer: True

Of the following types of metadata, which one is the one a universe


designer needs to keep in mind?
a) Source System Metadata
b) Extract Metadata
c) Data Warehouse Metadata
d) End User Metadata
Answer: d) End User Metadata

A-2

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Complete the table below comparing the differences between data


systems.
Answer:

data warehouse

OLTP

data mart

Optimized for Build loads and


large complex queries

Transaction oriented
around entitles and
relationships

Developed to access specialised departmental data for query


and analysis

Fewer tables, denormalized


schema

Many tables, relational


(normalized) schema

Highly denormalized schema

Vast indexes for optimized


queries

Smaller indexes for


speedy updates

Large indexes

Historical data

Always currently
accurate data

Historical data

Designed for Enterprise wide


analysis of business measures and dimensions by categories and attributes

Designed for real time


business operations

Designed for departmental


needs and contains a smaller,
more specialised volume of data

List three key points to consider in the Analysis stage of Universe Design.
Answer:
Choice of
a) Identify the user population and how it is structured eg user group
structure, department structure or task structure
b) Identify what information the users need
c) Identify what standard reports the users need
d) Familiarize yourself with company business terminology so you can
name objects meaningfully

List two best practices for the following: general best practices, best
practices for classes and objects, and best practices for joins:
Answer: (Choice of)
General Best Practices

Identify reporting requirements

Involve users at every step

Identify the db schema relevant to the universe

Insert tables one at a time

Insert joins and define cardinalities

Lay out structure window with the cardinalities facing the same
direction and tables arranged logically

Add relevant comments to the universe for documentation

Build relevant objects

Answer KeyLearners Guide

A-3

Best practice for classes and objects

Use min possible objects. 500 recommended max

Create predefined conditions when possible

Consider putting full class path and object name in the objects
description

Always define help on objects

Object types should be within their logical classes

Where measures are generic, they should be in a general measure


class

Format objects and measures within the universe


Best practice for joins

A-4

Avoid tables without joins where possible

Optimise D B performance by using shortcut joins.

Avoid outer joins where possible

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Lesson 2
Activity: Dynamic SQL Parameters
Apply the ANSI92 and FILTER_IN_FROM parameters
1 View the SQL. Is the Region object condition showing up in the FROM
clause?
Answer: Yes, the Region object was checked in the Advanced Join
Properties and conditions based on this object will appear in the FROM
clause.
2 View the SQL. Is the Client Name object condition showing up in the
FROM clause?
Answer: Yes, the Client Name object was checked in the Advanced Join
Properties and conditions based on this object will appear in the FROM
clause.
3 Apply a Quick Filter on the Region object and select the East Coast
value, and a second Quick Filter on the Area Code object and select the
values 10011 and 10012. View the SQL. What is happening with the
WHERE and FROM clauses?
Answer: The Area Code object condition shows up in the WHERE clause,
the Region condition shows up in the FROM clause.
4 Why is this happening?
Answer: In previous steps we were asked to only check the Region and
Client Name dimensions, the detail objects associated to the Client Name
should therefore be de-selected. This means that any conditions on those
detail objects would go in the WHERE clause and not in the FROM clause.

Quiz: Universe Parameters


1

Which Enterprise server manages data access?


Answer: The Connection Server

The Join_By_SQL is a new parameter added to XIR2. What is its


function?
Answer:
This parameter combines split queries into one sentence and makes the
database calculate the union. Split queries happen when requesting
measures over multiple queries.

Provide a brief description on what do the following files do?


Answer:
*.stg

External strategy file, either help or the external strategy

*.sbo

Parameter file used to configure the behaviour of some


connection parameters

cs.cfg

Data access general configuration file

*.prm

Contains default SQL parameters used for query generation, date and other operators and functions

Answer KeyLearners Guide

A-5

Lesson 3
Quiz: Advanced Objects
1

True or False: You can use all database functionality over and above
what is listed in the functions list in the Select and Where windows
Answer: True

List three different Transact-SQL functions


Answer:
RANK (OVER (PARTITION BY))
ROW_NUMBER (OVER (PARTITION BY))
SUM (OVER (PARTITION BY))

A-6

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Lesson 4
Quiz: Complex Predefined Conditions and LOVs
1

What is the difference between ALL and ANY when creating a sub
query?
Answer:
ALL - is making a comparison with every value returned in the query
ANY - is making a comparison on at least one value returned in the query

When setting up a predefined condition that returns a pattern what 2


important syntaxes are required to achieve this?
Answer: LIKE and %

What functions can not be used in a Join definition?


Answer:
1

@Select

@Where

Answer KeyLearners Guide

A-7

Lesson 5
Activity: Resolving SQL Traps
1

How many chasm traps can be found in the structure?


Answer: In the schema, there is one chasm trap:

Chasm: Order_Position -> Product <- Invoice

How many fan traps can be found in the structure?


Answer: In the schema, there are two fan traps:

Fan 1: Product -> Order_Position

Fan 2: Product -> Invoice

Which objects might cause the fan traps to happen?


Answer:
To illustrate the first fan trap ( Product -> Order_Position) run the following
two queries:
1

Product Name and Product Item Price.

Product Name, Product Item Price, Order Position Value, Product


Amount and Product Price.
To illustrate the first fan trap ( Product -> Invoice) run the following two
queries:

A-8

Product Name and Product Item Price.

Product Name, Product Item Price, Delivery Costs, Invoice Value and
Total Product Item Price.

Resolve the traps using your chosen method.


Answer: Your schema result should look like this:

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Quiz: SQL traps


1

How would you describe a chasm trap?


Answer:
A chasm trap is a type of join path between three tables when two many
to one joins converge on a single table, and there is no context in place
that separates the converging join paths.

How would you describe a fan trap?


Answer:
Fan traps can fan out into multiples tables, however a fan trap may still
occur with a one to many join between 2 tables.

What is the recomended way to solve SQL traps?


Answer:
Using aliases and contexts.

Answer KeyLearners Guide

A-9

Lesson 6
Activity: Derived Tables
1

In the MotorsAdv universe, update the existing Sales Revenue measure


SQL syntax to include a month value aggregation level.

Tip: Check other objects that reference the monthly aggregate, for example
year in the Financial Period.
Answer:

Aggregate Navigation: The Monthly Figures table should be made


incompatible with the following classes:

Client

Best Customers

Showroom

Rentals

Where Restriction Objects

Employees

YTD Objects

Derived Objects

Objects to change:

Sales Revenue:

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

Finacial Year:

@Aggregate_Aware(ANNUAL_FIGURES.FP_YEAR,QUARTER_FIGUR
ES.FP_YEAR,Monthly_Figures.year,FINANCE_PERIOD.FP_YEA
R)

Financial Month:

@Aggregate_Aware(Monthly_Figures.Month,FINANCE_PERIOD
.FP_MONTH)

Test the aggregation level generations by running test queries in Web


Intelligence.
Answer:

Open the Designer Query Panel and view the SQL of the following
combination of objects:

Financial Year and Sales Revenue:


SELECT DISTINCT
ANNUAL_FIGURES.FP_YEAR,
sum(ANNUAL_FIGURES.ANNUAL_SALE_VALUE)
FROM
ANNUAL_FIGURES
GROUP BY
ANNUAL_FIGURES.FP_YEAR

A-10

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Financial Year, Financial Quarter and Sales Revenue:


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

Financial Year, Financial Quarter, Financial Month and Sales


Revenue:
SELECT DISTINCT
FINANCE_PERIOD.FP_YEAR,
sum(SALE_MODEL.SALE_QTY * MODEL.MODEL_PRICE * ((100 SALE.SALE_SALE_DISCOUNT) / 100)),
FINANCE_PERIOD.FP_QUARTER,
FINANCE_PERIOD.FP_MONTH
FROM
FINANCE_PERIOD,
MODEL,SALE,SALE_MODEL
WHERE
( SALE.SALE_DATE between FINANCE_PERIOD.FP_START and
FINANCE_PERIOD.FP_END )
AND

( SALE.SALE_ID=SALE_MODEL.SALE_ID

AND

( SALE_MODEL.MODEL_ID=MODEL.MODEL_ID

AND

( SALE.SALE_TYPE='S'

GROUP BY
FINANCE_PERIOD.FP_YEAR,FINANCE_PERIOD.FP_QUARTER,
FINANCE_PERIOD.FP_MONTH

Answer KeyLearners Guide

A-11

Financial Year, Financial Month and Sales Revenue:


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

Financial Month and Sales Revenue:


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

A-12

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

Quiz: Index Awareness and Derived Tables


1

What is Key Index Awareness?


Answer:
Index awareness is the ability to take advantage of the database indexes
on key columns to speed data retrieval.

What happens to the SQL and the LOV when you define primary key
index awareness?
Answer:
1) when an Index Aware object is used in the CONDITIONS pane, the
Primary Key entry will replace the objects SELECT
2) The primary key object is added to the LOV SQL and in the report the
operand Value(s) in list dialog returns the Primary Key values that match
the name values selected.

When using multiple foreign key entries, which foreign key is the one
used?
Answer: The last one in the list.

When using multiple foreign key entries of which one is a shortcut join,
which foreign key is the one used?
Answer:
The one joined via the shortcut join. Shortcut joins take precedence over
all other joins.

Answer KeyLearners Guide

A-13

Lesson 7
Quiz: External Strategies
1

What are the three key files that are involved in defining External
Strategies?
Answer:
1

<RDBMS>.stg

<RDBMS>en.stg

<RDBMS>.sbo

What format is used to define External Strategy files?


Answer: XML

Where are the External Strategy control files located?


Answer:
C\Program Files\Business Objects\BusinessObjects
Enterprise11.5\win32_x86\dataAccess\connectionsServer\<RDBMS>\

A-14

BusinessObjects XI R1/R2: Advanced Universe DesignLearners Guide

You might also like