Page 1 of 1

TM1 rule calculation problem with decimal places

Posted: Mon Sep 15, 2014 12:28 pm
by stw
Hello,

I have a problem in TM1 9.5.2 (9.5.20100.18046, 64 Bit, Excel 2013, Perspectives) with data with decimal places in tm1 rule calculations.

In this example, I have a time dimension
( ‘Time’,
consolidated element: Year
leaf Elements: Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sept, Oct, Nov, Dec)

and a measure dimension:
‘measures’ with two measures (‘measure1’ , ‘measure2’)

I have a rule that looks for ‘measure2’ / ‘Year’:

Rule:

['measure1'] =N:if(['measure2,'Year']= 100, 100, 1);

If the measure2 is 100 , then the measure1 should be 100, too (for the leaf elements)

This works fine, but if I use 4 decimal places for the leaf elements even if the measure2 is 100 for year, in some cases like the one in the picture attached,
the rule behaves like the measure2 is not 100. The separator for the decimal places is ‘,’ .
Am I doing something wrong or might this be a tm1 bug (rounding problem) ?

Thanks in advance,

Steffi

Re: TM1 rule calculation problem with decimal places

Posted: Mon Sep 15, 2014 12:41 pm
by declanr
is the value actually 100 EXACTLY? Because that is what your rule is looking for it to be but since your screenshot is to just a few decimal places it is not possible to tell.

Re: TM1 rule calculation problem with decimal places

Posted: Mon Sep 15, 2014 1:02 pm
by jim wood
I agree with Declan. It looks like a formatting issue, rather than a rule issue.

Re: TM1 rule calculation problem with decimal places

Posted: Mon Sep 15, 2014 1:51 pm
by stw
Hi and thanks for your replies,

@Declan: Yes, the value is exactly 100 .
I have entered the values manually as you can see them in the screenshot .
Now the strange thing is that if I switch the values of Sep and Oct (6,9124 and 6,9136) it works and if I Switch them back, it doesn't work again.
The weight of all leaf elements is default (1)

Regards,

Steffi

Re: TM1 rule calculation problem with decimal places

Posted: Mon Sep 15, 2014 4:05 pm
by jim wood
Are there any other rules higher up the rule file that could be causing this?

Re: TM1 rule calculation problem with decimal places

Posted: Tue Sep 16, 2014 8:52 pm
by lotsaram
stw wrote:Hi and thanks for your replies,

@Declan: Yes, the value is exactly 100 .
I have entered the values manually as you can see them in the screenshot .
Now the strange thing is that if I switch the values of Sep and Oct (6,9124 and 6,9136) it works and if I Switch them back, it doesn't work again.
The weight of all leaf elements is default (1)

Regards,

Steffi
Could be an issue with how the numbers are stored as floating point long decimal. How exactingly does the result need to sum to 100?
Why not IF( RoundP(['measure2','Year'],5) = 100, 100, 1 )
If it is because the sum is actually evaluating as 99.9999999999 or 100.0000000001 then adding rounding into the if test should solve it.