Defining hierarchies

Hierarchies can be defined in a business cube or report cube to allow users to drill report data up and down to particular dimensions on JReport Server. A hierarchy is defined as a hierarchy category holding one group of dimension objects sharing a hierarchical relationship, following the order from the highest level to the lowest. For example, these dimension objects can be added into one hierarchy group called Dates: Sales Year, Sales Quarter, Sales Month, and Sales Date. When any of these dimension fields are used for grouping data in a table, crosstab or chart, end users can use the context menu to drill up or down to the next level. You can create any number of hierarchies such as dates, times, geography, product types, and so on.

The dimension objects added in a hierarchy are just references to the real dimension objects and therefore cannot be edited.

To define hierarchies in a business/report cube, you can take either of the following two ways:

Defining a data hierarchy in the Business/Report Cube Editor

  1. In the Catalog Browser resource tree, select the business/report cube, right-click it and click Edit Business Cube/Edit Report Cube on the shortcut menu.
  2. In the Business/Report Cube Editor, select the business/report cube or any category in the right panel, then,
  3. In the Add Hierarchy dialog, provide a name and click OK. The name should be unique among the hierarchies in the business/report cube.
  4. A blank hierarchy will be added to the business/report cube resource tree. You can then add dimension objects into the hierarchy as a hierarchical group by dragging and dropping.
  5. Drag a dimension object either from the query resource tree in the Resource Objects panel or from the business/report cube resource tree in the right panel and then drop it into the hierarchy. The inserted position depends on the dropped position:
  6. To adjust the order of the dimension objects in the hierarchy, make use of the or button. The higher the position is, the higher the level is.

  7. To remove a dimension object from the hierarchy, select it, then right-click and select Remove from Hierarchy on the shortcut menu.

Adding a data hierarchy in the Data tab of the Catalog Browser

  1. In the Catalog Browser resource tree, right-click the business/report cube or any category in it and select Add Hierarchy from the shortcut menu.
  2. Provide a name in the Add Hierarchy dialog and then click OK. The name should be unique among the hierarchies in the business/report cube.
  3. A hierarchy will be added in the business/report cube.
  4. Follow the steps 5 to 7 in the above section to define the hierarchy in the Business/Report Cube Editor.

Tip: Hierarchies can be added into any category in a business view and it does not make any difference where it is placed. For easy look-over, you can put them under the root category.