HierarchyElementComponentAddDirect

HierarchyElementComponentAddDirect adds a component (child) to a consolidated element by directly editing a dimension.

This function is valid in TM1® TurboIntegrator processes only.

The default method of editing a dimension in Cognos® TM1 is to use a whole-copy editing pattern. In that pattern, an editing copy of the dimension is created, edits are applied to the editing copy, then finally the actual dimension is rewritten using the editing copy as a template. TurboIntegrator supports whole-copy editing automatically whenever dimension editing TurboIntegrator functions (like HierarchyElementComponentAdd) are used in the Metadata procedure of the process. TurboIntegrator automatically creates the editing copy and applies editing operations to it, then rewrites the actual dimension at the end of the Metadata procedure.

Direct edits are different in that no editing copy is involved. Instead, the operations are performed directly on the actual dimension. There are two different, specialized use cases for which this type of direct editing is intended:

  • When the purpose of the TurboIntegrator process is to make a small change to a large dimension. In this case, direct editing will be more efficient because it avoids copying and completely rewriting the large dimension.
  • When the purpose of the TurboIntegrator process is to load large volumes of data into a cube. In this case the process' Metadata procedure is deliberately kept empty, and any element modification needed to support data loading is performed using direct calls in the Data procedure. When the Metadata procedure is empty, the process skips an entire iteration over the external datasource, which can result in faster data loads.

Syntax

HierarchyElementComponentAddDirect(DimName, HierName, ConsolidatedElName, ElName, ElWeight);

Argument

Description

DimName

The parent dimension of the consolidated element to which you want to add a child.

HierName

The hierarchy of the specified dimension.

ConsolidatedElName

The consolidated element to which you want to add a child.

ElName

The name of the child element.

ElWeight

The weight of the child element.

Example

HierarchyElementComponentAddDirect('Measures', 'Europe', 'Net Sales', 'Expenses', -1);

This example adds the child Expenses to the Net Sales consolidation in the Europe hierarchy of the Measures dimension. The child has a weight of -1 in the consolidation.