Planning Analytics provides its users with some new Turbo Integrator functions to create hierarchy objects for a dimension. In this blog I will go into more detail on enabling the new hierarchy creation setting, the different Turbo Integrator functions used to create hierarchy objects in Planning Analytics, and when each should be used.
Enabling Hierarchy Objects
Multiple hierarchies are not enabled by default in Planning Analytics. An administrator can configure this setting in the tm1s.cfg file by adjusting the EnableNewHierarchyCreation setting to “T”, to allow the use of multiple hierarchies and the related Turbo Integrator and rules functions. Multiple hierarchies can currently be implemented using a Turbo Integrator process or Planning Analytics Workspace. You can’t currently do so through the dimension editor or dimension worksheets.
Adjusting the EnableNewHierarchyCreation setting, to allow the use of multiple hierarchies, provides greater flexibility when querying. A single hierarchy model requires all queries to have exactly the same number of hierarchies as the number of dimensions that make up the cube in the query. With a multiple hierarchy model, queries can have any number of hierarchies equal to or greater than the number of dimensions that make up the cube in the query.
Create Hierarchy Objects
The new Turbo Integrator functions account for hierarchy specification in Planning Analytics. Use the HierarchyCreate function in a TI process for creating a new hierarchy in a dimension. The syntax for this function is: HierarchyCreate(DimName, HierName);. The HierarchyDestroy function is used in a TI process to delete a hierarchy from the TM1 database. The syntax for this function is: HierarchyDestroy(DimName, HierName);.
There are separate functions available for single and multiple hierarchy models. The single hierarchy creation function syntax is: DimensionElementInsert(DimName, InsertionPoint, ElName, ElType);. This function will add an element to a dimension and can be used along with the DimensionElementComponentAdd function. The syntax for this function is: DimensionElementComponentAdd(DimName, ConsolidatedElName, ElName, ElWeight);. This function will add an element as a child of a consolidated element in a dimension. The multiple hierarchy creation function syntax is: HierarchyElementInsert(DimName, HierName, InsertionPoint, ElName, ElType);. This function will add an element to the specified hierarchy of a dimension and can be used along with the HierarchyElementComponentAdd function. The syntax for this function is: HierarchyElementComponentAdd(DimName, HierName, ConsolidatedElName, ElName, ElWeight);. This function will add an element as a child of a consolidated element in the specified hierarchy of a dimension.
When to Use
When your model cubes contain single hierarchy dimensions only, use either of these functions to create hierarchy objects. However, when they contain a second hierarchy, use the multiple hierarchy function to specify the hierarchy name. Use the multiple hierarchy function in a case where all cubes in your model contain single hierarchy dimensions only. The hierarchy being referenced in the function will be the same as the dimension name. Use the multi-hierarchy function in a case where a dimension in your cubes contains a second hierarchy. The hierarchy being referenced in the function will call out the specific name of the hierarchy being used.
These functions will allow you to create hierarchy objects in Planning Analytics for both single and multiple hierarchy dimensions. With a single hierarchy model, you can continue to utilize the original DimensionElementInsert. DimensionElementComponentAdd functions create hierarchy objects for your dimensions. With a multiple hierarchy model, you will want to adjust any TI processes used to create your dimension hierarchies to utilize the new HierarchyElementInsert and HierarchyElementComponentAdd functions to create hierarchy objects for your dimensions.