MagnitudeDifferenceToBeZero

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

MagnitudeDifferenceToBeZero

Post by macsir »

Hi,

Has anyone successfully implemented this in TM1 before? It seems not working in TM1 10.2 FP4 now. I have set this parameter in the config file and reboot the server. Using a rule like C = A \ B where B is tiny number such as .0000000000000004, I still got huge C? Is it supposed to be Zero according to the document?

MagnitudeDifferenceToBeZero
Sets the order of magnitude of the numerator relative to the denominator, above which the denominator equals zero when using a safe division operator.
Parameter type: optional, static

In rules and TurboIntegrator, there is a safe division operator (the backslash). With this, if you try to divide by zero, the result is zero, not undefined. If the denominator to the division is a calculated quantity, the result can be very close to zero, but not exactly zero, for example, .0000000000000004. By setting the MagnitudeDifferenceToBeZero parameter, you can specify how close a number can be to zero, relative to the magnitude of the numerator, to be considered as zero for the safe division operator.

Consider this example:

In the file Tm1s.cfg, set MagnitudeDifferenceToBeZero=14
The operation is A \ B

Note: Backslash (\) is the safe division operator in TurboIntegrator.
A = 1000 B = 1.5e-15
B is 18 orders of magnitude less than A
18 > 14, therefore the save division operator returns B=0
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
tomok
MVP
Posts: 2835
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: MagnitudeDifferenceToBeZero

Post by tomok »

I think this sentence is key:
By setting the MagnitudeDifferenceToBeZero parameter, you can specify how close a number can be to zero, relative to the magnitude of the numerator, to be considered as zero for the safe division operator.
What this says to me is it is to keep TM1 from returning a ridiculously large number from a division calculation simply because of the inherent problems with the floating point issue. For example, the rule calculated amount may supposed to be zero, but instead is .0000000087. One divided by zero (in safe division) is zero but one divided by .0000000087 is 114,942,528.74. This is clearly not what you intended to happen thus this setting to keep it from doing so.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
TrailRunnerMark
Posts: 9
Joined: Wed Mar 07, 2012 11:06 pm
OLAP Product: Cognos Express
Version: 10.2.2
Excel Version: 2007 2010
Location: Vancouver, Canada

Re: MagnitudeDifferenceToBeZero

Post by TrailRunnerMark »

I have not used this before but will test over the weekend. However the OP didn't say what the value of A was set to, or what the parameter was set to in the config file. The MagnitudeDifferenceToBeZero specifies the size ratio between the numerator and denominator, beyond which the safe division calculation will return zero.

As an example, if the OP divided 1 by .0000000000000004 but had the parameter set to 18 then zero would NOT be returned since those 2 numbers are less than 18 orders of magnitude apart.
User avatar
macsir
MVP
Posts: 785
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1
Version: PAL 2.0.9
Excel Version: Office 365
Contact:

Re: MagnitudeDifferenceToBeZero

Post by macsir »

Yes, please test it and let me know the result. Thanks.
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
User avatar
macsir
MVP
Posts: 785
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1
Version: PAL 2.0.9
Excel Version: Office 365
Contact:

Re: MagnitudeDifferenceToBeZero

Post by macsir »

Anyone has used it successfully before?
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
Post Reply