at the rate funtion s

98
Module 10 Using @ Functions August 01, 2000 Tata Infotech Limited

Upload: amanblr12

Post on 21-Jul-2016

8 views

Category:

Documents


4 download

DESCRIPTION

@rate funtion

TRANSCRIPT

Page 1: At the Rate Funtion s

Module 10Using @ Functions

August 01, 2000 Tata Infotech Limited

Page 2: At the Rate Funtion s

2 August 01, 2000

What You Will Be Able To Doh Know what @ Functions are available

Note: @AggregateAware is covered later in the course

h Be able to apply them

h Know what @ Functions do

Page 3: At the Rate Funtion s

3 August 01, 2000

The @ Functionsh The @ Functions available are:

h These Functions are applied in the Select and Where boxes of objects

h They are used to provide flexible methods of specifying SQL

Page 4: At the Rate Funtion s

4 August 01, 2000

@Promptn @Prompt is placed in an object as part of the Select or Where

properties

n When a query is run that includes the object, the @prompt of the object forces a prompt box to appear

Page 5: At the Rate Funtion s

5 August 01, 2000

@Prompt SyntaxSHOWROOM.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

Page 6: At the Rate Funtion s

6 August 01, 2000

@Selectn @Select function acts as a pointer to the Select box of another object:

@Select (Class_Name\Object_Name)

n Creates a dynamic link between objects, so that update of the original object Select statement automatically updates the other objects

Page 7: At the Rate Funtion s

7 August 01, 2000

@Wheren The @Where function acts as a pointer to the Where box of another object

n Creates a dynamic link between objects, so that update of the original object Where clause automatically updates the other objects or condition objects

Page 8: At the Rate Funtion s

8 August 01, 2000

@Where - Designer Strategyn 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 don’t see the base objects.

Page 9: At the Rate Funtion s

9 August 01, 2000

@Variable - with Personal Filesh 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

Page 10: At the Rate Funtion s

10 August 01, 2000

@Variable - with Personal Files: Drawbacks

h Requires localized administration of the text file by the Designer / Supervisor

h The command string must be changed on every User ’s PC to include the -vars <textfile.txt> argument

h Security can be a problem, as a text file on a PC is open to local amendment

h Conclusion: Better to use the options in the Supervisor module

Page 11: At the Rate Funtion s

11 August 01, 2000

@Variable - with BusinessObjects Variables

h 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 User’s login name

Page 12: At the Rate Funtion s

12 August 01, 2000

@Scripth Allows use of a variable declared in a VBA script

h The script ‘ smotors ’ runs the country selection process

Page 13: At the Rate Funtion s

Module 11Lists of Values

August 01, 2000 Tata Infotech Limited

Page 14: At the Rate Funtion s

14 August 01, 2000

What You Will Be Able To Do

h Base a LoV on a personal file

h Associate or remove a List of Values (LoV) for an object

h Control how LoVs are refreshed

h Modify a LoV using a condition

h Modify a LoV by creating a hierarchy

Page 15: At the Rate Funtion s

15 August 01, 2000

What is a List of Values?

h A LoV is used on the operand side of a condition in the query panel of the User module

h This is only available if set by the designer

h A list of the distinct values from the column or columns to which the object refers

Page 16: At the Rate Funtion s

16 August 01, 2000

How do Lists of Values work?h A designer can create a LoV which is based on:

h A query of the target database

h A constant set of values held in a file

h In both cases, the result is stored locally in a file on the User ’s PC.

Page 17: At the Rate Funtion s

17 August 01, 2000

Creating a List of Valuesh A LoV is created within the Properties tab of an object

h By default, Associate a List and Allow Users to edit are checked:

h It is important to uncheck this box for objects that don’t need a List

Page 18: At the Rate Funtion s

18 August 01, 2000

Controlling How Lists are Refreshedh Normally, the first time a LoV is used in a User login

session, the system fires a query at the target database.

h The results of this query are used to populate the list, and are stored in the .lov file.

h Thereafter, the .lov file from this query is used each time the List is required.

Page 19: At the Rate Funtion s

19 August 01, 2000

Controlling How Lists are Refreshed

h Not normally used - uncheck this box

h Check this box for frequently changing lists

h Check this box for lists that never change

Page 20: At the Rate Funtion s

20 August 01, 2000

Modifying the Content of a List of Valuesh You can limit the values returned by applying a

condition to the LoV

h You can simplify the process of choosing a value for Users by creating a hierarchy for the LoV

h You can supply a personal data file containing the values for the list, instead of using the results of the query

Page 21: At the Rate Funtion s

21 August 01, 2000

Applying a Condition to a List of Valuesh Click Edit in the Properties box:

h Apply the condition in the Query Panel:

Page 22: At the Rate Funtion s

22 August 01, 2000

Creating a Hierarchy for a List of Valuesh Click Edit in the Properties box:h Place the hierarchy objects (which

must be sorted) to the right of the LoV object in the Query Panel:

Page 23: At the Rate Funtion s

23 August 01, 2000

Creating a Hierarchy for a List of Valuesh The resulting Hierarchical View of the LoV makes it

easier to select the required value:

h Country:h Town:h Showroom:

Page 24: At the Rate Funtion s

24 August 01, 2000

Basing a LoV on a Personal Fileh Select Tools, Lists of Values from the Menu bar:

h Select the object:

h Select Personal Data:

Page 25: At the Rate Funtion s

25 August 01, 2000

Basing a LoV on a Personal Fileh Click OK to acknowledge the message:

h Specify the file that contains the values for the list and click OK

Page 26: At the Rate Funtion s

Module 12Hierarchies

August 01, 2000 Tata Infotech Limited

Page 27: At the Rate Funtion s

27 August 01, 2000

What You Will Be Able To Do

h Test hierarchies in the User module

h Organize Default Hierarchies for optimum usability

h Create Time Dimension objects and Hierarchies

h Create Custom Hierarchies

Page 28: At the Rate Funtion s

28 August 01, 2000

U.K.

North South

Liverpool Manchester Newcastle London Southampton Bristol

Level in Hierarchy Data Returned

What Is a Hierarchy?

Page 29: At the Rate Funtion s

29 August 01, 2000

h A Default Hierarchy is the hierarchy based on the order of the Objects within the Class

Default Hierarchies arerepresented in the User module by the order in whichDimension Objects are organized in the Classes and Objects box of the Query Panel

What Is a Default Hierarchy?

Page 30: At the Rate Funtion s

30 August 01, 2000

The Key to Creating Default Hierarchiesh The designer must ensure, wherever possible, that

Dimension Objects are organized from the most general to the most specific within the Class

Page 31: At the Rate Funtion s

31 August 01, 2000

h Dimension Objects represent the levels in a hierarchy:

Top Level

Level 1

Level 2

Level 3

How are Hierarchies used in Analysis?

h A Measure can be analysed at each level

Page 32: At the Rate Funtion s

32 August 01, 2000

Sale Date25/11/99

Month Year

Quarter

Why Is Time A Special Case?

Day

Page 33: At the Rate Funtion s

33 August 01, 2000

h Automatic Time Hierarchies

h Using Database Functions

h Table Based Time Hierarchies

Creating Time Hierarchies

Page 34: At the Rate Funtion s

34 August 01, 2000

h A Custom Hierarchy combines Objects from Default Hierarchies to build a Custom Analysis Path

What Is A Custom Hierarchy?

Default Hierarchies

Custom Hierarchy

Page 35: At the Rate Funtion s

35 August 01, 2000

Creating Custom Hierarchies

h Add Objects from Default Hierarchies to build a new Custom Hierarchy

(or Tools, Hierarchies)

Page 36: At the Rate Funtion s

36 August 01, 2000

The Effect of Custom on Default Hierarchies

h User module Scope of Analysis after a Custom Hierarchy has been created:

h No Default Hierarchies are shown

Page 37: At the Rate Funtion s

37 August 01, 2000

The Effect of Custom on Default Hierarchies

h Selected Default Hierarchies can be added to the Custom Hierarchies in Designer module

Page 38: At the Rate Funtion s

Module 13Documenting and Distributing a Universe

August 01, 2000 Tata Infotech Limited

Page 39: At the Rate Funtion s

39 August 01, 2000

What You Will Be Able To Doh Print information about the universe

h Print the universe schema

h Know the advantages and disadvantages of the two different ways that universes are distributed to end users

h Distribute a universe in Workgroup mode

h Distribute a universe in Enterprise mode

Page 40: At the Rate Funtion s

40 August 01, 2000

h Select the Tools, Options menu then click on the Print tab to select what to print

h Select the File, Print menu to print

Faire un aperçu avant impression pour montrer.Rappel : il n ’est pas possible d ’exporter le résultat de l ’impression sous un format texte ou autre pour le retravailler. C ’est une documentation technique et NON PAS UTILISATEUR.Documenting a Universe

Page 41: At the Rate Funtion s

41 August 01, 2000

h Different phases require different types of universe distribution

Phase 3

Phase 5

Phase 4

Phase 6

Phase 7

Phase 1-2

Universe Design Cycle

Page 42: At the Rate Funtion s

42 August 01, 2000

h There are two methods distributing universes

Business ObjectsRepository

File System

Distributing Universes

Page 43: At the Rate Funtion s

43 August 01, 2000

File server

S:\Designer

S:\Test

Access controlledBy network security

Workgroup Mode

Business ObjectsUniverse

Motors2k.unv (Shared Connection)

Page 44: At the Rate Funtion s

44 August 01, 2000

Enterprise Mode

Business Objectsrepository

Export

Supervisor in control

User based securityallocated to user groups

Revision number checked when used

(Secured Connection)

Business ObjectsUniverse

Motors2k.unv

Motors2k.unv

Universe Domain Name

Business Objects

Universe

Revision number incremented

Motors2k.unv

Universe Domain Name

Page 45: At the Rate Funtion s

45 August 01, 2000

h 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

h 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 DomainDocument DomainSecurity Domain

Page 46: At the Rate Funtion s

Module 14Universe Maintenance

August 01, 2000 Tata Infotech Limited

Page 47: At the Rate Funtion s

47 August 01, 2000

What You Will Be Able To Doh Know when a new version of a universe may be

requiredh Be able to identify changes to the target database of a

universeh Know how version changes will affect existing end

user reportsh Be able to copy and past objects between universesh Be able to link universes and appreciate the different

strategies requiredh Be able to include universes

Page 48: At the Rate Funtion s

48 August 01, 2000

Reasons for Universe Maintenance

h New tables added to databaseh Tables deleted, changed or renamed in databaseh 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

Page 49: At the Rate Funtion s

49 August 01, 2000

No Impact:

h Adding new columnsh Adding new tables

Severe Impact:

h Renaming/moving databaseh Changing existing column

and table namesh Deleting tables and columns

Changes to the Target Database

h The implications of modifying the underlying database for BusinessObjects universes varies in severity:

Page 50: At the Rate Funtion s

50 August 01, 2000

Le Designer doit être une personne maîtrisant parfaitement le Système d ’Information sur lequel repose l ’univers. Toute modification sur ce système peut évidemment avoir des conséquences sur l ’univers.Detecting Changes to the Universe

h Choose View, Refresh Structureh Changed tables are highlighted

in the Structureh A message on the screen

indicates that tables have been deleted

Page 51: At the Rate Funtion s

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 Objectsh Changes to existing Objects in a Universe can have

an impact on existing Documents created from the Universe:

Page 52: At the Rate Funtion s

52 August 01, 2000

h 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

Page 53: At the Rate Funtion s

53 August 01, 2000

Making Maintenance More Efficient

Maintenance can be made easier by:h Copying and pasting objects between universesh Linking universes

i Embedding the structure, classes and objects from one universe to another

h Including universesi Copying the structure, classes and objects from one

universe to another

Page 54: At the Rate Funtion s

54 August 01, 2000

h You can copy objects from one universe to another

Copying and Pasting Objects

h Both universes must have the same connection

Page 55: At the Rate Funtion s

55 August 01, 2000

Linking Universesh Linking can mean reduced maintenance but there are

limitations

Universe A

Universe A

Universe B

Page 56: At the Rate Funtion s

56 August 01, 2000

Two Approaches to Linking

h Kernel approach

h Master approach

Page 57: At the Rate Funtion s

57 August 01, 2000

L ’approche Composant est une approche « Noyaux multiples ».

Kernel Approach

Human Resources

+

Motors2000

+

Kernel

Kernel

KernelStaff

Page 58: At the Rate Funtion s

58 August 01, 2000

Master Approach

MasterHuman Resources

Motors2000HRand

Motors2000

-

-Master

Master

Page 59: At the Rate Funtion s

59 August 01, 2000

h Click and click on the Links tab

Making a Link

h Click Add Link...

h Choose universe to link and click Open

Page 60: At the Rate Funtion s

60 August 01, 2000

The Derived Universe

h The linked universe structure and objects cannot be edited in the derived universe

h The linked universe should be treated as though they were new tables inserted in the derived universe. The same procedure should be applied

Page 61: At the Rate Funtion s

61 August 01, 2000

Including Universes

Universe A

Universe B

Everything from

Universe A

Universe B

Universe A

h Including a Universe COPIES structure and objects to the derived universe:

Page 62: At the Rate Funtion s

62 August 01, 2000

Included Universesh Included universes become part of the new universe

Page 63: At the Rate Funtion s

Module 15Aggregate Awareness

August 01, 2000 Tata Infotech Limited

Page 64: At the Rate Funtion s

64 August 01, 2000

What You Will Be Able To Do

h Understand the reasons for using Aggregate Awareness

h Know when to apply Aggregate Awareness

h Be able to apply Aggregate Awareness

Page 65: At the Rate Funtion s

65 August 01, 2000

What is Aggregate Awarenessh Some databases have Summary Tables which contain

figures aggregated to a high level.

h These are used to speed up queries which contain statistics (for example, Revenue) reported at, for instance, year rather than event level.

h Aggregate Awareness is the BusinessObjects process by which these higher level aggregates are incorporated into a universe.

Page 66: At the Rate Funtion s

66 August 01, 2000

Summary Tablesh Check the columns in the Summary Table:

h The other columns relate to objects that require @AggregateAware definitions

h Foreign Key columns are used for the joins

h Note that Summary Tables without Foreign Keys do not need joins - they can be free floating tables.

Page 67: At the Rate Funtion s

67 August 01, 2000

How Summary Tables are used in SQLn 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))

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

n Making use of summary table data speeds up response times.

Page 68: At the Rate Funtion s

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

Page 69: At the Rate Funtion s

69 August 01, 2000

Step 1: Inserting a Summary Table & Setting Joins

h Add the Summary Table to the structureh Set the joins and the

cardinality

Page 70: At the Rate Funtion s

70 August 01, 2000

h Set the contexts

Step 2: Detecting Contexts

h The Annual_Figures context

Page 71: At the Rate Funtion s

71 August 01, 2000

Step 3: Redefining Objectsh Edit the objects affected by the Summary Table.

h @AggregateAware Syntax:i @AggregateAware(Definition1,Definition2,…,DefinitionN)

From the most to the least Aggregatedi The last definition must be valid for all the queries

Page 72: At the Rate Funtion s

72 August 01, 2000

Step 4: Incompatible Objectsn Aggregate aware objects can only be compatible with objects derived

from tables in the same context as the summary table

n Incompatible objects are specified using Aggregate Navigation

Page 73: At the Rate Funtion s

73 August 01, 2000

Step 4: Aggregate Navigationh The Aggregate Navigation box is opened from the

Tools menu

h Click Detect Incompatibility:

h Select the Summary Table:

h Incompatible objects are checked:

h You must check carefully - not all incompatible objects may be detected automatically.

h Individual objects are checked to define them as incompatible:

Page 74: At the Rate Funtion s

74 August 01, 2000

Testing Aggregate Awarenessh As with any universe element, you must always test

the results in the User module.

h Run queries using the aggregated measures from the Summary Table.

h Use both compatible objects and incompatible objects in different queries to make sure all levels of Aggregate Awareness are operating correctly.

Page 75: At the Rate Funtion s

Module 16Contexts Revisited

August 01, 2000 Tata Infotech Limited

Page 76: At the Rate Funtion s

76 August 01, 2000

What You Will Be Able To Do

h Understand the purpose of using contexts in a universe

h Recognize and be able to resolve Chasm Traps

h Recognize and be able to resolve Fan Traps

Page 77: At the Rate Funtion s

77 August 01, 2000

What Contexts are Used forh A context is simply a list of joins denoting a path

between tables.

h Contexts are set to identify alternative routes in the universe structure.

h BusinessObjects detects a context for each alternative route.

h Contexts identify tables which are incompatible within the same SELECT statement - because the wrong results will be produced.

Page 78: At the Rate Funtion s

78 August 01, 2000

How Contexts are Detectedh BusinessObjects Designer identifies tables which

have only the ‘many’ end of joins attached:

Page 79: At the Rate Funtion s

79 August 01, 2000

How Contexts are Detected (2)n 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.

Page 80: At the Rate Funtion s

80 August 01, 2000

How Contexts are Detected (3)h The forward flowing joins form the Sale contexth No joins flowing

back from one to many are included

Page 81: At the Rate Funtion s

81 August 01, 2000

Identifying Key Problemsh There are two key problems you may encounter

which can be resolved using contexts:

h Chasm Traps

h Fan Traps

Page 82: At the Rate Funtion s

82 August 01, 2000

Chasm Trapsh For a Chasm Trap to occur, there must be:

h a query with objects from each of the ‘many’ tables

h ‘many to one to many’ h Multiple instances of a single dimension in results

Page 83: At the Rate Funtion s

83 August 01, 2000

Chasm Traps - What Happens

Page 84: At the Rate Funtion s

84 August 01, 2000

Chasm Traps - What Happens (2)

h Note: Rental Revenue has doubled and Sale Revenue has trebled !

Page 85: At the Rate Funtion s

85 August 01, 2000

Chasm Trap Query - the SQLh The SQL for the last query is:

h The problem arises because of the logical table formed as a result of the Cartesian product of the Client, Sale, and Rental tables.

Page 86: At the Rate Funtion s

86 August 01, 2000

Chasm Trap - the Rows Returnedh We can look at the individual Sale transactions by

adding the Sale Date to the query:

h Similarly, we can look at the individual Rental transactions by adding the Rental Date to that query:

Page 87: At the Rate Funtion s

87 August 01, 2000

Chasm Trap - the Rows Returnedh We can see the problem when we look at the rows

returned from the combined query:

h The query returns every possible combination of Sale and Rental rows.

Page 88: At the Rate Funtion s

88 August 01, 2000

Chasm Traps - the Solutionh To resolve the Chasm Trap, we need the SQL to make

two separate queries and then combine the results.

h There are two possible methods of achieving this:

1 Altering the SQL parameters for the Universe

2 Using Contexts

h The first method is only a partial solution. The second method works every time.

Page 89: At the Rate Funtion s

89 August 01, 2000

Altering the Universe SQL Parametersh Click

h Check

h Click

h The Chasm Trap query will now make one query for each measure and combine the results - correctly.

Page 90: At the Rate Funtion s

90 August 01, 2000

SQL Parameter Method - the Drawbackh The parameter specifies:

‘Multiple SQL statements for each measure’

h It does not separate queries containing only dimension objects.

h For example:

h The report contains a single block with the results displayed as a Cartesian product - unclear for Users.

Page 91: At the Rate Funtion s

91 August 01, 2000

Recommended Solution - Use Contextsh Apply a context to each leg of the Chasm Trap:

Page 92: At the Rate Funtion s

92 August 01, 2000

Recommended Solution - Use Contexts (2)

h With the contexts in place, both measure object queries and dimension object queries display correctly:

h Conclusion: Always use contexts to resolve Chasm Traps

Page 93: At the Rate Funtion s

93 August 01, 2000

Fan Trapsn For a Fan Trap to occur, there must be a ‘one to many to many’

relationship in the structure:

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

Page 94: At the Rate Funtion s

94 August 01, 2000

Fan Traps - What Happensh A query for the Total Rental Value for a client will give

the correct result:

h However, if you also wanted to see the quantities of each model the client has rented, you might get an incorrect result:

h The Total Rental Value has trebled !

Page 95: At the Rate Funtion s

95 August 01, 2000

Fan Traps - the Problem

Client Name Rental Value Model Id Rental QtyFoulkes, Bill 1,640.00 1043 3Foulkes, Bill 1,640.00 1055 2Foulkes, Bill 1,640.00 1072 2

4,920.00 7

h The query returns every possible combination of Rental_Value and Rental_Qty rows:

h The Rental_Value trebles because there are three different Model_Id rows that each join with the same Total_Rental_Value row.

Page 96: At the Rate Funtion s

96 August 01, 2000

Fan Traps - the Solutionh Context or alternatively, an Alias:

h The aggregation that causes the problem is the object derived from Rental.Sale_Total

h This solution provides an alternative table that can be used for this aggregation: Rental2.Sale_Total

h Join the Alias to the original table using a ‘one to one’ join

Page 97: At the Rate Funtion s

97 August 01, 2000

Fan Traps - the Solution (2)h 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.

h Use @AggregateAware to redefine the Rental Value object:

i @AggregateAware(sum(Rental.Sale_Total) sum(Rental2.Sale_Total))

h Use Aggregate Navigation to define ALL objects derived from the Rental_Model table as incompatible with the Rental table.

Page 98: At the Rate Funtion s

98 August 01, 2000

Fan Traps - the Solution (3)h As with Chasm Traps, the Fan Trap problem can also

be partially resolved by setting the SQL parameter: ‘Multiple SQL statements for each measure’.

h The drawback is the same: The solution only works with Measure objects.

h Conclusion:Identify Fan Traps from the context flow, then resolve them using Alias tables and Aggregate Awareness.