Calculation Engine Tag Alias Functions
The following are functions for dynamically referencing the current tag's enclosing group and hierarchical path in the OAS Calculation Engine. These reserved strings allow you to create reusable calculations that adjust depending on their location within Tag Groups:
Parent Group
Injects the name of the calculation Tag's enclosing parent group using the reserved value of _parentgroup_.
Examples: As a baseline, a Tag referenced without a path will assume the root of the hierarchy
[Tag1.Value]
The use of _parentgroup_ injects the immediate parent group of the calculation tag, so this example would work only if the tag Tag1 exists within the same group as the calculation tag and they are both only one group below the root. (e.g. GroupA.Tag1.Value, GroupB.Tag1.Value)
[_parentgroup_.Tag1.Value]
Using _parentgroup_ within a path allows for cases where you want to reference the parent group dynamically while explicitly listing enclosing groups above the parent. In this example, the calculation would be valid for GroupA.GroupB.GroupX.Tag1.Value as well as GroupA.GroupB.GroupY.Tag1.Value as long as the calculation tag exists alongside a Tag1 tag in a group of any name below the GroupA.GroupB hierarchy.
[GroupA.GroupB._parentgroup_.Tag1.Value]
Parent Groups
Injects the full path of the calculation Tag's enclosing parent groups using the reserved value of _parentgroups_.
Example:
The following can locate a tag with the name Tag1 as long as it resides in the same group as the calculation, no matter how deep the hierarchy. This would work to locate Tag1.Value, GroupA.Tag1.Value, GroupA.GroupB.Tag1.Value, GroupA.GroupB.GroupX.Tag1.Value and so on, without the need to alter the text of the calculation.
[_parentgroups_.Tag1.Value]