Contexts are a collection of joins which provide a valid query path for SAP BO - Web Intelligence to generate SQL.
You use contexts to resolve join problems that can return too many or too few rows because of the way that tables are linked in the target database.
You need to verify that cardinalitiy are correctly set for all joins in your schema to ensure that you have the correct contexts, and that you have valid join paths.
Setting cardinalitiy can also help you understand how tables are related in the database, and to graphically identify potential join path problems in your schema.
The most common use of contexts is to separate two query paths, so that one query returns data for one fact table, and the other query returns data for another fact table. You use contexts to direct join paths in a schema which contains multiple fact tables. Alias are not appropriate in such schema.
You often use context in schema that contain multiple fact tables (“multiple stars”) that share lookup tables.
Contexts are also used to solve potential BOBJ - Chasm Traps (converging many to one joins). These can occur when two many-to-one join paths converge on a single table. Multiple rows can be returned for a single dimension causing inflated results. Contexts can split out the query so that the correct number of rows are returned for the dimension. Contexts can also be used with BOBJ - Alias to solve BOBJ - Fan Trap (serial many to one joins).
You can use contexts to exclude objects that are not compatible with an object using the @AggregateAware function in its definition, from being used in a query with the aggregate aware object.
Tools > Automated Detection >Detect Contexts
Detect Contexts examines the many to one joins in the schema. It picks up the table that receives converging many to one joins and proposes contexts to separate the queries run on the table.
Click a context and click the Rename button.
A one-to one-cardinality positioned at the end of a join path can prevent Context Detection in Designer from detecting a context. You resolve this problem by changing the cardinality of the table at the end of the join path to one-to-many.
Objects from two different contexts are combined in a query. The two Select statements are synchronized to display returned data in separate tables.
To allow incompatible queries to be run in Web Intelligence, you must select the Multiple SQL statements in Designer for each context option.