Page 1 of 1

Parameterizing ConsolidateChildren?

Posted: Fri Nov 01, 2013 3:02 am
by fleaster
Ok let's take a simple example:

['LineA'] = ConsolidateChildren('Account');
['LineB'] = ConsolidateChildren('Account');
['LineC'] = ConsolidateChildren('Account');

...assuming I have multiple instances where a ConsolidateChildren is required, but dont wish to keep updating rules or hardcoding, what options are there to parameterize?

e.g. flag accounts that require consolidation and run an if statement?

Code: Select all

[] =  If(  AttrS('Account',Account,'Flag')@='Consolidate'  ,   ConsolidateChildren('Account'),  continue  ;
...would something like this work, or would it totally crash my cube? =)

Cheers,

Matt

Re: Parameterizing ConsolidateChildren?

Posted: Fri Nov 01, 2013 9:41 am
by David Usherwood
I use this where I want numbers added up but not fed. Here's an example from a real world, immense model:

Code: Select all

['Modelled',{'Value','Prior','Starting Value'}] =
  if(attrn('CR Line',!CR Line,'ConsolChildren') = 1,
  consolidatechildren('CR Line'),
#else
  continue);

Re: Parameterizing ConsolidateChildren?

Posted: Sat Nov 02, 2013 4:59 am
by fleaster
cool thanks for that :)

..out of curiosity, does anyone know what impact on memory it has, if ConsolidateChildren is turned on/off via parameters? e.g. I'm thinking like how Feeders tend to stay in memory, whether something similar occurs for Consolidate Children...

cheers :)

Matt

Re: Parameterizing ConsolidateChildren?

Posted: Sat Nov 02, 2013 9:04 am
by Duncan P
ConsolidateChildren is a function just like any other. When you (or any calculation) query a cell for which it is part of the calculation (and not bypassed by an IF) then it queries each of the direct children on the specified dimension(s), regardless of whether they are fed or not, and calculates each in turn. This is the reason for it's poor performance in some cases. The single-cell result and the constituent direct children from which it was derived can (and probably will) get put into the calculation cache, but that is all.

Re: Parameterizing ConsolidateChildren?

Posted: Sat Nov 02, 2013 10:03 am
by fleaster
i see.. thanks for the tip :)