Jun 19 2008

How To Copy a Context

Categories: Universe Contexts, Universe Design Dave Rathbun @ 8:46 am

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:

  1. Create the first context
  2. 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)
  3. Click (not double-click) the first context to highlight it; this will select all of the joins that you included in that first context
  4. 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
  5. 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. 8-)

Related Links

3 Responses to “How To Copy a Context”

  1. Comment by Mathi Prakash

    I was searching for a similar problem and got the answer from your site….It really saved my time! thank you so much Dave…

  2. Comment by Dave Rathbun

    Hi, you are most welcome. Thank you for your comment. :)

  3. Comment by Ingrid Husby

    Thanks. Just what I needed !

Leave a Reply

If you want to include formulas or code in your comment, please read my Tips for formatting comments first. Tags you can use are listed below.

XHTML: You can use these tags: <a href="" title=""> <acronym title=""> <blockquote cite=""> <code> <em> <strike> <strong> <sup> <sub> <u>

Confirm submission by clicking only the marked checkbox:

             *

Please remember that comments that are not related to this blog post may be ignored or deleted without notice. If you're looking for help on a topic you have already posted on BOB then please do not repost your question here.