Beruflich Dokumente
Kultur Dokumente
Designer Essentials
Alan Mayer & Penny Brewer
Version 1.0
November xx, 2004
Presentation Information
Universe Definition
Tables
Joins
Loops
Aliases
Contexts
Chasm Traps
Fan Traps
Conclusion (Q&A)
BusinessObjects
The semantic layer seen by users as they query the database
Constructed from business terms they understand
Tables and joins predefined in the background
A universe contains
A structural representation of the database
A logical interpretation of the data retrieved
</Strategy>
<Strategy Name=“Project Tables">
<Message id="Help">This strategy selects project tables.</Message>
<Message id="Name">External Strategy: Project Tables</Message>
</Strategy>
PK
City.city_id=Customer.city_id
FK
Oracle:
Customer.cust_id = Sales.cust_id (+)
DB2:
SELECT …
FROM Customer LEFT OUTER JOIN Sales
ON Customer.cust_id = Sales.cust_id
Customer.age
BETWEEN
Age_group.age_min and
Age_group.age_max
Customer.sponsor_id = Customer.cust_id
Country.country_id = 1
Join Editor
Shortcut Join
Automatic
or
Manual
Employee Trips
Trips
Employees Countries
An Alternative Definition
“Loops represent pools of water that cannot escape”
Employee Trips
Trips
Employees Countries
Employee Trips
Trips
Employees Countries
Detecting Loops
Always a good idea
Use the Detect Loops button (Tools / Detect Loops)
Printing Loops
Use the Integrity Check button (Tools / Check Integrity) to print loops
N N
1 1
Countries
SELECT a.country,
b.country Table aliases
FROM country a,
country b
Creating a alias in BusinessObjects
WHERE …
Employees Countries
Nationality
(Countries)
Before:
Lookups
Lookups
Type Code Description
SAL 001 Base Salary
SAL 002 Overtime After:
SAL 003 Company Car
ABS 001 Holiday Abs_Lookups
ABS 002 Sick (Lookups)
ABS 003 Sick of Job
Sal_Lookups
(Lookups)
Before:
Employees Employees
Emp_ID Name Manager_ID
1 Mayer 5
5 Smith 23 After:
23 Betten 42 Employees Managers
42 Byrd (Employees)
Problem #1 Problem #2
Employee Trips
Trips
Employees Countries
A D DE
EF
Context #2 F
B C
Context #1 Context #2
A D AB AD
BC DE
CD EF
Z E
DE
EF
F
Problem #1
A shortcut join “dissolves” the normal join relationship
For the following query, only guests that have past and future activity
will be returned
Problem #1 Results
For the following query, only guests that have past and future activity
will be returned
Problem #2
In this scenario, no known path exists to Service
A query cannot be written without a Cartesian Product
Problem #2 Results
The join from Service to any other table is missing!
No join to Service
Sales Invoice_Line
inv_id … max_ inv_id service_id … nb_
guests guests
23102 10 23102 211 4
23103 8 23102 221 3
23104 5 …
What happened?
Two detail lines for Invoice 23102
Budgeted Guests is overstated by a factor
(10 guests budgeted) * (2 detail lines) = 20 guests
Result Set
Invoice Budgeted Actual (Budgeted Guests) *
Guests Guests (Number of detail lines)
23102 10 3
23102 10 4
Totals: 20 7
Solution #1
Create a separate SQL statement per aggregation
Aggregations on the same table require only 1 SQL statement
File /
Parameters
from main
menu
Service
inv_id … service
211 Hotel Room
221 Restaurant
…
Sales Invoice_Line
inv_id … max_ inv_id service_id … nb_
guests guests
23102 10 23102 211 4
23103 8 23102 221 3
23104 5 …
Is there a problem?
Guests are budgeted at the invoice level, not service level
Summing the Budgeted Guests would be a mistake
Not good
Possible solutions
Budget guests at a lower level of detail
Prevent this query from occurring (drastic)
Create a “smarter” report that realizes that budgeted guests can
only be represented at the invoice level
More advanced solutions are possible
Aggregate-aware techniques
Alias/Context solutions (brittle)
Data warehouse / data mart
Alan Mayer
amayer@integrasolutions.net
(214) 637-6622
Penny Brewer
pbrewer@integrasolutions.net
(214) 637-6622