Bou220 en
Bou220 en
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
1-2
1-2
1-2
1-3
1-4
1-5
1-5
1-5
1-7
1-8
iii
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
Lesson 3
Lesson 4
Lesson 5
Lesson 6
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
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
vii
viii
vii
viii
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.
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.
Online Help.
Retrieve information and find answers to questions using each products
Online Help.
ix
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.
Work with derived tables to solve structure and complex objects issues
xi
xii
Computer Setup
This section lists the hardware and software setup requirements for trying the
activities on your own.
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
Computer Setup
Hardware
The minimum hardware requirements are:
P3 700MHz
Software
The software required for this course is:
Note: This course uses SQL Server 2005 which needs a server based
OS. It is therefor not recommended to install this on XP.
Note: For a complete list of supported operating systems for servers and
client components, refer to the Platforms.txt with your product
installation
BusinessObjects Designer
xv
Windows 2003
Install Microsoft SQL Server 2005 using the setup.exe in the Server
folder and by selecting the following installation components
Microsoft Internet Information Server (IIS) 5.0 (ISAPI and CGI for
Windows)
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.
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.
xvii
Double-click or drag these data objects into the Result Objects box:
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:
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.
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.
From the Windows Control Panel, click Administrative Tools, and then
click Data Sources (ODBC).
Scroll down to select the SQL Server driver, and then click Finish.
Click Next.
Click Next.
Select the Change the default database to check box, and then select
the MotorsAdv from the drop-down list
xix
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: Secured
Name: MotorsAdv
User name: sa
Click Test Connection to verify the data source server, and then click
Next.
To save the universe with the new connection, click File > Save.
To export the universe, click File > Export, and then click OK twice.
xx
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.
Type: Secured
Name: CRM
User name: sa
Click Test Connection to verify the data source server, and then click
Next.
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
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.
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
Lesson 1
Duration: 2 hours
1-1
Describe Metadata
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
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:
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
Data Warehouse
OLTP
Data Mart
Transaction oriented
around entities and
relationships
Developed to access
specialized departmental
data for query and
analysis
Fewer tables,
de-normalized
schema
Highly de-normalized
schema
Consolidated and
summarized rows
Summarized rows
Large indexes
Historical data
Historical 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.
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
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.
1-7
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.).
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.
1-8
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.
1-9
1-10
To solve this you can have two separate dimension classes, one with current
data and one with historical data.
OLTP
Data Warehouse
Mainly equi-joins
1-11
Description
Preparation
Understand limitations.
Planning
Implementation
Analysis
1-12
Development
Phase
Description
Testing
Deployment
Updating/
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.
Role
Task
Sponsor
Project Leader
Analyst
Data Expert
Key User
1-13
Role
Task
Pilot Users
Users who will work with the universe during the universe
build and development phase.
QA Reviewer
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
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
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?
These requirements are captured in the form of candidate classes and objects.
1-15
Do not normalize
Do not try to figure out where this data can be found in the database
1-16
Type
Name
Description
Source
Class
Customer
Information on a customer,
including location, credit
ratings, and shipping
preferences.
Interview #1
Object
(Measure)
Total revenue
Interview #3,4
Planning Phase
The planning phase will be used to identify a project strategy and determine
resource requirements.
1-17
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
Connectivity
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
Support Plan
Change
Management
Plan
Training Plan
Implementation Phase
The Implementation phase can be split up into two stages:
1-18
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
Interview #3,4
ORDER_LINES,
PRODUCTS
1-19
Multiple universes which cater for a specific function within the business,
reducing the complexity and amount of classes and objects.
1-20
1-21
Set up the universe parameters and connect to the relevant data source
Define hierarchies
1-22
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 ways to organize objects (e.g., move an object from one class to
another, reclassifying a dimension as a detail, 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
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.
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.
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
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:
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.
1-25
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.
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.
1-26
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.
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.
1-27
Avoid building universe tables with no joins, even if these tables are just
snapshots of Oracle materialized views.
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
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).
Identify the products per store location that were purchased by clients.
Identify the sales for 2000 for a specific product in each country.
Standards
Company A reports need to refer to customers as clients.
The database contains orders for 3 years (1998, 1999 and 2000).
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?
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?
Lesson summary
Review
Quiz: Universe Development Process
1
data warehouse
OLTP
data mart
List three key points to consider in the Analysis stage of Universe Design.
1-31
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 Metadata
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:
Duration: 2 hours
2-1
2-2
Description
<driver><language>.stg
For example: sqlsrven.stg
<driver>.stg
For example: sqlsrv.stg or
oracle.stg
<driver>.sbo
For example: odbc.sbo
<driver><language>.prm
For example: sqlsrven.prm
<driver>.prm
For example: sqlsrv.prm
<driver><language>.cod
For example: odbcen.cod
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:
2-3
The table below outlines what some of the above shown parameters mean
Parameter
Description
Family
Array Bind
Available
Driver Level
Specifies the limitations of each driver. This setting is specific to each <driver>.sbo file
CharSet
Table
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
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.
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.
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.
Configuration
Date
Operations
Operators
Functions
2-6
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.
2-7
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>\
</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>
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.
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.
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>\
</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>
2-9
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>\
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.
SORT_BY_NO
2-10
Value
Description
GROUPBYCOL
Value
Description
GROUPBY_WITHOUT_CONSTANT
Value
Description
CONCAT
2-11
EXT_JOIN
Value
Description
OUTERJOINS_GENERATION
Description
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
KEY_INFO_SUPPORTED
Value
Description
This function specifies if you can retrieve primary and secondary key definitions from the database account
UNION
(default value:
UNION)
INTERSECT
(default value:
INTERSECT)
MINUS
(default value:
MINUS)
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
Datatype_Int
Datatype_Blob
Datatype_Null
Datatype_Double
Datatype_String
LenMaxForVarchar
LenMaxForTableName
LenMaxForColumnName
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>
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.
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
2-17
2-18
Select File > Parameters > Parameter from the toolbar menu.
The Parameter menu opens showing the SQL parameters.
Change the value as required and click Replace to apply the changes.
END_SQL:
Values
Description
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
Description
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
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.
2-21
FILTER_IN_FROM
Values
Description
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:.
2-22
2-23
2-24
Select the appropriate option from the behavior drop down list.
AUTO_UPDATE_QUERY
Value
Description
BLOB_COMPARISON
Value
Description
COLUMNS_SORT
Values
Description
FORCE_SORTED_LOV
Values
Description
2-25
DECIMAL_COMMA
Values
Description
BOUNDARY_WEIGHT_TABLE
Value
Description
Limitations
COMBINED_WITH_SYNCHRO
2-26
Values
Description
CORE_ORDER_PRIORITY
Values
Description
CORRECT_AGGREGATED_CONDITIONS_IF_DRILL
Values
Description
CUMULATIVE_OBJECT_WHERE
Values
Description
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'
2-27
DISTINCT_VALUES
Values
Description
SELECT DISTINCT
cust_name
FROM
Customers
SELECT
cust_name
FROM
Customers
GROUPBY cust_name
EVAL_WITHOUT_PARENTHESIS
Values
Description
2-28
FIRST_LOCAL_CLASS_PRIORITY
Values
Description
MAX_INLIST_VALUES
Values
Description
REPLACE_COMMA_BY_CONCAT
Values
Description
THOROUGH_PARSE
Values
Description
2-29
SHORTCUT_BEHAVIOR
Values
Description
UNICODE_STRINGS
Values
Description
2-30
Click Add.
2-31
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
2-33
Click Replace.
The Parameter syntax for the END_SQL has now been modified.
2-34
Select File > Export from the menu bar. Export the universe to the CMS.
Note: The last line in the SQL contains the syntax added to the
END_SQL parameter in the Parameters menu.
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?
2-36
Describe the different data source credentials that can be applied in the
connection
2-37
2-38
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.
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.
2-39
15 Click OK.
16 Expand Tables.
2-40
2-41
2-42
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.
2-43
2-44
Parameter
Description
Disconnect after
each transaction
Parameter
Description
Login time-out
2-45
2-46
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.
BO username: @Variable(BOUSER)
Auditing
Query Banding
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
RULE
FULL
ROWID
INDEX_FFS
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
Activity: ConnectInit
Objective
Instructions
1
Highlight the ConnectInit parameter and add the following syntax to the
box.
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ
Click Finish.
Click OK.
From the Start menu select Program > Administrative Programs >
ODBC
2-49
Lesson summary
Review
Quiz: Universe Parameters
1
File
Description
*.stg
*.sbo
cs.cfg
*.prm
2-50
Summary
After completing this lesson, you are now able to:
Describe the different data source credentials that can be applied in the
connection
2-51
2-52
Lesson 3
3-1
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
Function
Description
Ceiling
Floor
Round
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.
3-3
Description
Fn_Left (or
Left(,))
Fn_Right (or
Right(,))
Charindex
Fn_Length
Substring
These functions can be used to establish a character string length by using the
length function. The substring, left and right functions can allow extracting
values of a specified length 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
Description
CASE WHEN
THEN ELSE
END
3-5
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)
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
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)
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
Recreate the following objects in the Annual Figures class using the
CASE WHEN THEN ELSE END statement:
Object Name
sum(IIf(FINANCE_PERIOD.FP_YEAR='FY04-05',SALE_MODEL.SALE_QTY *
MODEL.MODEL_PRICE * ((100-SALE.SALE_SALE_DISCOUNT)/100),0))
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))
3-7
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)}
fn_week: this function will return the month values of a date object. For
example:
{fn week(FINANCE _PERIOD.FP_START)}
datepart(qq, ): this function will return the quarter values of a date object.
For example:
Datepart(qq, FINANCE _PERIOD.FP_START)
3-8
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:
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.
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.
3-9
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)
3-10
Instructions
Prompt
Object
Sales Date
Prompt
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)
Date
Sales Year
Prompt
Datepart(yyyy,@Select(
Sales Dates\Sales Date
Prompt))
Number
Sales Month
Prompt
Datepart(mm,@Select(
Sales Dates\Sales Date
Prompt))
Number
3-11
Boolean Flag
Object
Sales Date in
Prompt flag
SELECT syntax
Description
THEN 1
ELSE 0 END
Sales Date in
Prompt flag 1yr
*
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 sign(@Select(Sales Dates\Month of Sale
Date) - @Select(Sales Dates\Sales Month
Prompt))
WHEN 1
THEN 1
ELSE 0 END
3-12
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
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)
Create a new query using Sale Date and Sales Total and Total Sales in
prompted yyyy-mm period.
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.
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.
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
3-14
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
THEN 1
ELSE 0 END
Sales in YTD
flag - current
month
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
3-15
Measure Object
SELECT Syntax
sum((SALE_YTD.SALE_TOTAL)*@Select(YTD Objects\Sales in
YTD flag))
sum((SALE_YTD.SALE_TOTAL)*@Select(YTD Objects\Sales in
YTD flag - current month))
Note: The new derived table and context can be removed as they are not
used in subsequent activities.
3-16
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.
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.
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.
3-18
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.
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
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.
3-19
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>\
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
</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
Instructions
2
3
3-21
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
</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
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:
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.
Make sure that Designer is restarted after making the changes in the PRM
file.
Edit the SELECT statement and expand the Numeric functions list. The
new Row Number function will now show up.
Edit the SELECT statement and expand the Numeric functions list. The
new Rank function shows up in the list.
3-23
3-24
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.
Summary
After completing this lesson, you are now able to:
3-25
3-26
Lesson 4
Advanced LOVs
4-1
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
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.
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')
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
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')
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.
4-5
Drag the objects that are needed to define the subquery into the Result
Objects pane. In our example Client Name and Sale Date.
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.
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
4-6
Instructions
1
Drag the objects outlined in the objective into the Result Objects pane.
Click Begin.
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.
4-7
4-8
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.
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.
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.
4-9
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.
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.
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
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.
4-11
Click Parse.
Click OK.
15 Save and export the universe and test in Web Intelligence using upper
and lower case patterns.
4-12
Advanced LOVs
This unit explains different techniques for customizing your list of values.
After completing this unit, you will be able to
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.
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 Run.
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)
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
Instructions
1
Click Apply.
ELSE
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)
4-15
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)
4-16
To retrieve alphabetically listed values works fine for most objects, however
this poses a problem for month and weekday string values.
4-17
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 Run.
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
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.
4-19
Add the first letter object to the cascading list of values menu, followed by
the original object.
10 Click OK.
11 Save and export the universe.
4-20
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.
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
Click OK.
Click Run.
4-21
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
Click Edit.
Click Run.
4-23
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
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.
4-25
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.
Make sure the new join has been added to the relevant contexts.
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
Lesson summary
Review
Quiz: Complex Predefined Conditions and LOVs
1
What is the difference between ALL and ANY when creating a sub
query?
Summary
After completing this lesson, you are now able to:
4-27
4-28
Lesson 5
Chasm Traps
Fan Traps
Duration: 1 hour
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:
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
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:
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
PRODUCTS
Product_ID
PRODUCTS
Product_Name
ORDER_POSITION
Order_Position
ORDER_POSITION
sum(ORDER_POSITION.Order_Pos_Value)
5-3
Table
PRODUCTS
Product_ID
PRODUCTS
Product_Name
STORE_FACTS
Store_ID
STORE_FACTS
sum(STORE_FACTS.Difference_in_Store)
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.
5-4
using Contexts
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
5-5
( 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
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.
Make sure that the option File > Parameters > SQL > Multiple SQL
statements for each context is activated in the universe designer.
5-7
Fan Traps
After completing this unit, you will be able to:
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.
5-8
Table
ORDER_HEADER
sum(Discount)
ORDER_HEADER
sum(Order_Total_Value)
ORDER_HEADER
Order_Number
A second query is run using only columns from the ORDER_POSITION table:
Table
ORDER_POSITION
sum(Order_Pos_Value)
ORDER_POSITION
Order_Position
ORDER_POSITION
Order_Number
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:
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:
5-10
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.
5-11
5-12
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:
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.
5-13
Instructions
1
Products
Order_Position
Invoice
Invoice_red
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)
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
5-15
Lesson summary
Review
Quiz: SQL traps
1
Summary
After completing this lesson, you are now able to:
5-16
Lesson 6
Derived Tables
6-1
6-2
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.
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
Click Insert.
A key line is inserted in the list of keys box.
6-4
Click the drop-down arrow next to Primary Key and select Primary in
the Key Type list.
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
COUNTRY_MAKER.COUNTRY_ID.
Click OK.
Select Enabled.
Click OK.
6-5
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.
6-6
Click Edit
The Designer Query Panel opens displaying the indexed object in the
Result Objects pane.
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.
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.
6-7
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.
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 Enabled.
Click OK.
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
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
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.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
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)
6-13
Instructions
1
Double-click the Client Country object and click the Keys tab.
This object already has a primary key and foreign key index applied.
Double-click on the Type your SELECT here... box and enter the
following syntax in the box:
REGION.COUNTRY_ID
Click OK.
Add Client Name, Region and Sales Revenue to the Result Objects
pane, and drag Country into the Query Filters pane.
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
26 Which table is used to return the index values for the Client Country?
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?
6-15
So why did defining the index awareness generate duplications in the LOV?
6-16
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
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.
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
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.
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.
Double-click the object on which you are setting up index awareness and
select the Keys tab.:
Click Apply.
6-20
Double-click the object on which you are setting up index awareness and
select the Keys tab.
Click OK.
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.
6-21
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 Edit.
Click the View SQL toolbar icon. The LOV SQL now shows the additional
Where clause condition.
Click OK.
Note: Adding a Where clause to the foreign key index does not affect the
LOV SQL.
6-22
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.
Edit the Client Country object and click the Keys tab.
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.
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.
6-23
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.
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
6-24
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.
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:
6-26
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 class create the Sales Total and Rental Total objects based
on the new columns of the derived table.
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.
6-28
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
6-29
Instructions
1
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
6-30
Join the derived table with the Maker and Showroom tables using the
appropriate foreign keys and update the Sales context.
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
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
Lesson summary
Review
Quiz: Index Awareness and Derived Tables
1
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?
Summary
6-33
6-34
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:
Duration: 1 hour
7-1
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):
7-2
7-3
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
Joins
Designer has four built-in strategies that automatically create joins in a
universe.
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 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:
extracting column comments from your source system and use them as
object descriptions.
7-5
/* table name */
/* class name in BO */
7-6
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
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.
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.
7-8
Column
Output
Description
Table
Column
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
Object Type
Description
Objects Type
(D,M,I)
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
Column
Output
Description
Table1
Table2
Join Operator
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
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>
7-12
Column
Output
Description
Table Qualifier
Database name
Owner
Table
Column
Column name
Data Type
Null?
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
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.
7-13
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.
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\
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
Add the appropriate helptext help text syntax using the following XML
element syntax:
Check the validity of the XML file, then save and close the file.
7-15
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\
7-16
','|',
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.
7-17
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
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)
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.
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.
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
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..
7-21
Lesson summary
Review
Quiz: External Strategies
1
What are the three key files that are involved in defining External
Strategies?
7-22
Appendix A
Answer Key
This appendix contains the answers to review questions in the applicable
lessons.
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
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.
A-2
data warehouse
OLTP
data mart
Transaction oriented
around entitles and
relationships
Large indexes
Historical data
Always currently
accurate data
Historical 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
Lay out structure window with the cardinalities facing the same
direction and tables arranged logically
A-3
Consider putting full class path and object name in the objects
description
A-4
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.
*.sbo
cs.cfg
*.prm
Contains default SQL parameters used for query generation, date and other operators and functions
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
A-6
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
@Select
@Where
A-7
Lesson 5
Activity: Resolving SQL Traps
1
A-8
Product Name, Product Item Price, Delivery Costs, Invoice Value and
Total Product Item Price.
A-9
Lesson 6
Activity: Derived Tables
1
Tip: Check other objects that reference the monthly aggregate, for example
year in the Financial Period.
Answer:
Client
Best Customers
Showroom
Rentals
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)
Open the Designer Query Panel and view the SQL of the following
combination of objects:
A-10
( 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
A-11
A-12
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.
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
A-14