createProjectionNodes¶
Creates projection nodes. Returns an array of projection node IDs. Does not copy results from the created nodes. Does not perform any further calculations on the results.
Signature¶
createProjectionNodes(
valuationTypes,
valuationDates,
hierarchyFilter,
ancestorsAndDescendantsOnly=TRUE,
)
Arguments¶
valuationTypes- A valuation type name or array of valuation type names.
valuationDates- A valuation date or array of valuation dates.
hierarchyFilter-
A formula that is evaluated for each potential hierarchy node. If it evaluates to something "truthy" like
TRUEor1, the hierarchy node is included; otherwise it is excluded. This is much more performant than running all projection nodes and filtering the results afterward.The namespace for this formula will contain:
- Hierarchy node properties.
- A hierarchy node name for each level.
- The hierarchy level number
hLevel. - TODO: The hierarchy level name
hLevelName(if we want to use names instead of numbers).
ancestorsAndDescendantsOnly-
Which parts of the hierarchy tree to consider.
- When this is
TRUE, only the ancestors and descendants of the current hierarchy node are considered. This is howmapProjectionValuesworks. - When it is
FALSE, all nodes on the same hierarchy tree are considered. This is howmapExternalProjectionValuesworks. - Nodes on other hierarchy trees are never considered.
- When this is
Examples¶
Single valuation type, single valuation date¶
createProjectionNodes("ValnType1", DATE(2024,1,1), …)
Multiple valuation types, multiple valuation dates¶
createProjectionNodes(
array("ValnType1", "ValnType2"),
array(DATE(2024,1,1), DATE(2024,1,2)),
…
)
Filtering hierarchy nodes¶
Consider the following hierarchy:
| 4 LevelA |
3 LevelB |
2 LevelC |
1 LevelD |
Hierarchy Properties → | PropA | PropB |
|---|---|---|---|---|---|---|
| NodeA | NodeB | NodeD | NodeF | 1 | TRUE | |
| NodeA | NodeB | NodeE | NodeF | 2 | FALSE | |
| NodeA | NodeC | NodeD | NodeF | 3 | FALSE | |
| NodeA | NodeC | NodeE | NodeF | 4 | TRUE |
Assuming that the current projection node is on NodeA > NodeB > NodeD, the following formula will create a single
projection node on NodeA > NodeB > NodeD > NodeF:
createProjectionNodes("ValnType1", DATE(2024,1,1), "hLevel=1", TRUE)
Changing ancestorsAndDescendantsOnly to FALSE will cause a projection node to be created for every hierarchy node
on level 1:
createProjectionNodes("ValnType1", DATE(2024,1,1), "hLevel=1", FALSE)
We could further filter by properties and names to use only the nodes where PropA is greater than 2 and the node
on LevelC is called NodeE, which corresponds to NodeA > NodeC > NodeE > NodeF:
createProjectionNodes("ValnType1", DATE(2024,1,1), "AND(LevelC='NodeE', PropA>2, hLevel=1)", FALSE)
Use with projectionResultsToTable¶
See here.