Page 1 of 1

Rules Passing children

Posted: Sat Feb 17, 2018 4:51 pm
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.

Re: Rules Passing children

Posted: Sun Feb 18, 2018 9:24 pm
by macsir
be more specific?

Re: Rules Passing children

Posted: Mon Feb 19, 2018 1:02 pm
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

Re: Rules Passing children

Posted: Mon Feb 19, 2018 2:07 pm
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' );


Re: Rules Passing children

Posted: Mon Feb 19, 2018 3:04 pm
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

Re: Rules Passing children

Posted: Mon Feb 19, 2018 9:13 pm
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

Re: Rules Passing children

Posted: Mon Feb 19, 2018 10:07 pm
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

Re: Rules Passing children

Posted: Mon Feb 19, 2018 10:21 pm
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?

Re: Rules Passing children

Posted: Tue Feb 20, 2018 7:04 am
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);