Professional Documents
Culture Documents
Masters
David G. Rathbun, Integra Solutions
Topics
Introduction
Tricks of the Masters
Wrap Up
Q&A
Please hold questions until the end of the presentation
Slide 3
Introduction 1/3
A few words about me…
Focused on BusinessObjects Solutions since 1995
Consulting / mentoring / trouble shooting
Certified BusinessObjects trainer
Primary focus on knowledge transfer and client education
Selected to present at 1996 - 2005 User Conference
10 consecutive years as a presenter
Charter member of BOB
http://busobj.forumtopics.com
Slide 5
Introduction 2/3
A few words about Designer…
Designer has changed very little since 4.0
Initially released in 1996
Introduced contexts, aggregate awareness, multiple SQL statements
Core technology has been stable for many years
Most important component of your implementation
A bad universe = a bad implementation
Think ZEN
• Zero Defect Coding
• Efficient SQL Generation
• Narrow Project Scope
Know the rules and when to break them
Slide 6
Introduction 3/3
What has changed over the years?
Designer Evolution
Version Feature
6.0 Find and replace
Integrity check does not check cardinalities by default
List of aliases available
6.1 Parameter settings as part of the universe
Save as PDF
Slide 7
Topics
Introduction
Tricks of the Masters
Wrap Up
Q&A
Slide 8
Tricks of the Masters
Demonstrations today will use Designer 6.5 although many techniques are valid in 5.x
Slide 9
Intelligent SQL Generation
Slide 10
Join Loops 1/4
Slide 11
Join Loops 2/4
Why are loops bad?
SQL Generator uses all available paths
SELECT
Employees.EMP_LASTNAME,
Salary.SALARY_VALUE
FROM
Salary,
Employees,
Absenses,
Lookups
WHERE
( Absenses.EMP_ID=Employees.EMP_ID )
AND ( Salary.EMP_ID=Employees.EMP_ID )
AND ( Lookups.LOOKUP_ID=Salary.LOOKUP_ID )
AND ( Lookups.LOOKUP_ID=Absenses.LOOKUP_ID )
Slide 12
Join Loops 3/4
Slide 13
Join Loops 4/4
Slide 14
When Do I Use an Alias? 1/3
Slide 15
When Do I Use an Alias? 2/3
Note: You should never have a Many – Many relationship in a production database!
Slide 16
When Do I Use an Alias? 3/3
Fixed the loop!
Demonstration
Slide 17
When Do I Use a Context? 1/3
Slide 18
When Do I Use a Context? 2/3
Slide 19
When Do I Use a Context? 3/3
Slide 20
Alias versus Context
Slide 21
Chasm Trap Definition
A chasm spans a many – one – many relationship
Each showroom has many employees
Each showroom has many annual salary figures
The number of employee records should not impact the
total salary on the report
Slide 22
Chasm Trap Example 1/3
SELECT
Showrooms.SHOWROOM_NAME,
sum(Salary_Summary_Annual.ANNUAL_SAL_TOTAL)
FROM
Salary_Summary_Annual,
Showrooms
WHERE
( Salary_Summary_Annual.SHOWROOM_ID =
Showrooms.SHOWROOM_ID )
GROUP BY
Showrooms.SHOWROOM_NAME
Showroom Name Annual Salaray
Prestige Cars $316,720.00
Prestige Motors $565,730.00
Prestige Sports Cars $461,380.00
Sum: $1,343,830.00
Slide 23
Chasm Trap Example 2/3
SELECT
Showrooms.SHOWROOM_NAME,
Employees.EMP_LASTNAME,
sum(Salary_Summary_Annual.ANNUAL_SAL_TOTAL)
FROM
Employees,
Salary_Summary_Annual,
Showrooms
WHERE
( Employees.SHOWROOM_ID=Showrooms.SHOWROOM_ID )
AND (
Salary_Summary_Annual.SHOWROOM_ID=Showrooms.SHOWROOM_I
D )
GROUP BY
Showrooms.SHOWROOM_NAME,
Employees.EMP_LASTNAME
Slide 24
Chasm Trap Example 3/3
Slide 25
Context Chasm Trap Solution 1/2
Slide 26
Context Chasm Trap Solution 2/2
Slide 27
Intelligent SQL Generation Review
Slide 28
Tricks of the Masters
Demonstrations today will use Designer 6.5 although many techniques are valid in 5.x
Slide 29
Effective Use of Derived Tables
Slide 30
Creating A Derived Table 1/2
Slide 31
Creating A Derived Table 2/2
Slide 32
Summary Data
Demonstration
Slide 33
Tricks of the Masters
Demonstrations today will use Designer 6.5 although many techniques are valid in 5.x
Slide 34
Hierarchical Data 1/2
Slide 35
Hierarchical Data 2/2
Some typical questions
Who do I work for?
Who are my direct reports?
Who reports directly to me in the organization
Who are my indirect reports?
Who works for someone that works for me
What is my level in the hierarchy?
Show my parents in the tree
Show my children in the tree
Slide 36
Alias Solution 1/2
One solution
Use aliases to represent the hierarchical relationships
Demonstration
Slide 37
Alias Solution 2/2
The problems
Unknown depth
Each new level requires an alias
Adding new employees should not require universe maintenance
Varying depth
An organization tree is not always balanced
Different employees have different depths
Outer joins are used to allow for missing data
Outer joins can cause performance issues
Not all databases support outer join chains (sequences of outer joins)
Slide 38
Creating New Tables 1/2
Another solution
Create a new table to flatten out the structure
Employee ID
Manager ID
Top Level ID
Each person exists as a top level ID
Who works for me?
Each person exists as an Employee ID
Who do I work for?
What is my level?
Slide 39
Creating New Tables 2/2
The problems
This table has to be created / populated / updated
Stores each potential manager as a top level
Inflates the amount of data
Have to change objects if I change questions
Who works for me?
Who do I work for?
What is my level in the hierarchy?
Slide 40
Tree Traversal Data 1/5
Store the tree traversal path in the original table
Assign each person (node) a left and right value
Value is determined by tree traversal order
1 Noakes 16
Slide 41
Tree Traversal Data 2/5
Using left and right data to build the hierarchy
ID Full Name Left Tree Right Tree Name Descendants Parents Level
101 Noakes, Nicholas 1 54 Noakes, Nicholas 26 0 1
102 Ferrerez, Ferdinand 2 5 Ferrerez, Ferdinand 1 1 2
103 Field, Felicity 3 4 Field, Felicity 0 2 3
104 Fraser, Frank 6 7 Fraser, Frank 0 1 2
105 Snow, Sara 8 13 Snow, Sara 2 1 2
106 Speed, Sonya 9 10 Speed, Sonya 0 2 3
107 Spencer, Steve 11 12 Spencer, Steve 0 2 3
108 Helen, Harrison 14 15 Helen, Harrison 0 1 2
109 Thomas, Tom 16 19 Thomas, Tom 1 1 2
110 Thatcher, Terry 17 18 Thatcher, Terry 0 2 3
111 Davis, Diana 20 21 Davis, Diana 0 1 2
201 Pickworth, Paul 22 39 Pickworth, Paul 8 1 2
202 Forest, Florence 23 28 Forest, Florence 2 2 3
203 Brown, Bella 24 25 Brown, Bella 0 3 4
204 Porter, Pete 29 34 Hilary, Hibbs 0 3 4
205 Irving, Ira 30 31 Porter, Pete 2 2 3
206 Bailey, Ben 32 33 Irving, Ira 0 3 4
207 Duckworth, Dave 35 38 Bailey, Ben 0 3 4
208 Ince, Ian 36 37 Duckworth, Dave 1 2 3
209 Hilary, Hibbs 26 27 Ince, Ian 0 3 4
Demonstration
Slide 42
Tree Traversal Data 3/5
1 Noakes 18
Slide 43
Tree Traversal Data 4/5
Revisiting derived tables
Including the following derived table in our universe…
SELECT A.EMP_ID,
(A.RIGHT_TREE-A.LEFT_TREE-1)/2 AS Number_of_descendants,
COUNT(B.EMP_ID) AS Employee_Level,
COUNT(B.EMP_ID)-1 AS Number_of_parents
FROM Employees A, Employees B
WHERE B.LEFT_TREE <= A.LEFT_TREE AND B.RIGHT_TREE >= A.RIGHT_TREE
GROUP BY A.EMP_ID, (A.RIGHT_TREE-A.LEFT_TREE-1)/2
Slide 44
Tree Traversal Data 5/5
Slide 45
Hierarchical Data Recap
Slide 46
Tricks of the Masters
Demonstrations today will use Designer 6.5 although many techniques are valid in 5.x
Slide 47
Q&A
Questions?
Contact information
David G. Rathbun
Integra Solutions
www.IntegraSolutions.net
Slide 48