TM1 rule-Consolidation and N level
-
- Posts: 57
- Joined: Fri Sep 17, 2010 11:57 am
- OLAP Product: TM1
- Version: 9.5.2
- Excel Version: 2003
TM1 rule-Consolidation and N level
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
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
-
- Regular Participant
- Posts: 152
- Joined: Sat May 25, 2013 10:32 am
- OLAP Product: TM1
- Version: 9.5.2; 10.2.2
- Excel Version: 2007
Re: TM1 rule-Consolidation and N level
Hi Abi,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
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
-
- Posts: 33
- Joined: Mon Sep 23, 2013 3:24 pm
- OLAP Product: TM1
- Version: 10.2
- Excel Version: Excel 2010
Re: TM1 rule-Consolidation and N level
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)
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)
The Java_to_TM1 Convert
TM1 Version 10.1, 10.2, Cognos Insight 10.1, 10.2
Local: Windows 7 Professional, Excel 2007
Server: Windows Server 2008 64-bit
p.s. I have a healthy disregard for Performance Muddler.
TM1 Version 10.1, 10.2, Cognos Insight 10.1, 10.2
Local: Windows 7 Professional, Excel 2007
Server: Windows Server 2008 64-bit
p.s. I have a healthy disregard for Performance Muddler.
-
- Posts: 57
- Joined: Fri Sep 17, 2010 11:57 am
- OLAP Product: TM1
- Version: 9.5.2
- Excel Version: 2003
Re: TM1 rule-Consolidation and N level
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?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)
-
- Posts: 16
- Joined: Tue Mar 29, 2011 12:47 pm
- OLAP Product: TM1/Cognos Express
- Version: 9.5.1 - 10.2
- Excel Version: 2003-2013
Re: TM1 rule-Consolidation and N level
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.
-
- Posts: 57
- Joined: Fri Sep 17, 2010 11:57 am
- OLAP Product: TM1
- Version: 9.5.2
- Excel Version: 2003
Re: TM1 rule-Consolidation and N level
I have Dim1 ,Dim2 , Dim3, Dim4 and measures dimension.deepakjain2020 wrote:Hi Abi,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
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
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.
-
- Posts: 57
- Joined: Fri Sep 17, 2010 11:57 am
- OLAP Product: TM1
- Version: 9.5.2
- Excel Version: 2003
Re: TM1 rule-Consolidation and N level
Thanks I will try this and come back.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.
-
- Regular Participant
- Posts: 424
- Joined: Sat Mar 10, 2012 1:03 pm
- OLAP Product: IBM TM1, Planning Analytics, P
- Version: PAW 2.0.8
- Excel Version: 2019
Re: TM1 rule-Consolidation and N level
Hi Jack,Abinaya wrote:Thanks I will try this and come back.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.
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
"You Never Fail Until You Stop Trying......"
-
- Regular Participant
- Posts: 152
- Joined: Sat May 25, 2013 10:32 am
- OLAP Product: TM1
- Version: 9.5.2; 10.2.2
- Excel Version: 2007
Re: TM1 rule-Consolidation and N level
It can be used.BariAbdul wrote:Hi Jack,Abinaya wrote:Thanks I will try this and come back.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.
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
Regrads,
Deepak Jain
-
- Posts: 16
- Joined: Tue Mar 29, 2011 12:47 pm
- OLAP Product: TM1/Cognos Express
- Version: 9.5.1 - 10.2
- Excel Version: 2003-2013
Re: TM1 rule-Consolidation and N level
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
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
-
- Regular Participant
- Posts: 424
- Joined: Sat Mar 10, 2012 1:03 pm
- OLAP Product: IBM TM1, Planning Analytics, P
- Version: PAW 2.0.8
- Excel Version: 2019
Re: TM1 rule-Consolidation and N level
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.
"You Never Fail Until You Stop Trying......"
-
- Posts: 16
- Joined: Tue Mar 29, 2011 12:47 pm
- OLAP Product: TM1/Cognos Express
- Version: 9.5.1 - 10.2
- Excel Version: 2003-2013
Re: TM1 rule-Consolidation and N level
I'd use it in any scenario where you call on dimension based logic such as the ELPAR suggestion mentioned before.
Jack
Jack
-
- Regular Participant
- Posts: 424
- Joined: Sat Mar 10, 2012 1:03 pm
- OLAP Product: IBM TM1, Planning Analytics, P
- Version: PAW 2.0.8
- Excel Version: 2019
Re: TM1 rule-Consolidation and N level
Thanks a lot Jack.
"You Never Fail Until You Stop Trying......"
- qml
- MVP
- Posts: 1096
- Joined: Mon Feb 01, 2010 1:01 pm
- OLAP Product: TM1 / Planning Analytics
- Version: 2.0.9 and all previous
- Excel Version: 2007 - 2016
- Location: London, UK, Europe
Re: TM1 rule-Consolidation and N level
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.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.
Kamil Arendt
-
- 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: TM1 rule-Consolidation and N level
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.