Anda di halaman 1dari 98

Module 10

Using @ Functions
August 01, 2000 Tata Infotech Limited
2 August 01, 2000
What You Will Be Able To Do
Know what @ Functions are available
Note: @AggregateAware is covered later in the course
Be able to apply them
Know what @ Functions do
3 August 01, 2000
The @ Functions
The @ Functions available are:
These Functions are applied
in the Select and Where boxes
of objects
They are used to provide
flexible methods of specifying
SQL
4 August 01, 2000
@Prompt
@Prompt is placed in an object as part of the Select or Where
properties
When a query is run that includes the object, the @prompt of the object
forces a prompt box to appear
5 August 01, 2000
@Prompt Syntax
SHOWROOM.SHOWROOM_NAME = @PROMPT
Free or constrained (to value in LoV)..
Constrained
Enter Showroom Name,
The prompt.
A,
Data Type (A, N or D)...
Showroom\Showroom,
LoV Pointer....
Or hard coded list : {A,B,C}
Mono, Mono or multi (LoV selection)..
(
)
Operator dependent on operand
6 August 01, 2000
@Select
@Select function acts as a pointer to the Select box of another object:
@Select (Class_Name\Object_Name)
Creates a dynamic link between objects, so that update of the original
object Select statement automatically updates the other objects
7 August 01, 2000
@Where
The @Where function acts as a pointer to the Where box of another object
Creates a dynamic link between objects, so that update of the original
object Where clause automatically updates the other objects or condition
objects
8 August 01, 2000
@Where - Designer Strategy
You can create a Class containing only Where clause objects, and hide
the Class from end Users - other objects use the Where clauses, but the
Users dont see the base objects.
9 August 01, 2000
@Variable - with Personal Files
The @Variable function can be used in conjunction with
a text file to define User-specific conditions in an object:
C:\BusinessObjects\Busobj.exe -vars Bovars.txt
COUNTRY = JAPAN
10 August 01, 2000
@Variable - with Personal Files: Drawbacks
Requires localized administration of the text file by the
Designer / Supervisor
The command string must be changed on every
User s PC to include the -vars <textfile.txt> argument
Security can be a problem, as a text file on a PC is
open to local amendment
Conclusion: Better to use the options in the Supervisor
module
11 August 01, 2000
@Variable - with BusinessObjects Variables
The @Variable function can also be used with the
BusinessObjects variables to define User-specific
conditions in an object:
BOUSER
BOPASS
Where clause:
Employees.Employee_Name = @Variable(BOUSER)
Restricts data returned to that relating to the Users login name
12 August 01, 2000
@Script
Allows use of a variable declared in a VBA script
The script smotors runs the country selection process
Module 11
Lists of Values
August 01, 2000 Tata Infotech Limited
14 August 01, 2000
What You Will Be Able To Do
Base a LoV on a personal file
Associate or remove a List of Values (LoV) for an
object
Control how LoVs are refreshed
Modify a LoV using a condition
Modify a LoV by creating a hierarchy
15 August 01, 2000
What is a List of Values?
A LoV is used on the operand side of a condition in
the query panel of the User module
This is only available if set by the designer
A list of the distinct values from the column or
columns to which the object refers
16 August 01, 2000
How do Lists of Values work?
A designer can create a LoV which is based on:
A query of the target database
A constant set of values held in a file
In both cases, the result is stored locally in a file on
the User s PC.
17 August 01, 2000
Creating a List of Values
A LoV is created within the Properties tab of an object
By default,
Associate a List
and Allow Users to
edit are checked:
It is important to
uncheck this box
for objects that
dont need a List
18 August 01, 2000
Controlling How Lists are Refreshed
Normally, the first time a LoV is used in a User login
session, the system fires a query at the target
database.
The results of this query are used to populate the list,
and are stored in the .lov file.
Thereafter, the .lov file from this query is used each
time the List is required.
19 August 01, 2000
Controlling How Lists are Refreshed
Not normally used -
uncheck this box
Check this box for
frequently changing lists
Check this box for lists
that never change
20 August 01, 2000
Modifying the Content of a List of Values
You can limit the values returned by applying a
condition to the LoV
You can simplify the process of choosing a value for
Users by creating a hierarchy for the LoV
You can supply a personal data file containing the
values for the list, instead of using the results of the
query
21 August 01, 2000
Applying a Condition to a List of Values
Click Edit in the Properties box:
Apply the condition in the Query
Panel:
22 August 01, 2000
Creating a Hierarchy for a List of Values
Click Edit in the Properties box:
Place the hierarchy objects (which
must be sorted) to the right of the
LoV object in the Query Panel:
23 August 01, 2000
Creating a Hierarchy for a List of Values
The resulting Hierarchical View of the LoV makes it
easier to select the required value:
Country:
Town:
Showroom:
24 August 01, 2000
Basing a LoV on a Personal File
Select Tools, Lists of Values from the Menu bar:
Select the object:
Select Personal Data:
25 August 01, 2000
Basing a LoV on a Personal File
Click OK to acknowledge the message:
Specify the file that contains the values for the list
and click OK
Module 12
Hierarchies
August 01, 2000 Tata Infotech Limited
27 August 01, 2000
What You Will Be Able To Do
Test hierarchies in the User module
Organize Default Hierarchies for optimum usability
Create Time Dimension objects and Hierarchies
Create Custom Hierarchies
28 August 01, 2000
U.K.
North South
Liverpool Manchester Newcastle London Southampton Bristol
Level in Hierarchy Data Returned
What Is a Hierarchy?
29 August 01, 2000
A Default Hierarchy is the hierarchy based on the
order of the Objects within the Class
Default Hierarchies are
represented in the User
module by the order in which
Dimension Objects are
organized in the Classes and
Objects box of the Query
Panel
What Is a Default Hierarchy?
30 August 01, 2000
The Key to Creating Default Hierarchies
The designer must ensure, wherever possible, that
Dimension Objects are organized from the most
general to the most specific within the Class
31 August 01, 2000
Dimension Objects represent the levels in a hierarchy:
Top Level
Level 1
Level 2
Level 3
How are Hierarchies used in Analysis?
A Measure can be analysed at each level
32 August 01, 2000
Sale Date
25/11/99
Month Year
Quarter
Why Is Time A Special Case?
Day
33 August 01, 2000
Automatic Time Hierarchies

Using Database Functions

Table Based Time Hierarchies
Creating Time Hierarchies
34 August 01, 2000
A Custom Hierarchy combines Objects from Default
Hierarchies to build a Custom Analysis Path
What Is A Custom Hierarchy?
Default Hierarchies
Custom Hierarchy
35 August 01, 2000
Creating Custom Hierarchies
Add Objects from Default Hierarchies to build a new
Custom Hierarchy
(or Tools,
Hierarchies)
36 August 01, 2000
The Effect of Custom on Default Hierarchies
User module Scope of Analysis after a Custom
Hierarchy has been created:
No Default Hierarchies are shown
37 August 01, 2000
The Effect of Custom on Default Hierarchies
Selected Default Hierarchies can be added to the
Custom Hierarchies in Designer module
Module 13
Documenting and Distributing a Universe
August 01, 2000 Tata Infotech Limited
39 August 01, 2000
What You Will Be Able To Do
Print information about the universe
Print the universe schema
Know the advantages and disadvantages of the two
different ways that universes are distributed to end
users
Distribute a universe in Workgroup mode
Distribute a universe in Enterprise mode
40 August 01, 2000
Select the Tools, Options menu then click on the Print
tab to select what to print








Select the File, Print menu to print
Faire un aperu avant impression pour montrer.
Rappel : il n est pas possible d exporter le rsultat de l impression sous un format
texte ou autre pour le retravailler. C est une documentation technique et NON PAS
UTILISATEUR.
Documenting a Universe
41 August 01, 2000
Different phases require different types of universe distribution
Phase 3
Phase 5
Phase 4
Phase 6
Phase 7
Phase 1-2
Universe Design Cycle
42 August 01, 2000
There are two methods distributing universes
Business Objects
Repository
File System
Distributing Universes
43 August 01, 2000
File server
S:\Designer
S:\Test
Access controlled
By network security
Workgroup Mode
Business Objects
Universe
Motors2k.unv
(Shared Connection)
44 August 01, 2000
Enterprise Mode
Business Objects
repository
Export
Supervisor in control
User based security
allocated to user groups
Revision number checked when used
(Secured Connection)
Business Objects
Universe
Motors2k.unv
Motors2k.unv
Universe Domain Name
Business Objects
Universe
Revision number incremented
Motors2k.unv
Universe Domain Name
45 August 01, 2000
The Designer exports a universe to the universe domain and allocates
universe access to one of the groups of users he or she belongs to











The revision number of the universe is incremental. This number guarantees
the user will use the more recent version of the universe
Exporting a Universe
Designer
Repository
Universe Domain
Document Domain
Security Domain
Module 14
Universe Maintenance
August 01, 2000 Tata Infotech Limited
47 August 01, 2000
What You Will Be Able To Do
Know when a new version of a universe may be
required
Be able to identify changes to the target database of a
universe
Know how version changes will affect existing end
user reports
Be able to copy and past objects between universes
Be able to link universes and appreciate the different
strategies required
Be able to include universes
48 August 01, 2000
Reasons for Universe Maintenance
New tables added to database
Tables deleted, changed or renamed in database
Users request new classes or objects
Tip: Do not distribute new versions of universes too
frequently!
Note: Your primary concern when you introduce a new
version of a universe should be what effect it will
have on existing end user reports
49 August 01, 2000
No Impact:

Adding new columns
Adding new tables
Severe Impact:

Renaming/moving database
Changing existing column
and table names
Deleting tables and columns
Changes to the Target Database
The implications of modifying the underlying
database for BusinessObjects universes varies in
severity:
50 August 01, 2000
Le Designer doit tre une personne matrisant parfaitement le Systme d Information sur
lequel repose l univers. Toute modification sur ce systme peut videmment avoir des
consquences sur l univers.
Detecting Changes to the Universe
Choose View, Refresh Structure
Changed tables are highlighted
in the Structure
A message on the screen
indicates that tables have been
deleted
51 August 01, 2000
No Impact:

Redefining Object SQL
Renaming an Object
Copying to different Class
Moving in same Class or to
a different Class
Adding new Objects
Impact:

Deleting an existing
Object
Deleting and then
recreating an object with
exactly the same
definition
The Effect of Changing Objects
Changes to existing Objects in a Universe can have
an impact on existing Documents created from the
Universe:
52 August 01, 2000
The workflow is:
Adding New Tables to an Existing Universe
Add tables to the universe structure
Delete existing contexts
Detect aliases
Detect contexts
Create new objects
Set up hierarchies
Insert joins and set cardinalities
53 August 01, 2000
Making Maintenance More Efficient
Maintenance can be made easier by:
Copying and pasting objects between universes
Linking universes
Embedding the structure, classes and objects from one
universe to another
Including universes
Copying the structure, classes and objects from one universe
to another
54 August 01, 2000


You can
copy objects
from one
universe to
another
Copying and Pasting Objects
Both
universes
must have
the same
connection
55 August 01, 2000
Linking Universes
Linking can mean reduced maintenance but there are
limitations
Universe A
Universe A
Universe B
56 August 01, 2000
Two Approaches to Linking
Kernel approach



Master approach
57 August 01, 2000
L approche Composant est une approche Noyaux multiples .
Kernel Approach
Human Resources
+
Motors2000
+
Kernel
Kernel
Kernel
Staff
58 August 01, 2000
Master Approach
Master
Human Resources
Motors2000
HR
and
Motors2000
-
-
Master
Master
59 August 01, 2000
Click and click on the Links tab
Making a Link
Click Add Link...
Choose universe to
link and click Open
60 August 01, 2000
The Derived Universe
The linked universe structure and objects cannot be edited in the
derived universe
The linked universe should be treated as though they were new
tables inserted in the derived universe. The same procedure
should be applied
61 August 01, 2000
Including Universes
Universe A
Universe B
Everything
from
Universe A
Universe B
Universe A
Including a Universe COPIES structure and objects to
the derived universe:
62 August 01, 2000
Included Universes
Included universes become part of the new universe
Module 15
Aggregate Awareness
August 01, 2000 Tata Infotech Limited
64 August 01, 2000
What You Will Be Able To Do
Understand the reasons for using Aggregate
Awareness
Know when to apply Aggregate Awareness
Be able to apply Aggregate Awareness
65 August 01, 2000
What is Aggregate Awareness
Some databases have Summary Tables which contain
figures aggregated to a high level.
These are used to speed up queries which contain
statistics (for example, Revenue) reported at, for
instance, year rather than event level.
Aggregate Awareness is the BusinessObjects
process by which these higher level aggregates are
incorporated into a universe.
66 August 01, 2000
Summary Tables
Check the columns in the Summary Table:
The other columns relate
to objects that require
@AggregateAware
definitions
Foreign Key columns
are used for the joins
Note that Summary Tables without Foreign Keys do
not need joins - they can be free floating tables.
67 August 01, 2000
How Summary Tables are used in SQL
Aggregates of a normalized database are based on event / fact level
data.
Sale
226 rows
Sale_Model
233 rows
Model
33 rows
Sales Revenue = sum(SALE_MODEL.SALE_QTY * MODEL.MODEL_PRICE *
((100 - SALE.SALE_SALE_DISCOUNT) / 100))
Summary tables may be added to a database which hold data at a
higher level of aggregate.
Annual_Figures
26 rows
Sales Revenue = sum(ANNUAL_FIGURES.ANNUAL_SALE_VALUE)
Making use of summary table data speeds up response times.
68 August 01, 2000
Procedure for Applying Aggregate Awareness
1 Insert the Summary Table(s) in the universe
structure; set joins and cardinality
2 Set the contexts
3 Redefine objects using @AggregateAware
4 Define incompatible objects using Aggregate
Navigation
69 August 01, 2000
Step 1: Inserting a Summary Table & Setting Joins
Add the Summary Table to the structure
Set the joins and the
cardinality
70 August 01, 2000
Set the contexts
Step 2: Detecting Contexts
The Annual_Figures
context
71 August 01, 2000
Step 3: Redefining Objects
Edit the objects affected by the Summary Table.
@AggregateAware Syntax:
@AggregateAware(Definition1,Definition2,,DefinitionN)

From the most to the least Aggregated
The last definition must be valid for all the queries
72 August 01, 2000
Step 4: Incompatible Objects
Aggregate aware objects can only be compatible with objects derived
from tables in the same context as the summary table
Incompatible objects are specified using Aggregate Navigation
73 August 01, 2000
Step 4: Aggregate Navigation
The Aggregate Navigation box is opened from the
Tools menu
Click Detect
Incompatibility:
Select the Summary
Table:
Incompatible objects
are checked:
You must check carefully
- not all incompatible
objects may be detected
automatically.

Individual objects are
checked to define them
as incompatible:

74 August 01, 2000
Testing Aggregate Awareness
As with any universe element, you must always test
the results in the User module.
Run queries using the aggregated measures from the
Summary Table.
Use both compatible objects and incompatible
objects in different queries to make sure all levels of
Aggregate Awareness are operating correctly.
Module 16
Contexts Revisited
August 01, 2000 Tata Infotech Limited
76 August 01, 2000
What You Will Be Able To Do
Understand the purpose of using contexts in a
universe
Recognize and be able to resolve Chasm Traps
Recognize and be able to resolve Fan Traps
77 August 01, 2000
What Contexts are Used for
A context is simply a list of joins denoting a path
between tables.
Contexts are set to identify alternative routes in the
universe structure.
BusinessObjects detects a context for each
alternative route.
Contexts identify tables which are incompatible within
the same SELECT statement - because the wrong
results will be produced.
78 August 01, 2000
How Contexts are Detected
BusinessObjects Designer identifies tables which
have only the many end of joins attached:
79 August 01, 2000
How Contexts are Detected (2)
You can arrange your universe structure so that all joins are flowing
from the many ends at the left to the one ends at the right.
80 August 01, 2000
How Contexts are Detected (3)
The forward flowing joins form the Sale context
No joins flowing
back from one to
many are included
81 August 01, 2000
Identifying Key Problems
There are two key problems you may encounter which
can be resolved using contexts:

Chasm Traps

Fan Traps
82 August 01, 2000
Chasm Traps
For a Chasm Trap to occur, there must be:
a query with objects from
each of the many tables
many to one to many
Multiple instances of a
single dimension in results
83 August 01, 2000
Chasm Traps - What Happens


84 August 01, 2000
Chasm Traps - What Happens (2)
Note: Rental Revenue has doubled and Sale Revenue
has trebled !

85 August 01, 2000
Chasm Trap Query - the SQL
The SQL for the last query is:
The problem arises because of the logical table
formed as a result of the Cartesian product of the
Client, Sale, and Rental tables.
86 August 01, 2000
Chasm Trap - the Rows Returned
We can look at the individual Sale transactions by
adding the Sale Date to the query:
Similarly, we can look at the individual Rental
transactions by adding the Rental Date to that query:
87 August 01, 2000
Chasm Trap - the Rows Returned
We can see the problem when we look at the rows
returned from the combined query:
The query returns every possible combination of Sale
and Rental rows.
88 August 01, 2000
Chasm Traps - the Solution
To resolve the Chasm Trap, we need the SQL to make
two separate queries and then combine the results.
There are two possible methods of achieving this:

1 Altering the SQL parameters for the Universe

2 Using Contexts
The first method is only a partial solution. The second
method works every time.
89 August 01, 2000
Altering the Universe SQL Parameters
Click
Check
Click
The Chasm Trap query will now make one query for
each measure and combine the results - correctly.
90 August 01, 2000
SQL Parameter Method - the Drawback
The parameter specifies:
Multiple SQL statements for each measure
It does not separate queries containing only
dimension objects.
For example:
The report contains a single block with the results
displayed as a Cartesian product - unclear for Users.
91 August 01, 2000
Recommended Solution - Use Contexts
Apply a context to each leg of the Chasm Trap:
92 August 01, 2000
Recommended Solution - Use Contexts (2)
With the contexts in place, both measure object
queries and dimension object queries display
correctly:
Conclusion:
Always use contexts to resolve Chasm Traps
93 August 01, 2000
Fan Traps
For a Fan Trap to occur, there must be a one to many to many
relationship in the structure:
The fan trap occurs when a client has many rental transactions
(Rental.Sale_Id) each with a total value, but each of these
transactions includes many quantities of different models.
94 August 01, 2000
Fan Traps - What Happens
A query for the Total Rental Value for a client will give
the correct result:
However, if you also wanted to see the quantities of
each model the client has rented, you might get an
incorrect result:
The Total Rental Value has trebled !
95 August 01, 2000
Fan Traps - the Problem
Client Name Rental Value Model Id Rental Qty
Foulkes, Bill 1,640.00 1043 3
Foulkes, Bill 1,640.00 1055 2
Foulkes, Bill 1,640.00 1072 2
4,920.00 7
The query returns every possible combination of
Rental_Value and Rental_Qty rows:
The Rental_Value trebles because there are three
different Model_Id rows that each join with the same
Total_Rental_Value row.
96 August 01, 2000
Fan Traps - the Solution
Context or alternatively, an Alias:
The aggregation that
causes the problem is
the object derived from
Rental.Sale_Total
This solution provides an alternative table that can be
used for this aggregation: Rental2.Sale_Total
Join the Alias to the
original table using a
one to one join
97 August 01, 2000
Fan Traps - the Solution (2)
The Fan Trap problem occurs only when you derive
the Rental Value from the Rental table AND the query
includes objects from the Rental_Model table.
Use @AggregateAware to redefine the Rental Value
object:
@AggregateAware(sum(Rental.Sale_Total)
sum(Rental2.Sale_Total))
Use Aggregate Navigation to define ALL objects
derived from the Rental_Model table as incompatible
with the Rental table.
98 August 01, 2000
Fan Traps - the Solution (3)
As with Chasm Traps, the Fan Trap problem can also
be partially resolved by setting the SQL parameter:
Multiple SQL statements for each measure.
The drawback is the same: The solution only works
with Measure objects.
Conclusion:
Identify Fan Traps from the context flow, then resolve
them using Alias tables and Aggregate Awareness.

Anda mungkin juga menyukai