Académique Documents
Professionnel Documents
Culture Documents
Understand the purpose of using contexts in a universe Recognize and be able to resolve Chasm Traps
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 on which there is a table with just the many end of joins attached to it. Contexts identify joins (and therefore tables) which are compatible within the same SELECT statement
Alternative Routes
Loop
2 Routes = 2 Contexts
Context 2
Context 1
Fork
2 Routes = 2 Contexts
Context 2
A separate context is identified for each table with only the many end of joins attached:
The joins in a context are identified by working back from the table with only the many end of joins attached - many-one, many-one.
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.
The chasm trap is resolved by executing a separate SELECT statement for object Y and object Z.
9 Copyright 2004 Business Objects SA - All Rights Reserved
Step 1
Step 3
Deny Multiple SQL Statements for each measure
Test 2
Test 3
The problem on test 3 arises because the processing of a single SELECT statement produces a single virtual logical table to Test 2 apply aggregation.
Test 3
Where you have a many-one-many relationship for tables in the FROM clause the resulting logical table produces something akin to a Cartesian Product. Only then is aggregation applied. This is the reason for the chasm effect.
13 Copyright 2004 Business Objects SA - All Rights Reserved
By inferring two separate SELECT statements and only then combining the results of each one into microcube(s) for projection into block(s).
To infer two separate SELECT statements from a single BusinessObjects query you can either:1 Alter the SQL parameters for the Universe 2 Use Contexts
The first method is NOT recommended as it only works with measures and will result in certain inefficiencies in processing. The second method works every time and will not result in inefficiencies.
Click
Click
Check
The Chasm Trap query will now make one query for each measure and combine the results - correctly.
The report contains a single block with the results displayed as a Cartesian product - unclear for Users.
2) IN-EFFICIENT The parameter will force a SELECT statement for each measure, even when it is NOT necessary to do so!
17 Copyright 2004 Business Objects SA - All Rights Reserved
With the contexts in place, both measure object queries and dimension object queries display correctly:
Measures
Dimensions
Like the chasm trap, the fan trap can be resolved by executing a separate SELECT statement for object Y and object Z. The alternative solution is to avoid it in the first place!
20 Copyright 2004 Business Objects SA - All Rights Reserved
Step 1
Test 2
Test 2
The problem on test 2 arises because the processing of a single SELECT statement produces a single virtual logical table to apply aggregation.
23 Copyright 2004 Business Objects SA - All Rights Reserved
Where you have a one-many-many relationship for tables in the FROM clause the resulting logical table produces something akin to a Cartesian Product. Only then is aggregation applied. This is the reason for the fan effect.
24 Copyright 2004 Business Objects SA - All Rights Reserved
How can we avoid the fan trap? By inferring two separate SELECT statements and only then combining the results of each one into microcube(s) for projection into block(s). By avoiding the fan trap scenario in the first place!
To infer two separate SELECT statements from a single BusinessObjects query you can either:1 Alter the SQL parameters for the Universe 2 Use a combination of Aliases and Contexts
NOTE: The first method is NOT recommended as it only works with measures and will result in certain inefficiencies in processing. The second method works every time and will not result in inefficiencies.
To avoid placing a measure on anything other than the last table in a table path (i.e. the table with only many cardinality attached to it).
Click
Click
Check
The Fan Trap query will now make one query for each measure and combine the results - correctly.
Ba
3) Set Contexts C and Ba. 4) Change the SELECT clause of object Y so that it refers to the alias Ba rather then table B.
4) Change the SELECT clause of the Sale Revenue object so that it refers to the Sale alias rather than the Sale table.
30 Copyright 2004 Business Objects SA - All Rights Reserved
Now a query involving a measure and another object from a subsequent table in the table path of a universe structure. .results in 2 SELECT statements..
.which are then merged in a single microcube to produce the correct result.
1) This is only possible where the measure on table B is a preaggregation of more detailed data which exists in table C. 2) Code measure object Y so that it refers to the more detailed data in table C. NOTE : This will be less efficient but at least it is accurate.
Questions ?