DimensionElementComponentAdd adds an existing element of a dimension in TM1 into a hierarchy as a child of another existing element. With this function you can define what the weight of the element is to determine if the values are to be added or subtracted from the parent.
Syntax of DimensionElementComponentAdd
The syntax is:
DimensionElementComponentAdd (DimName, ConsolidatedElName,ElName, ElWeight);
- DimName is the dimension you want to work with.
- ConsolidatedElName is the element to which you want to add a child.
- ElName is the name of the child element.
- ElWeight is the weight of the child element (usually either 1 to add positive values to the parent or -1 to subtract positive values from the parent)
Usage and Example
DimensionElementComponentAdd is often used in combination with the DimensionElementInsert statement so that after you have added a new element, you then need to add it into a hierarchy.
DimensionElementComponentAdd (‘GL Account’, ‘Unknown Account’, vSub_Account, 1);
This will add the current contents of the variable vSub_Account to the element “Unknown Account” in the GL Account dimension with a weight of 1 (in other words positive values will add to the parent).
Often this function is used in conjunction with DIMIX to test if an element exists, and then DimensionElementInsert to insert it if it does not exist before finally using DimensionElementComponentAdd to add it into a hierarchy.
It might also be used with a DIMIX to test if a potential parent exists before having the element in question being added to that parent.
The opposite of this function is DimensionElementComponentDelete.
This function can only be used in Turbo Integrator processes.