Consolidated rule question

Post Reply
Stéphane
Posts: 11
Joined: Mon Feb 27, 2012 9:55 am
OLAP Product: TM1
Version: 9.5.2 FP1
Excel Version: 2007

Consolidated rule question

Post by Stéphane »

Hi,

I'm trying tu build a simple rule doing something like ['measure']=C:min(1,['measure'});

(if at least one of my child value is 1, my value is 1, else 0)

it does not work, i got 'N/A' for consolidated levels (I assume it is because ['measure'] is defined by ['measure'] which does not please tm1).

I can do what i want if i create ['measure2']=C:min(1,['measure']);
but I do no want to create a specific measure for it.

Any way I can do what I want without create another measure ?

Thx,

Stéphane
tomok
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: Consolidated rule question

Post by tomok »

In TM1 rules syntax, what you have created results in a circular reference and will not work. The only way I know of, without creating something really convoluted, is the use the second measure.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
rozef
Posts: 74
Joined: Thu Jun 17, 2010 10:35 am
OLAP Product: TM1
Version: 9.4 9.5.1
Excel Version: 2003 - 2007

Re: Consolidated rule question

Post by rozef »

Hi Stephane,

you should try with consolidate children function with a condition to do that:

Code: Select all

['measure']= C:IF( ConsolidateChildren('<<measure_dimension>>') > 0, 1, 0 );
lotsaram
MVP
Posts: 3706
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Consolidated rule question

Post by lotsaram »

rozef wrote:Hi Stephane,

you should try with consolidate children function with a condition to do that:

Code: Select all

['measure']= C:IF( ConsolidateChildren('<<measure_dimension>>') > 0, 1, 0 );
Actually as per Stephane's example it would be

Code: Select all

['measure']= C:IF( ConsolidateChildren('<<measure_dimension>>') < 1, ConsolidateChildren('<<measure_dimension>>'), 1 );
This is a good idea in that it might avoid an explicit circular reference (but I'm not 100% sure on this have you tested?), however it's a bad idea in terms of performance and ConsolidateChildren should be avoided wherever possible. My preference would for sure be the same as Tomok's and to use a duplicate measure (which can always be made invisible to users with element security).
rozef
Posts: 74
Joined: Thu Jun 17, 2010 10:35 am
OLAP Product: TM1
Version: 9.4 9.5.1
Excel Version: 2003 - 2007

Re: Consolidated rule question

Post by rozef »

lotsaram wrote:Actually as per Stephane's example it would beCode: Select all['measure']= C:IF( ConsolidateChildren('<<measure_dimension>>') < 1, ConsolidateChildren('<<measure_dimension>>'), 1 );
I'm not sure of that...
lotsaram wrote:but I'm not 100% sure on this have you tested?
Sorry I havn't. I was just giving an idea.
rozef wrote:it's a bad idea in terms of performance and ConsolidateChildren should be avoided wherever possible
Personnaly, I never had any performance issue with this function, altough I used it for an algorithm of notation with about 1k society.
Duncan P
MVP
Posts: 600
Joined: Wed Aug 17, 2011 1:19 pm
OLAP Product: TM1
Version: 9.5.2 10.1 10.2
Excel Version: 2003 2007
Location: York, UK

Re: Consolidated rule question

Post by Duncan P »

I kind of get the feeling here that the leaf values are guaranteed to be either 1 or 0 and this is trying to do a consolidated logical OR.

If that is the case then the ConsolidatedMax should do it fine. If your measure can take other values at the leaf level and you really are trying to identify if any of them are 1 then I fear you will need another measure, e.g.

Code: Select all

['MeasureIsOneSomewhere'] = N: If ( 1 = ['Measure'], 1, 0 ); C: ConsolidatedMax( 0, 'cubename', !dim1, !dim2, ..., !measures );


ConsolidatedMax does not suffer from the performance problems that affect ConsolidateChildren because it works directly from the leaf descendents and not the direct children and so it can be sensitive to feeders.
Post Reply