Jun 19 2008
How To Copy a Context
Some time back I answered a question on BOB that asked:
How can I copy a context?
There are a number of reasons why you might want to do this. In a semi-complex universe you might have a bunch of snowflake tables and a series of fact tables. After building the first context, the second (third, fourth…) are essentially the same but with a different fact table. As far as I know there is no way to copy / paste a context, but there is a fairly simple way to source a new context from an existing one. Here’s what I do:
- Create the first context
- After saving the first context, make sure List Mode is activated (it will be on by default if this is the first context in the universe)
- Click (not double-click) the first context to highlight it; this will select all of the joins that you included in that first context
- With the CTRL key and your mouse, deselect joins to the first fact and add (select) joins to the second fact; when you are done you will have all of the joins that were created in the first context except for the fact table joins
- Click the “Add Context” button on the toolbar, or make the equivalent selection from the menu
When you’re done, you will have created a second context based on the first context, even if you cannot copy and paste a context definition. It works very well. 🙂
I have a universe for my current project that has 22 extremely similar contexts. There is only one table that is different from one context to the next, and each context contains a large number of joins. It would have been a real nightmare to try to create each context manually (and I suspect prone to error). Using this technique made the context creation step very easy. 😎
Related Links
- Topic on BOB where I originally answered this question
I was searching for a similar problem and got the answer from your site….It really saved my time! thank you so much Dave…
Hi, you are most welcome. Thank you for your comment. 🙂
Thanks. Just what I needed !