Reordering Element's Parents

Post Reply
fleaster
Regular Participant
Posts: 167
Joined: Wed Mar 30, 2011 11:57 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: XL2010

Reordering Element's Parents

Post by fleaster »

Hi all,
this should be a simple one - would like to reorder a Dimension that is set to Auto Sort by Hierarchy... Each element may roll up to 4 to 6 different parents.

Currently when performing an ELPAR on a leaf element, the "Internal structure" will appear at "#1", the "Legal structure" at "#2" etc. Say I wanted to change this order globally and have Legal appear as the #1 parent, Internal as #2 etc... Is there a quick way of doing this?
BigG
Community Contributor
Posts: 211
Joined: Tue Sep 15, 2009 11:13 pm
OLAP Product: IBMPA
Version: PA 2.0 Cloud
Excel Version: 2010

Re: Reordering Element's Parents

Post by BigG »

my experience with trying to control an index position of multiple herearchies is that you do not have much control of where a rollup sits...

I do not know the rest of the detail on what you are trying to acheive but I use TI code below when trying to find a rollup index

Code: Select all


If ( ElIsAnc (myDim,myrollup, elpar (myDim, myElem,1)) =1);
myentity= ELPAR(myDim, myElem,1));
ELSEIf ( ElIsAnc (myDim,myrollup, elpar (myDim, myElem,2)) =1);
myentity= ELPAR(myDim, myElem,2);
ELSEIf ( ElIsAnc (myDim,myrollup, elpar (myDim, myElem,3)) =1);
myentity= ELPAR(myDim, myElem,3);
endif;
GG
fleaster
Regular Participant
Posts: 167
Joined: Wed Mar 30, 2011 11:57 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: XL2010

Re: Reordering Element's Parents

Post by fleaster »

thanks for the quick response - I guess what I'm trying to do is actually change the Index Position of the rollups...

from previous experience, I know this can be done manually or by TI by removing an element from its parents then readding them back in the desired order... but as this doesnt feel very practical, I'm trying to understand how the Indexing of Rollups is actually governed or if there is a quicker way of doing it...
User avatar
Martin Ryan
Site Admin
Posts: 2003
Joined: Sat May 10, 2008 9:08 am
OLAP Product: TM1
Version: 10.1
Excel Version: 2010
Location: Wellington, New Zealand
Contact:

Re: Reordering Element's Parents

Post by Martin Ryan »

You only have two options: order by input or order alphabetically. So to facilitate this you'll either have to order your source data appropriately or put a counter in front of the element name to sort alphabetically. You could then use an alias to have the name on its own without the counter.

Martin
Please do not send technical questions via private message or email. Post them in the forum where you'll probably get a faster reply, and everyone can benefit from the answers.
Jodi Ryan Family Lawyer
fleaster
Regular Participant
Posts: 167
Joined: Wed Mar 30, 2011 11:57 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: XL2010

Re: Reordering Element's Parents

Post by fleaster »

Thanks Martin... ok I think I figured it out a way to do it by accident:

1. Reorder the Top Level Ancestors using "Set Dimension Order" - this will set the Dim to Manual sort
2. Expand all and resort by Hierarchy
3. Exit and Save
4. Edit Dimension Order and switch back to Auto Sort by Hierarchy

...not sure why it works, but it seems to do the trick... :)
User avatar
Martin Ryan
Site Admin
Posts: 2003
Joined: Sat May 10, 2008 9:08 am
OLAP Product: TM1
Version: 10.1
Excel Version: 2010
Location: Wellington, New Zealand
Contact:

Re: Reordering Element's Parents

Post by Martin Ryan »

That may work for the moment, but I wouldn't trust that it will stay that way. When something is auto sorted you lose control of how it's sorted.
Please do not send technical questions via private message or email. Post them in the forum where you'll probably get a faster reply, and everyone can benefit from the answers.
Jodi Ryan Family Lawyer
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: Reordering Element's Parents

Post by tomok »

Actually, what you are looking for is not the element order, but rather to control which tree get's the appropriate parent index number. This is important when you want to write a rule or TI based on the ELPAR index number. The only way to control that, that I know of, is to put the DimensionElementComponentAdd functions in your TI process in the correct order. Like the following:

DimensionElementAdd(Dim,ElementName,'N')
DimensionElementComponentAdd(Dim,Parent_Tree_1,Element,Tree_1)
DimensionElementComponentAdd(Dim,Parent_Tree_2,Element,Tree_2)
DimensionElementComponentAdd(Dim,Parent_Tree_3,Element,Tree_3)
DimensionElementComponentAdd(Dim,Parent_Tree_4,Element,Tree_4)

This way, the element will go in Tree_1 first, and if you did an ELPAR(Dim,Element,1) you would get back Parent_Tree_1, ELPAR(Dim,Element,2) you would get Parent_Tree_2, etc. I use this type of logic whenever I need to contol the parent index #. The only caveat here is that each element must go in each tree, if you have an element that only goes in three of the trees then all the parent index #s may not be accurate. If you have an element that goes in tree 1, 2 and 4, but not 3, then parent index #s 1 and 2 will match but the parent index # for tree 4 will actually return 3.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
fleaster
Regular Participant
Posts: 167
Joined: Wed Mar 30, 2011 11:57 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: XL2010

Re: Reordering Element's Parents

Post by fleaster »

thanks tomok... yeah I knew it could be done by re/adding the elements to each parent in the correct order, but seeing as I'm lazy I wanted to see if there was a quick and nasty way... :)
Post Reply