The short answer is Yes! These are invaluable elemental information functions within Planning Analytics. These functions can be used in Rules, Worksheets, and TI Processes. ELPAR and ELCOMP are very similar to one another and have other related functions which can return information about how elements reside within dimensions. In this post, I will discuss the functions ELISPAR, ELPARN, and ELPAR as well as their counterparts ELISCOMP, ELCOMPN, and ELCOMP. I will go over how these can be used for working with elements in dimensions.

We can work through how to use these functions with this sample “FAMILY” dimension shown below.

From the example, there is a consolidated element called “Parent1”. This element has 3 leaf children assigned to it. If we wanted to confirm that “Parent1” is an immediate parent to “Child1” we can use the function ELISPAR.

ELISPAR( dimension , assumed-Parent , assumed-Child )

ELISPAR( ‘Family’ , ‘Parent1’ , ‘Child1’ ) = 1

ELISPAR( ‘Family’ , ‘Child1’ , ‘Parent1’ ) = 0

This function will return a Boolean result 1=TRUE or 0=FALSE to confirm whether “Parent1” IS or IS NOT an immediate parent to “Child1”. The order of the arguments is important, notice in the second example how a 0/False result is returned. This is because “Child1”, is NOT a parent to “Parent1”. This will only work for immediate parents where their levels can only differ by 1. In order to check across any number of levels we can use the function.

ELISANC( dimension , assumed-Parent , assumed-Child )

ELISANC( ‘Family’ , ‘Parent’ , ‘Child1’ ) = 1

This function has a counterpart with ELISCOMP. COMP functions focus on child elements. In this example the arguments are reversed because we are checking the hierarchy in the opposite direction.

ELISCOMP( dimension , assumed-Child , assumed-Parent )

ELISCOMP( ‘Family’ , ‘Child1’ , ‘Parent1’ ) = 1

ELISCOMP( ‘Family’ , ‘Parent1’ , ‘Child1’ ) = 0

In order to see the number of parents an element is assigned; we can use the function ELPARN.

ELPARN(  dimension , assumed-Child )

ELPARN( ‘Family’ , ‘Child1’ ) = 1

ELPARN( ‘Family’ , ‘Child2’ ) = 2

ELPARN( ‘Family’ , ‘Parent1’ ) = 1

ELPARN( ‘Family’ , ‘GrandParent’ ) = 0

This function will return a value between 0 and the total number of parents to the provided element. With this function, we can see the results are the same for both “Child1” and  “Parent1”, because both these elements belong to only 1 parent element. When “Child2” becomes the argument, the result is 2 because the element belongs to 2 parents. When the argument of “GrandParent” is used, the result is 0 because “GrandParent” has no parent element.

The complementary function to this is to use the ELCOMPN function. This will return the number of children elements that belong to the provided element argument.

ELCOMPN(  dimension , assumed-Parent )

ELCOMPN( ‘Family’ , ‘Child1’ ) = 0

ELCOMPN( ‘Family’ , ‘Child2’ ) = 0

ELCOMPN( ‘Family’ , ‘Parent1’ ) = 3

ELCOMPN( ‘Family’ , ‘GrandParent’ ) = 2

The results for “Child1” and “Child2” are both 0 because these are leaf elements and cannot have any children assigned. “Parent1” returns the value 3 for each of the elements that belong to it. The same situation applies when “GrandParent” is used as the argument, resulting in 2.

In order to obtain the name of a parent element to a child element, we can use the function ELPAR. ELPAR requires an additional numeric argument that should correspond to the number of parents that the referenced element belongs. If a number provided does not match valid number of parents, the result will be a null string.

ELPAN(  dimension , assumed-Child , Parent# )

ELPAR(  ‘Family’ , ‘Child2’ , 0 ) = ‘’

ELPAR(  ‘Family’ , ‘Child2’ , 1 ) = ‘Parent1’

ELPAR(  ‘Family’ , ‘Child2’ , 2 ) = ‘Parent2’

ELPAR(  ‘Family’ , ‘Child2’ , 3 ) = ‘’

From the result shown above, when the numeric argument of 0 or 3 is used, a null string is returned. This is because those are not valid parent values for “Child2”, which only has 2 parents. Using valid arguments of 1 or 2 will return “Parent1” or “Parent2” respectively. The numeric index corresponds to the order in which the parentage was assigned. These references could change is certain hierarchies are updated differently than others.

The complement of ELPAR is ELCOMP, which relates to the child count an element would have.

ELCOMP(  dimension , assumed-Child , Child# )

ELCOMP(  ‘Family’ , ‘GrandParent’ , 0 ) = ‘’

ELCOMP(  ‘Family’ , ‘GrandParent’ , 1 ) = ‘Parent1’

ELCOMP(  ‘Family’ , ‘GrandParent’ , 2 ) = ‘Parent2’

ELCOMP(  ‘Family’ , ‘GrandParent’ , 3 ) = ‘’

The element “GrandParent” only has 2 children, so this would only return result for arguments of either 1 or 2 shown below. Arguments of 0 or 3, are not valid for this element and will return an empty string.

 

I hope at this point you have a better understanding of how these tools can be used. These functions are essential to maintain, manage, and analyze dimensions throughout your model.