Adding a Hierarchy

This page provides a description of how you can expose a field as a hierarchy. It features an example in which we expose a previously added field ‘TestField’ as a hierarchy. For a full walk-through on how this was done, see Adding a Field. The techniques employed are generic examples that can be extended, adapted and repeated for any use case that we need. In all cases, we make minimal changes to the Reference Implementation.

To expose a field as a hierarchy, make the following modifications to the correct Cube Config class.

  • For the BA Cube, modify cvarc-ba-activepivot/src/main/java/com/activeviam/cvarc/ba/ref/cfg/impl/
  • For the SA Cube, modify cvarc-sa-activepivot/src/main/java/com/activeviam/cvarc/sa/ref/cfg/impl/

Step 1 - Modifying Cube Dimension Config

In the ICanBuildCubeDescription<IActivePivotInstanceDescription> dimensions(ICanStartBuildingDimensions builder) method, append the new Hierarchy by adding the following lines just after line 127.


Prerequisite information
To learn more about navigating the managerDesc, see Navigating managerDesc .


Step 2 - Modifying Schema

Modify the Cube’s schema so that the Field can be found and set to be a hierarchy. In this case, the modifications is made in the createBASelection() method or createSASchemaSelectionDescription() method for the BA or SA cube, respectively. The snippet is from the BA Cube’s Selection config.


Make sure that any new field added to the selection does not exist in the selection already, and that it points to a corresponding field in a datastore.

ISelectionDescriptionBuilder.HasAllFields hasSomeFields = StartBuilding.selection(dsSchemaDesc.asDatabaseSchema())

        // Adding the TestField to selection
        .usingReference("BaseStore to TestFieldStore") // Reference from the Base Store to our new field's store
        .except("AsOfDate", "TradeId"); // Exclude fields that are found in other stores. The application will not start if the selection has duplicate fields unintentionally.