Level selection from a combo box

We will add a combo box to the sample ABC Analysis report supplied with the Best Practices Templates database. The combo box will display the levels of the Product hierarchy (All, Product Group, Tire and Size). These levels are elements of the Olap Metadata hierarchy.

To see this, open Accessories in the Repository Explorer and expand Custom Hierarchies. select Olap Metadata and click Preview. The hierarchy is displayed in the Preview pane of the List Designer. Expand Analysis > Product [dimension] > Product [hierarchy]. The four product levels are displayed.

The report currently displays products at the Product Name level of the hierarchy. But, by selecting a level from the combo box, users will choose the level at which the data is displayed.

  1. In the Report Catalog, expand Reports > Sales and open the ABC Analysis report.
    The report displays data at the Product Name level - all products are listed.
  2. Create a combo box in cell H14, click Accessories > Custom hierarchies, and drag Olap Metadata hierarchy onto the cell. Name the combo box Level.
  3. In Structure Selection, select the Product hierarchy in the Children of list.
    The combo box displays the four product levels.
    Note: The combo box contains an Olap metadata list. Its values are Olap Metadata names, for example, [Repository].[Genesis].[Analysis].[Product].[Product].[Product Name]. But Application Studio requires the ODBO name, for example, [Product].[Product Name]. We will use attribute1 of the Olap metadata list to extract the ODBO name.
  4. Select the Product hyperblock.
  5. In Structure Selection, double-click the existing structure selection (Level: Product Name).
  6. In the Edit Custom MDX dialog, click the Variables button.
  7. Expand ListViews and double-click Level. Change .text to .attribute1.
    =ReportObjects.Level.attribute1.

    Attribute1 returns the name of an element in an Olap Metadata list.

    The structure of the Product list now depends on the level which is selected in the combo box.