Monday, February 16, 2009

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…

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.