TI process to update Approval Hierarchy from file

Post Reply
TheDiscreet
Posts: 2
Joined: Thu Feb 19, 2015 9:41 am
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2013

TI process to update Approval Hierarchy from file

Post by TheDiscreet »

Hello everyone,
I have been trying to make a turbo integrator process that update a dimension, which works perfectly fine.
The problem is that dimension have an approval hierarchy subset so I need the process to update it as well, since it has to be static and therefore I can't write an MDX expression to make it dynamic.
In the Epilog tab, right after updating my dimension, I added this code to update the subset:

Code: Select all

SubsetDeleteAllElements('MyDimension', 'MySubset');
vIdx = DIMSIZ('MyDimension');
while (vIdx > 0);
	vElName = DIMNM('MyDimension', vIdx);
	SubsetElementInsert('MyDimension', 'MySubset', vElName, 0);
	vIdx = vIdx - 1;
end;
But the result I get doesn't place leaf elements under their parents elements. Oddly enough though, consolidated elements are placed under their respective parents and are expanded. This is the result I get:

Code: Select all

[-] Element 8
  [-] Element 7
    [+] Element 6
    [+] Element 5
Element 4
Element 3
Element 2
Element 1
The appropriate result would have to be this way:

Code: Select all

[-] Element 8
  [-] Element 7
    [-] Element 6
      Element 3
      Element 2
      Element 1
    [-] Element 5
      Element 4
How do I get the preferred result ? And are there implications to altering the approval hierarchy other than having to redefine security and redeploy the application ?
Thank you for your help !
User avatar
garry cook
Community Contributor
Posts: 209
Joined: Thu May 22, 2008 7:45 am
OLAP Product: TM1
Version: Various
Excel Version: Various

Re: TI process to update Approval Hierarchy from file

Post by garry cook »

The 0 in your argument is controlling the placement however easiest would probably be to do a SubsetCreatebyMDX then add and remove a dummy element to make it static if it truly can't be MDX driven. Saves messing about trying to determine the position, especially if there are multiple hierarchies and you can't rely on ELPAR.
TheDiscreet
Posts: 2
Joined: Thu Feb 19, 2015 9:41 am
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2013

Re: TI process to update Approval Hierarchy from file

Post by TheDiscreet »

Thank you Garry for your reply.
Using your method the result is now as expected and the subset is static :D
Wim Gielis
MVP
Posts: 3240
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: TI process to update Approval Hierarchy from file

Post by Wim Gielis »

garry cook wrote:The 0 in your argument is controlling the placement however easiest would probably be to do a SubsetCreatebyMDX then add and remove a dummy element to make it static if it truly can't be MDX driven. Saves messing about trying to determine the position, especially if there are multiple hierarchies and you can't rely on ELPAR.
Like for example explained here:
http://users.skynet.be/fa436118/wim/tm1 ... cks_EN.htm
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
AniketTambavekar
Posts: 9
Joined: Fri May 01, 2015 7:49 am
OLAP Product: Tm1 Cognos
Version: TM1 10.2.2
Excel Version: Excel 2010

Re: TI process to update Approval Hierarchy from file

Post by AniketTambavekar »

You can rather use a "SUBSETISALLSET" Function in Epilog. This will solve your purpose (I guess).
Post Reply