In a previous article, we reviewed how to manually create Planning Analytics Workspace (PAW) hierarchies based on attributes. This allows you to create “virtual dimensions” based on these attributes that can be used for further analysis…but what happens when the attribute values change?

Today, we’ll show you how to use TurboIntegrator (TI) to maintain your hierarchies, so that you can be sure that you are always looking at the most updated information, even when attribute values change.

We’ll use four of the new hierarchy-related TI functions in this exercise:

1. HierarchyExists (to check if the hierarchy exists)
2. HierarchyDestroy (to destroy it if it exists)
3. CreateHierarchyFromAttribute (to create the hierarchy based on an attribute)
4. HierarchySortOrder (to sort the hierarchy)

We can create a generic process using parameters for the dimension and hierarchy that can be used to update any hierarchy in our model. We’ll use the following code in the Prolog procedure of our process for this example:

# Delete Hierarchy if it Exists
IF(HierarchyExists(pDim,pHier)=1);
HierarchyDestroy(pDim,pHier);
EndIF;

# Create Hierarchy from Attribute
CreateHierarchyByAttribute(pDim,pHier,'Unassigned '|pHier,'All '|pHier);

# Sort the Hierarchy
HierarchySortOrder( pDim, pHier, 'ByName', 'Ascending', 'ByHierarchy', 'Ascending' );

Watch the short video below to see how it’s done and stay tuned for more articles on this powerful new feature in PAW!