HCLOSINGPERIOD
HCLOSINGPERIOD
works in a similar
way to CLOSINGPERIOD
but can be used with multiple
hierarchies. It has the additional TopNode
parameter.
TopNode
indicates the hierarchy to be used.Multiple hierarchies are those in which an element has multiple parents. This is common in time-based dimensions.
For example, a Time dimension may contain a hierarchy of years, quarters and months. January, February and March are within Quarter 1 and Quarter 1 is within a year.
But the dimension may also contain a year-to-date hierarchy containing a cumulative year parent, cumulative months, and months. So, Cumulative Month 1 contains January, Cumulative Month 2 contains January and February and Cumulative Month 3 contains January, February and March.
In this example, ClosingPeriod
returns
an empty string because it would be unable to determine which hierarchy (Year or Cumulative
Year) is intended.
Syntax
HClosingPeriod(Dimension, Element,
DistanceFromTopNode, TopNode)
Examples
This example returns '12_2017':
HClosingPeriod('Time', '05_2010', 0, 'All
Years')
This example returns '12_2010':
HClosingPeriod('Time', '05_2010', 1, 'All
Years'
This example returns '06_2010':
HClosingPeriod('Time', '05_2010', 2, 'All
Years')
This example returns '12_2017':
HClosingPeriod('Time', '05_2010', 0,
'YTD')
This example returns '12_2010':
HClosingPeriod('Time', '05_2010', 1,
'YTD')
This example returns '06_2010':
HClosingPeriod('Time', '05_2010', 2,
'YTD')