Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alias Vs Context 2

Status
Not open for further replies.

funkmonsteruk

IS-IT--Management
Feb 8, 2002
210
GB
I'm currently in the process of building a new universe based on a db2 database and have found several loops. I've gotten around this by creating aliases of the looped tables, which seems to work ok.

However, a colleague has told me that i should try incorporating contaext in a loop situation. I've not come across context before so have a few questions which i'm hoping somebody may be able to answer.

1) What is a context
2) How do i add one
3) are there any benefits to be had in using context rather than incorporating an alias.

Any answers to any of these questions or indeed advice as to where to find a good source on this subject will be greatly appreciated...

 
I have used contexts and was not very happy with them. Either they are clumbsey or I was not doing it right.

A context allows reuse of a major area of a Universe with different Joins, an alias allow re use of a single table with different joins

A context almost always adds a layer of complexity for the user, and should be a 'last resort' method of design

I tried to remain child-like, all I acheived was childish.
 
jimbopalmer,

I hate to be disagreeable, but I couldn't disagree more with your comment about contexts.

If correctly implemented, contexts remove a layer of complexity from the users. In my opinion they should be used whenever they are needed.

The purpose of contexts is to resolve loops as they relate to fact tables. Each context should be a standalone subject in itself and contain both dimension tables and a fact table.

Contexts allow you to reuse objects. If you didn't have context, you'd have duplicate dimensions for everything. For example, if you had Sales and Orders in the same universe, you'd have to have Product Sold and Product Ordered. With contexts, you'd have 1 Product dimension.

I have some papers on contexts that I'd be happy to forward along.

The reality of it is that contexts and aliases are not interchangeable. You use contexts when you have fact tables causing the problem. You use aliases when you have dimensions causing the problem.

Steve Krandel
BASE Consulting Group
skrandel@baseconsulting.com
 
Hi,
Just adding to point made by randel. A loop is a scenario where there is more tahn one way to arrive at the destination table from the source table. As SQLs are generated by BO itself, BO will get confused as to which route to take. Because of this problem we have to resolve loop appearing in a universe.

Methods of resolving loop are context and alias.
Both are not substitute to each other. the case demands one of the remedy. As pointed out by randel if you are creating an alias it would be one more object will be exposed to the user. If the existance of both the object does not confuse the user then creation of alias is ok (eg Supplier region , Order Destination region)
else eg Product Sold, Product Ordered will confuse the user as he know only product in such cases context must be used.
How to create context
select all the joins which make a path from source table to destination table and right click to create context from the menu.
 
Just one thought. Context are are very useful but will cause your Universe to seem more complex. To apply context correctly requires a little more knowledge of the database and the schema involved. I would say if you have many loops while creating your Universe then you might need to re-examin the way you have set your tables up. Just a thought.
 
Steve, thanks for the offer, could you forward your notes on context to me at andysmithhsbc(at)hotmail.com.,..

Cheers...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top