Page 1 of 1

TM1 rule-Consolidation and N level

Posted: Thu Jul 03, 2014 4:50 am
by Abinaya
Hi,
I need a rule that is after calculating the average at the consolidation level need assign that value to N level elements.

Say Group average=10 and also I want that 10 to beassigned to leaf level elements for group average.

['Group Average']=C:['Kgs']\['Metres']; say this is 10

['Group Average']=N:[ Value 10 should be assigned here]


regards,

abi

Re: TM1 rule-Consolidation and N level

Posted: Thu Jul 03, 2014 9:37 am
by deepakjain2020
Abinaya wrote:Hi,
I need a rule that is after calculating the average at the consolidation level need assign that value to N level elements.

Say Group average=10 and also I want that 10 to beassigned to leaf level elements for group average.

['Group Average']=C:['Kgs']\['Metres']; say this is 10

['Group Average']=N:[ Value 10 should be assigned here]


regards,

abi
Hi Abi,

Can you please provide the structure of your consolidation and leaf level elements?
In both the statements you mentioned, same element. If that is the case then apply same calculation.

Regards,
Deepak Jain

Re: TM1 rule-Consolidation and N level

Posted: Thu Jul 03, 2014 10:53 am
by java_to_tm1
Assuming your cube has 4 dims dim1, dim2, dim3, dim4 and the measures dim has elements: Kgs, metres, GroupAverage

And assuming you want to average on a consolidated element 'Total of dim3' on dim3, your rule would look like this.

your Clevels rules should be fine, and your N level rule would go like this:
['Group Average']=N: DB (<cubeName>, !dim1, !dim2, 'total of dim3' , !dim4, 'Kgs') \ DB (<cubeName>, !dim1, !dim2, 'total of dim3' , !dim4, 'Metres');

Now, you may choose not to go to the top-level element in the dim. you may chose to go just to the say the immediate parent of the element. This can be done by using ELPAR ('Dim3, !dim3, 1 ).

(Caveat: Please note, for ELPAR to work consistently with predictiable results, your dim shouldnt have multilpe hierarchies. Each element should have exactly 1 parent)

Re: TM1 rule-Consolidation and N level

Posted: Thu Jul 03, 2014 11:41 am
by Abinaya
java_to_tm1 wrote:Assuming your cube has 4 dims dim1, dim2, dim3, dim4 and the measures dim has elements: Kgs, metres, GroupAverage

And assuming you want to average on a consolidated element 'Total of dim3' on dim3, your rule would look like this.

your Clevels rules should be fine, and your N level rule would go like this:
['Group Average']=N: DB (<cubeName>, !dim1, !dim2, 'total of dim3' , !dim4, 'Kgs') \ DB (<cubeName>, !dim1, !dim2, 'total of dim3' , !dim4, 'Metres');

Now, you may choose not to go to the top-level element in the dim. you may chose to go just to the say the immediate parent of the element. This can be done by using ELPAR ('Dim3, !dim3, 1 ).

(Caveat: Please note, for ELPAR to work consistently with predictiable results, your dim shouldnt have multilpe hierarchies. Each element should have exactly 1 parent)
Thanks for the reply. Group Average is done at the same cube so can I use the DB function? DB function is used only to derive value from source cube?

Re: TM1 rule-Consolidation and N level

Posted: Thu Jul 03, 2014 11:46 am
by jacktuckerman
Yes, you can use the DB function to reference the cube that you are writing a rule for, it's not exclusive to referencing other cubes.

Re: TM1 rule-Consolidation and N level

Posted: Thu Jul 03, 2014 11:52 am
by Abinaya
deepakjain2020 wrote:
Abinaya wrote:Hi,
I need a rule that is after calculating the average at the consolidation level need assign that value to N level elements.

Say Group average=10 and also I want that 10 to beassigned to leaf level elements for group average.

['Group Average']=C:['Kgs']\['Metres']; say this is 10

['Group Average']=N:[ Value 10 should be assigned here]


regards,

abi
Hi Abi,

Can you please provide the structure of your consolidation and leaf level elements?
In both the statements you mentioned, same element. If that is the case then apply same calculation.

Regards,
Deepak Jain
I have Dim1 ,Dim2 , Dim3, Dim4 and measures dimension.

Group Average at consolidation will calculate the sum of kgs\Sum of meters (C:['Kgs']\['Metres']). Once this is calculated I want to populate the leaf level with this value.

In another words If say Group average is 10 I want to populate leaf level elements in the Dim 4 with that value. If we have the facility to define to variable in TM1 rules then I could assign the value to that variable and then assign the variable to N level elements

['Group Average']=N:[ C:Group Average] this gives error but some thing like this I need. It's quite unusual way to assign consolidation value to leaf level value. But that is what I need.

Re: TM1 rule-Consolidation and N level

Posted: Thu Jul 03, 2014 11:54 am
by Abinaya
jacktuckerman wrote:Yes, you can use the DB function to reference the cube that you are writing a rule for, it's not exclusive to referencing other cubes.
Thanks I will try this and come back.

Re: TM1 rule-Consolidation and N level

Posted: Thu Jul 03, 2014 12:15 pm
by BariAbdul
Abinaya wrote:
jacktuckerman wrote:Yes, you can use the DB function to reference the cube that you are writing a rule for, it's not exclusive to referencing other cubes.
Thanks I will try this and come back.
Hi Jack,
The TM1 rules guide says you can use DB function on the same cube when you are refrencing the string element,As per your reply I infering it can be also be used for numeric elements also,Please confirm.Thanks

Re: TM1 rule-Consolidation and N level

Posted: Thu Jul 03, 2014 12:26 pm
by deepakjain2020
BariAbdul wrote:
Abinaya wrote:
jacktuckerman wrote:Yes, you can use the DB function to reference the cube that you are writing a rule for, it's not exclusive to referencing other cubes.
Thanks I will try this and come back.
Hi Jack,
The TM1 rules guide says you can use DB function on the same cube when you are refrencing the string element,As per your reply I infering it can be also be used for numeric elements also,Please confirm.Thanks
It can be used.

Regrads,
Deepak Jain

Re: TM1 rule-Consolidation and N level

Posted: Thu Jul 03, 2014 12:34 pm
by jacktuckerman
Not for the first time in a decade or so the documentation leads you up a blind alley, or, at least doesn't show you the whole route home.

A basic rule on a four dimension cube that states:

['Result']=N:['Element 1']*['Element 2'];

Can also be written as:

['Result']=N:DB('cubename',!dim1,!dim2,!dim3,'Element 1')*DB('cubename',!dim1,!dim2,!dim3,'Element 2');

And produce exactly the same result.

Jack

Re: TM1 rule-Consolidation and N level

Posted: Thu Jul 03, 2014 12:39 pm
by BariAbdul
Thanks Jack,But if yeilds same result then what sort of scenerios we need to use DB refrence on the same cube.Does it makes any difference in performance.

Re: TM1 rule-Consolidation and N level

Posted: Thu Jul 03, 2014 12:48 pm
by jacktuckerman
I'd use it in any scenario where you call on dimension based logic such as the ELPAR suggestion mentioned before.

Jack

Re: TM1 rule-Consolidation and N level

Posted: Thu Jul 03, 2014 12:56 pm
by BariAbdul
Thanks a lot Jack.

Re: TM1 rule-Consolidation and N level

Posted: Thu Jul 03, 2014 2:25 pm
by qml
BariAbdul wrote:Thanks Jack,But if yeilds same result then what sort of scenerios we need to use DB refrence on the same cube.Does it makes any difference in performance.
Performance is measurably worse when using DB references rather than the shorthand bracket notation. That is why it's best not to use the DB notation if you don't have to. You do have to use it if sourcing from another cube, doing any string calculations, or nesting any other rule functions in the reference.

Re: TM1 rule-Consolidation and N level

Posted: Thu Jul 03, 2014 5:03 pm
by tomok
Shorthand notation on the right-hand side of a rule statement is only appropriate where the source of formula is all self-contained in the same cube and you are not modifying element names. If you are either 1) using attributes for looking up values, 2) looking to another cube for values or 3) messing with element names like concatenating strings, using SUBST, TRIM, etc., then you have to use the DB reference. If the shorthand notation is not appropriate for what you are tring then you'll get a syntax error most of the time.