All Parents for n level element

Post Reply
gnampoothiry
Posts: 14
Joined: Fri Oct 24, 2008 9:18 am

All Parents for n level element

Post by gnampoothiry »

Hello Guys,

I have a dimension with multiple hierarchies. There is a n level element which has more than one parent in the different hierarchies of the dimension.

Is there a quick way / mdx to find out all the parents for a particular n level element of the dimension.

Thanks,
Girish
BariAbdul
Regular Participant
Posts: 424
Joined: Sat Mar 10, 2012 1:03 pm
OLAP Product: IBM TM1, Planning Analytics, P
Version: PAW 2.0.8
Excel Version: 2019

Re: All Parents for n level element

Post by BariAbdul »

"You Never Fail Until You Stop Trying......"
madan314
Posts: 4
Joined: Mon Nov 07, 2011 7:13 am
OLAP Product: Cognos Planning
Version: 8.4
Excel Version: 2007

Re: All Parents for n level element

Post by madan314 »

ELPAR function must help you , Set the Dimension view and following code should help you.
v1 is the variable declared in variables TAB

vHierarchy1 = ELPAR('Dimesnion',v1,1);

vHierarchy2 = ELPAR('Dimension',vHierarchy1,1);

vHierarchy3 = ELPAR('Dimension',vHierarchy2,1);

vHierarchy4 = ELPAR('Dimension',vHierarchy3,1);
BariAbdul
Regular Participant
Posts: 424
Joined: Sat Mar 10, 2012 1:03 pm
OLAP Product: IBM TM1, Planning Analytics, P
Version: PAW 2.0.8
Excel Version: 2019

Re: All Parents for n level element

Post by BariAbdul »

For that matter ,ELPARN is much more relevant to OP and this is what you could see in Wim Gielis post I have shared above ;

Code: Select all

ELPARN returns the number of parents of an element in a specified dimension.

Syntax

ELPARN(dimension, element)
Thanks
"You Never Fail Until You Stop Trying......"
gnampoothiry
Posts: 14
Joined: Fri Oct 24, 2008 9:18 am

Re: All Parents for n level element

Post by gnampoothiry »

Thanks BariAbdul
Post Reply