MicroStrategy ONE

Custom Groups

A Custom Group is a special type of filter. For this reason the WebCustomGroup interface extends from WebFilterBase. A Filter uses WebExpression objects to create filter expressions. These expressions, in turn, are composed of one or more WebNode objects. The root node is generally an operator node with function type "and" or "or".  However, if an expression is obtained from Intelligence Server, then it does not necessarily have to be rooted at an “and” or “or” node.

Expressions are also used as part of WebPrompt, WebElementSource, WebFilter, and WebTemplate.

The CustomGroupCreationSample class, provided as part of the SDK, includes code for five different examples of how to create a Custom Group:

  • Creating a Custom Group by associating an existing filter to it (Shortcut To Filter)  

  • Creating a Custom Group using "In List" Attribute Qualification  

  • Creating a Custom Group using "Begins With" in the Attribute Qualification  

  • Creating a Custom Group using a Metric Qualification  

  • Creating a Custom Group using Banding Qualification

These simple examples illustrate how to use WebExpressions and other Custom Group properties and serves as a basis for using these interfaces to accomplish more complicated behavior.

The CustomGroupCreationSample.java class (located in the samples/java/webobjects subfolder in the SDK installation directory) uses objects from the MicroStrategy Tutorial Project to create the new Custom Groups and saves them under the My Objects folder. This sample class uses the SessionManagementSample.java class, located by default in the same samples/java/webobjects subfolder, to create and close the session with MicroStrategy Intelligence Server. You have to deploy SessionManagementSample.java using this code sample and create a session for an administrative user on the MicroStrategy Tutorial Project when testing this sample class.

Setting Custom Group Properties

The following properties in the Web API map to ones exposed by MicroStrategy Developer, as shown on the dialog below:

 

  • Enable Hierarchical Display

    Use the setFlatten method to specify whether hierarchical display should be enabled or not.

    For example:

    //Disable hierarchical display

    cg.setFlatten(true);

  • Enable Subtotals Display

    Use the setAggregation method on a WebCustomGroup to set this property. Possible values are:

    • EnumDSSXMLAEAggregation.DssXmlAggregationEnable

    • EnumDSSXMLAEAggregation.DssXmlAggregationDisable

    For example:

    //Disable subtotals

    cg.setAggregation(EnumDSSXMLAEAggregation.DssXmlAggregationDisable);

  • Custom Group Element Header Display Position

    Use the setParentFirst method to specify the display position. Set this property to "true" to display it above child elements; set it to "false" to display it below child elements.

    For example:

    //Set Header Display Position

    cg.setParentFirst(true);

  • Setting Display Options for Custom Group Elements

    Use the setDisplayOption method to specify the display option for Custom Group elements (see EnumWebCustomGroupDisplayOptions). There are four different options, as shown in the MicroStrategy Developer dialog below, which SDK users can also set through the Custom Groups API.

    For example:

    //Show only the element name on the report

    cg.setDisplayOption(EnumWebCustomGroupDisplayOptions.ShowOnlyElementNames);

Refer to the interfaces section for all the interfaces that are available for Custom Group functionality. These interfaces help you understand the code samples provided in the examples section.