Page 1 of 1

All Parents for n level element

Posted: Thu Jul 07, 2016 8:57 am
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

Re: All Parents for n level element

Posted: Thu Jul 07, 2016 10:22 am
by BariAbdul

Re: All Parents for n level element

Posted: Thu Jul 07, 2016 11:16 am
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);

Re: All Parents for n level element

Posted: Thu Jul 07, 2016 12:00 pm
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

Re: All Parents for n level element

Posted: Fri Jul 15, 2016 2:48 am
by gnampoothiry
Thanks BariAbdul