Page 1 of 1

Rule Help

Posted: Fri Oct 18, 2013 11:07 am
by abhijit4569
Hello,
I am newbie to TM1 development. I have came across and issue that needs a solution.
untitled.JPG
untitled.JPG (109.79 KiB) Viewed 1748 times
As you can see.
I want to calculate for all Phases in dimension in the following way
For Phase-10001000
Spend-Overheads (Allocated HO by RO) = 50 (In percentage)
So,

Code: Select all


['Phase-10001000','Spend-Overheads (Allcoated) in Crs'] = ['Project-1000', 'Spend-Overheads (Allocated HO by RO)'] * ['Phase-10001000', 'Spend-Overheads (Allocated HO by RO)']  / 100;

i.e  4.1 * 50 / 100 = 2.05

How to make this code dynamic so that it will apply to all phases of all projects, instead me hardcoding each and every phase.
In future they may add new phases so the code should work without adding a new code to the rule.

Re: Rule Help

Posted: Fri Oct 18, 2013 2:20 pm
by tomok
If your Project dimension is as clean as you show in the example, then all you need to do is replace the hard-coded reference to the parent of each phase and use the ELPAR function instead:

Code: Select all

['Spend-Overheads (Allcoated) in Crs'] = DB(CubeName,Dim1,Dim2,Dim3...ELPAR('Project',!Project),'Spend-Overheads (Allocated HO by RO)'] * ['Spend-Overheads (Allocated HO by RO)']  / 100;
You may need to tweak the code because I don't know the name of your cube nor the number of, or order of the dimensions in your cube but this is the general idea.