Rules Passing children

Post Reply
Analytics123
Posts: 128
Joined: Tue May 23, 2017 12:45 pm
OLAP Product: Tm1
Version: 9.5
Excel Version: 2010

Rules Passing children

Post by Analytics123 »

Based on certain condition I need to pass the childrens of a element in a rule .

Like
DB('Sales',!Customer)
I have to pass all childrens of selected customer .

Whats the function or syntax I can use to achieve this .

Thanks , any help is appreciated.
User avatar
macsir
MVP
Posts: 782
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1
Version: PAL 2.0.9
Excel Version: Office 365
Contact:

Re: Rules Passing children

Post by macsir »

be more specific?
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
Analytics123
Posts: 128
Joined: Tue May 23, 2017 12:45 pm
OLAP Product: Tm1
Version: 9.5
Excel Version: 2010

Re: Rules Passing children

Post by Analytics123 »

Based on attribute value , I I have to pass all the childrens for a selected customer for a certain case and customer itself in certain cases .


DB('Sales',!Customer)
or
DB('Sales',Childrens(!Customer))

I am not sure for the syntax to pass all CHildrens(!Customer).


Thanks
Drg
Regular Participant
Posts: 159
Joined: Fri Aug 12, 2016 10:02 am
OLAP Product: tm1
Version: 10.2.0 - 10.3.0
Excel Version: 2010

Re: Rules Passing children

Post by Drg »

Analytics123 wrote: Mon Feb 19, 2018 1:02 pm Based on attribute value , I I have to pass all the childrens for a selected customer for a certain case and customer itself in certain cases .


DB('Sales',!Customer)
or
DB('Sales',Childrens(!Customer))

I am not sure for the syntax to pass all CHildrens(!Customer).


Thanks
You should understand that the leaves can be located in different hierarchies and you can grab a some problems with this.

Enjoy

Code: Select all

['Customer_Flag']=
#Pass value from top hierarhy level
C: IF( ELPARN( 'Customer',  !Customer ) >0 
	,ATTRS( 'Customer' , ELPAR('Customer', !Customer, 1) , 'AttributeName' )
	, ATTRS( 'Customer' , !Customer , 'AttributeName' );
#Get value from first parent elemen	
S: ATTRS( 'Customer' , ELPAR('Customer', !Customer, 1#number of hierarhy) , 'AttributeName' );

Analytics123
Posts: 128
Joined: Tue May 23, 2017 12:45 pm
OLAP Product: Tm1
Version: 9.5
Excel Version: 2010

Re: Rules Passing children

Post by Analytics123 »

Hi I need to pass my childrens of the customer in the rule statement .

I was thinking some thing like ELCOMP etc..


I have this already working ,


if(Attrs('CUstomer',!Customer, 'Pass Children')=True, DB('Sales',Children(!Customer)), DB('Sales',!Customer).

I need the equivalent expression to get the childrens of the selected customer .

Thanks
Analytics123
Posts: 128
Joined: Tue May 23, 2017 12:45 pm
OLAP Product: Tm1
Version: 9.5
Excel Version: 2010

Re: Rules Passing children

Post by Analytics123 »

Any suggestion on this is appreciated.

Can you think of any other way to get the childrens .

If I use ELcomp it gives only one children. I need to pass all children.

COnsolidatechildren('Customers') worked but not sure that would affect performance.

Any other suggestions is appreciated
User avatar
paulsimon
MVP
Posts: 808
Joined: Sat Sep 03, 2011 11:10 pm
OLAP Product: TM1
Version: PA 2.0.5
Excel Version: 2016
Contact:

Re: Rules Passing children

Post by paulsimon »

Hi

I suggest that you read the TM1 Rules Guide. There is a section there on changing levels.

You cannot pass children to a rule. TM1 rules do not work on sets.

You can however make a rule at the base level work for all children of a consolidation which effectively achieves the same thing.

Regards

Paul Simon
User avatar
macsir
MVP
Posts: 782
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1
Version: PAL 2.0.9
Excel Version: Office 365
Contact:

Re: Rules Passing children

Post by macsir »

I don't think there is a way to get all children for a selected parent in the rule. Children function only exists in MDX.
If Consolidatechildren('Customers') by summing immediate children works for you, why can't you create some hierarchies instead for better performance?
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
Drg
Regular Participant
Posts: 159
Joined: Fri Aug 12, 2016 10:02 am
OLAP Product: tm1
Version: 10.2.0 - 10.3.0
Excel Version: 2010

Re: Rules Passing children

Post by Drg »

Analytics123 wrote: Mon Feb 19, 2018 3:04 pm I need the equivalent expression to get the childrens of the selected customer .
In one cell you want to pass that list of children? separated by what?
But of course this can be done BUT WHY?

Code: Select all

[]=S:ELCOMP(dimension, element, 1) | ' ; ' | ELCOMP(dimension, element, 2) ...
I mean this is slow logic for tm1.

if you need to transfer some children to a cube, then you need to add another dimension to this cube with the list from 0 to 100
and use the following rule

Code: Select all

['List']=S:ELCOMP(dimension, element, !List);
Post Reply