Page 1 of 1

Rule to write string from Consolidation to Leaf Element

Posted: Thu Apr 18, 2013 7:51 pm
by PavoGa
TM1 How to do String rules to feed or populate leaf elements from a consolidation.

We have a control cube where we want to populate the level 1 consolidation with a string value and automatically have the underlying leaf elements populated with the string value of their respective parents.



In the example, I want the three CCs populated with "Same" for Apr, May & June.

Current rule:

Code: Select all

FEEDSTRINGS; 
['CtrlValue'] = S: IF(SUBST(DB('CtrlCube', !Region, 'CtrlValue'),1,4) @= 'Cost', 
DB('CtrlCube', 'Region' | subst(DB('ctrlCube',!Region, !ctrlDim) 11,3) , 'CtrlValue'), CONTINUE); 
I do not get any errors, just the leaf elements are not populated.

Thanks,

Re: Rule to write string from Consolidation to Leaf Element

Posted: Thu Apr 18, 2013 7:59 pm
by declanr
PavoGa wrote:TM1 How to do String rules to feed or populate leaf elements from a consolidation.

We have a control cube where we want to populate the level 1 consolidation with a string value and automatically have the underlying leaf elements populated with the string value of their respective parents.



In the example, I want the three CCs populated with "Same" for Apr, May & June.

Current rule:

Code: Select all

FEEDSTRINGS; 
['CtrlValue'] = S: IF(SUBST(DB('CtrlCube', !Region, 'CtrlValue'),1,4) @= 'Cost', 
DB('CtrlCube', 'Region' | subst(DB('ctrlCube',!Region, !ctrlDim) 11,3) , 'CtrlValue'), CONTINUE); 
I do not get any errors, just the leaf elements are not populated.

Thanks,


I have had a few beers tonight so I could be wrong but does your rule actually relate to the cubeview you've attached a picture of?...


Assuming from the image that "same_store" is the string element from your measures dimension you could go with:

Code: Select all

['same_store']=S:
If ( Ellev ( 'ty_test', !ty_test ) > 0, STET, DB( 'Cube', Elpar ( 'ty_test', !ty_test, 1), !Period, 'same_store') );
However I would use an ATTRS rather than an Elpar so that you don't have to worry about moving hierarchies etc.

HTH