consolidation multiplication

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: consolidation multiplication

Post by Duncan P »

Thanks Steve.

It occurred to me last night that this doesn't handle negative numbers at the leaf level. To do this you would need to take the absolute value and keep track of how many minus signs there were. Something like this :-

['isnegative'] = N:IF(0>['data'],1,0);
['iszero'] = N:IF(0=['data'],1,0);
['logarithm'] = N:LN(ABS(['data']));
['data'] = C:IF(0=['iszero'], EXP(['logarithm']) * (-1)^['isnegative'], 0 );
Gregor Koch
MVP
Posts: 263
Joined: Fri Jun 27, 2008 12:15 am
OLAP Product: Cognos TM1, CX
Version: 9.0 and up
Excel Version: 2007 and up

Re: consolidation multiplication

Post by Gregor Koch »

:ugeek:

Nice one Duncan, thanks for sharing.

Doesn't quite work for me with negative values, as I always get a positive result, but still....

EDIT: Just forgot to feed ['isnegative'], works like a treat now.
jstrygner
MVP
Posts: 195
Joined: Wed Jul 22, 2009 10:35 pm
OLAP Product: TM1
Version: 9.5.2 FP3
Excel Version: 2010

Re: consolidation multiplication

Post by jstrygner »

Duncan, just another wow and thanks from me for sharing this (old post, but I just found your solution).

What is additionally very impressive here is that your example does not care if you have parallel hierarchies in your dimension (along which you want to multiply) or not - it just does what is wanted!
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: consolidation multiplication

Post by Duncan P »

I haven't tried it but it should work with hierarchy weights as well - but with the proviso that a 0 means ignore, a -1 means divide and any other means multiply by the leaf to the power of the weight, so a weight of 2 would mean multiply twice, and a weight of -1/2 would mean divide by the square root. I have no idea why you might need non 0, 1 weights but there you are.
Post Reply