If you have done extensive MicroStrategy Architect work in versions 9.1.x or 9.2.x, is quite likely that you have come across this issue: while trying to map some of your existing attributes to new warehouse tables, your most recent table is not available as a source for your column expression, even when the column name is the same and the table has been successfully added to your project’s warehouse catalog. It seem like the only alternative is to create a new expression with the same name. As a result, you get something like the image below, where the same expression appears to be duplicated, which down the road could get confusing and even create problems when dealing with compound keys. In this post, I’ll explain the reason for this behavior in MicroStrategy and a small hack to avoid duplicate columns.
Before diving into how to avoid this behavior, let me give you a quick background of what MicroStrategy is trying to do. Since version 9.1.x, MicroStrategy introduced a new setting called “Column Merging Options”. This functionality is explained in detail in MicroStrategy’s Knowledge Base. In a few words, MicroStrategy created a way for Architects to decide whether it should update the definition of a column (e.g.: varchar(25) vs varchar(30)), based on the column type from the last table added, to the largest known size or simply preserve each of the existing column definitions as different expressions. The latter is called the “Do not merge” option and is shown in the image below. The proper use of this setting should result in the optimal use of reserved memory.
I personally do like the intention of this new functionality. However, in some cases I have noticed the same column definition from two different tables been treated as 2 different expressions, and what has made this even worse is that I’m annoyed by the location where this setting has been placed at. This setting is available through the warehouse catalog “Read Settings” and if you have worked with MicroStrategy long enough, you will agree with me that this is the last place where architects/developers will look at when their new source table does not show under their existing column expressions or when duplicate columns start showing under their attribute definitions. Fortunately, I’ve found a quick and simple hack that I like to use when I see this behavior happening. Not only I haven’t had any issues with this approach, but it has also been critical in fixing some metadata corruption issues related to duplicate column expressions and attribute compound keys.
The trick is quite simple, just follow the steps below:
- Whenever MicroStrategy is treating an existing column from your new table as a different column expression, you will notice that the table will not show as an available source in the “Attribute Form” editor. In the example below we are trying to map BRD_STY_CLR_KEY to a table called VFSVL_FLTND_VNDR_ATT… which has already been added to the project’s warehouse catalog. In order to avoid defining a new duplicate expression, the first thing to do is click on the modify button for the existing expression.
- This should open the “Form Expression” editor as shown below. Look for your new table under the “Source table” drop down box.
- Once all available columns are displayed, remove the existing “Form expression” and drag the same column from the “Available columns” options into the “Form expression” text box.
- Once the expression is validated click OK.
- Once you are back into the “Form Expression” editor, you’ll notice that the originally selected “Source Tables” options have disappeared, while your new table is shown (see image below). It is possible that other tables that were not originally shown appear here as well. Do not click on the “OK” button yet!
- Since you don’t want to remove the originally selected source tables, instead of clicking “OK”, click on the “Cancel” button. You’ll go back into the “Attribute Editor” window and your definition will remain unchanged. Once you are here, go back into the form you want to modify by clicking on the “Modify” button again.
- Now you are back into the “Attribute Form” editor, however this time you’ll notice that the source table that you were originally missing, now shows as one of the options under the “Source table” check boxes.
- Check your new source table and click on the “OK” button. You’ve now added your new source to the existing expression without the need of creating a duplicate column or changing your Column Merge Options across the project.
I hope you find this trick useful, and as always I encourage you to read my disclaimer.