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, etc.
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
- 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.
- In the Business/Report Cube Editor, select the business/report cube or any category in the right panel, then,
- Right-click and select Add Hierarchy from the shortcut menu.
- Click Insert > Hierarchy on the menu bar.
- Click the Insert Hierarchy button on the toolbar.
- In the Add Hierarchy dialog, provide a name and click OK. The name should be unique among the hierarchies in the business/report cube.
- 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.
- 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:
- When you drop on the hierarchy root node, the dimension object will be placed to the bottom level of the hierarchy.
- When on an existing level, the dimension object will be placed below it.
- When between two levels, the dimension object will be placed between them.
-
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.
-
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
- 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.
- 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.
- A hierarchy will be added in the business/report cube.
- 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.