Category Archives: MicroStrategy

Compound Key Attributes

A compound key attribute is an attribute that has two or more IDs. For instance, the attribute City may be defined in the data model as a combination of COUNTRY_ID and CITY_ID. Quite often these attributes have automatic mapping for one ID and manual mapping for the other one. This design may look strange, but in most cases there are sound rationales behind it.

Now, here is the thing. Let’s say you need to create a new table that should contain the compound key attribute and a new fact. Obviously, you create the table, load it into the Warehouse Catalog, create the new fact and update the schema.
You then create a new metric based on the new fact and attempt to use it in a report, together with the compound key attribute. What happens next is you get an error stating that the new fact does not exist at the attribute level. Staggered, you have a look at the logical view of your new table and see that your attribute and fact are both present, and therefore there should be no call for the error.

Of course, there is a very good reason for the error, and that is because the compound key attribute knows about the new table only through its automatically mapped ID, which is not really enough. So just add the new table to the source table list of the manually mapped ID and it should work.

Common sense suggests that no one would run into such a problem. Nevertheless this belief is based on the idea that all the developers are familiar with each and every compound key attribute in the project, which may not always be true.

A good practice in this case is to maintain a list of attributes that have at least one connection mapping set to manual, and pay special attention to these attributes. Even an attribute with a single ID is liable to cause the same problem if that ID is manually mapped, except that in its case the logical view will not show the attribute at all, thus not fooling you.

SDK – DssType…

If you find yourself writing a program based on MicroStrategy’s SDK, sooner or later you will realize that although huge, the SDK documentation is not nearly sufficient.

Let’s say you are trying to write an IF/CASE statement on object.Type. Most of the time the type is self explanatory, like DssTypeAttribute or DssTypeFilter.

If object.Type = DssTypeMetric Then…

However, there are some objects for which no DssTypeXyz is defined, like Hierarchy or Transformation.
The good news is that it is quite simple to learn how MSTR stores these objects. Just go to C:\Program Files\MicroStrategy\Tutorial Reporting\TUTORIAL_METADATA_7200.mdb and open the table DSSMDOBJINFO.

Now go to the Tutorial environment of MSTR and locate an object whose type you want to learn, i.e. a Transformation. For this example I chose the Transformation “Quarter to Date”, whose Object ID is DB5E65D641D790631D8D7CA48FDB90FE. Simply search for this ID in the OBJECT_ID column of DSSMDOBJINFO and you will find that the OBJECT_TYPE is 43.

If object.Type = 43 Then…

Sometimes it pays to have a look at the SUBTYPE as well. Just to make sure your IF/CASE statement is correct, use the “Filter by Selection” button on the OBJECT_TYPE value that you identified and check if there is more than one subtype available for it.

If object.Type = 43 and object.SubType = 11009 Then…

Please note that there is no actual need for specifying the subtype for the Transformation, as there is only one available. The code above is just for emphasis purposes.

By the way, whatever you do, don’t modify anything in the TUTORIAL_METADATA_7200.mdb file, not if you still want to use the Tutorial environment…

Object Prompt in RS Document

Have you ever checked placing a report with object prompt in report service document? if so, then the object prompt won’t appear in document.

Tips:

  1. Place all the attributes (which present in object prompt) in to the report
  2. Add as a data set into report service document.
  3. Drag and drop the report(grid) into the document.
  4. Save and close the document.
  5. Open the report, remove all the attributes and place the object prompt into the same place (column or row) where attributes are placed.
  6. Save and close the report.
  7. Now, execute the document.

No wonder, it will ask you to select the attributes from the list.

Customize the ‘Total’ in MicroStrategy

How to customize the Total, for those present in the report?

Here is solution:

After placing required attributes and metrics in to report, run the report and once you get data go to Data Menu –> sub Totals –> Advanced –> New — > Type ‘#A total’ then do the normal total selection (like subtotal by row, etc, etc).

Now, the total appear as ‘ Attributename Total’ for each total.

Some more tips on custom totals:

#A
The name of the attribute under which the subtotal appears.
#P
The name of the attribute to the left of, or above the attribute under which the subtotal appears.
#0
All the forms of the parent element.
#1
The first form of the parent element reading from left to right or from top to bottom.
#2
The second form of the parent element reading from left to right or from top to bottom.
#3
The third form of the parent element reading from left to right or from top to bottom.
#4
The fourth form of the parent element reading from left to right or from top to bottom.

Note: single Quotes to highlight, dont give the same in report :)