Page 1 of 1

TI process to update Approval Hierarchy from file

Posted: Thu Apr 09, 2015 12:46 pm
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 !

Re: TI process to update Approval Hierarchy from file

Posted: Thu Apr 09, 2015 1:07 pm
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.

Re: TI process to update Approval Hierarchy from file

Posted: Thu Apr 09, 2015 1:26 pm
by TheDiscreet
Thank you Garry for your reply.
Using your method the result is now as expected and the subset is static :D

Re: TI process to update Approval Hierarchy from file

Posted: Thu Apr 09, 2015 7:35 pm
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

Re: TI process to update Approval Hierarchy from file

Posted: Fri May 01, 2015 8:12 am
by AniketTambavekar
You can rather use a "SUBSETISALLSET" Function in Epilog. This will solve your purpose (I guess).