OPENINGPERIOD

Returns the first element which has these characteristics:
  • It is at the same XMLA level in the hierarchy as the element you specify in the Element parameter of the function.
  • It shares at least one ancestor with the specified element.

The function returns an empty string if the parameters are incorrect or there is no element with the required characteristics.

Syntax

OPENINGPERIOD(Dimension, Element, DistanceFromRoot)

If the dimension contains multiple hierarchies (that is, it contains elements with multiple parents), use HOPENINGPERIOD.

Examples

In the examples provided, a hierarchy of all years, years, quarters, and months is used. In this hierarchy, the All Years element is the root element (Level 1).

The years 2005, 2006, … , 2017 are at Level 2.

The quarters of each year, 2005_Q1/Q2/Q3/Q4, 2006_Q1/Q2/Q3/Q4 and so on are at Level 3.

The months within the quarters, 2005_Q1_01/02/03, 2006_Q2_04/05/06 and so on are at Level 4.

Example 1

This example returns '2005_Q1_01':

OpeningPeriod('Period', '2010_Q4_12', 0)

The element returned by OpeningPeriod is calculated from the root element (All Years - Level 1).

The first element in the hierarchy that is at the same native level as 2010_Q4_12 is 2005_Q1_01. It has the same ancestor (All Years).

Example 2

This example returns '2010_Q1_01':

OpeningPeriod('Period', '2010_Q4_12', 1)

The element returned by OpeningPeriod is be calculated from Level 2 (one native level below the native root level). This is 2005.

The common ancestor is 2010. 2010_Q1_01 is at the same native level of the hierarchy as 2010_Q4_12.

Example 3

This example returns '2010_Q4_10':

OpeningPeriod('Time', '2010_Q4_12', 2)

The element returned by OpeningPeriod is calculated from Level 3 (two native levels below the native root level).

The common ancestor is 2010_Q4. The first element at the same native level as 2010_Q4_12 is 2010_Q4_10.