Calculation weirdness
Posted: Fri May 07, 2010 3:17 pm
I love the little treats that TM1 serves up on a Friday afternoon, it's almost as if it can tell my brain is beginning to shut down to protect itself from the weekends excesses.Especially impressive since this server is in another country....
Anyway..
A user reported that a calculated number keeps changing without them doing anything. Impossible I say! It seems it really is though.
The value is the result of a C level calculation on some KPI values, used to determine if a KPI should be summed or averaged on consolidated periods.
The rule is as shown below, the bit that applies is the section bracketed by #XXXXXXXXXXXXXXXXXXXXXXXXXX
All fairly straight forward stuff.
When the rule is first saved I get the correct result.
with the associated rule trace. However after repeated presses of the calculate button I get the following result. You will see that the result for Estime 1 has changed. Just to stress the only thing that I have done to make this change is repeated calcs of the cube view.
with the associated rule trace.
It's pretty repeatable (no server restart as yet), after a rule save the calculation works.
Following repeated recalcs the value changes.
So far it has only affected values in Estime 1, there are no rules that reference Estime 1 directly.
Once it goes wrong it goes wrong for all KPIs with the Moyen property but only for Estime 1.
I don't think I've seen this before, anyone else have anythoughts on what might be causing this?
I'm expecting/hoping it to be something that clears when I restart the server. I'd like to have some kind of logical explanation for this no matter how warped, I don't think I've ever seen the rule logic just break like this....
Edit :
Further check was to change
DB('Indicateur - Mois','Somme pour Moyen',!Cycle,!Entity,!Periods,!Indicateur - Mois) \
#divide by the number of periods
['Period Populated'],
to
DB('Indicateur - Mois','Somme pour Moyen',!Cycle,!Entity,!Periods,!Indicateur - Mois) /
#divide by the number of periods
['Period Populated'],
The soft fail (\) for the DIV zero issue would return 316 if populated periods was somehow returning zero so if I change the code to give a hard fail Div0 error (/) I should see 26 and then Div0 when the behaviour changes. I still get 26/316 so this change had no impact.
/EndEdit
All on 9.0SP3U9, keeping the old school alive!
Anyway..
A user reported that a calculated number keeps changing without them doing anything. Impossible I say! It seems it really is though.
The value is the result of a C level calculation on some KPI values, used to determine if a KPI should be summed or averaged on consolidated periods.
The rule is as shown below, the bit that applies is the section bracketed by #XXXXXXXXXXXXXXXXXXXXXXXXXX
Code: Select all
['Input']=C:
#When we are on C level for month then for some KPIS we need to take the value for the last period
#rather than allow the system to accumulate.
#If we are on the C level for periods and 0 level for all other dims ( some dims commented since they contain only 0 levels)
If ( Ellev('Periods', !Periods) >0 &
# Ellev('Book Indicateur', !Book Indicateur) =0 &
# Ellev('Cycle', !Cycle) =0 &
Ellev('Entity', !Entity) =0 ,
# Ellev('Indicateur - Mois', !Indicateur - Mois) =0 ,
#Calc where we allow the standard consolidation to apply
If (Attrs( 'Indicateur - Mois',!Indicateur - Mois, 'Month Sum Method')@='Standard',
#Then ignore this rule
stet,
#Month End, there are no more of these but I left the code in
If (Attrs( 'Indicateur - Mois',!Indicateur - Mois, 'Month Sum Method')@='Month End',
#Month end calculation, refer back to the last period
DB('Indicateur - Mois',!Book Indicateur,!Cycle,!Entity,
#Substitute in period reference
DB('Periods Properties',!Periods,'Last Period'),
!Indicateur - Mois),
#XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Average
If (Attrs( 'Indicateur - Mois',!Indicateur - Mois, 'Month Sum Method')@='Moyen',
#Refer to the Somme per Moyen book to get the total
DB('Indicateur - Mois','Somme pour Moyen',!Cycle,!Entity,!Periods,!Indicateur - Mois) \
#divide by the number of periods
['Period Populated'],
#XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Don't calculate the Summary, don't test for this since it shouldbe everythign else
0))),
When the rule is first saved I get the correct result.
with the associated rule trace. However after repeated presses of the calculate button I get the following result. You will see that the result for Estime 1 has changed. Just to stress the only thing that I have done to make this change is repeated calcs of the cube view.

Following repeated recalcs the value changes.
So far it has only affected values in Estime 1, there are no rules that reference Estime 1 directly.
Once it goes wrong it goes wrong for all KPIs with the Moyen property but only for Estime 1.
I don't think I've seen this before, anyone else have anythoughts on what might be causing this?
I'm expecting/hoping it to be something that clears when I restart the server. I'd like to have some kind of logical explanation for this no matter how warped, I don't think I've ever seen the rule logic just break like this....
Edit :
Further check was to change
DB('Indicateur - Mois','Somme pour Moyen',!Cycle,!Entity,!Periods,!Indicateur - Mois) \
#divide by the number of periods
['Period Populated'],
to
DB('Indicateur - Mois','Somme pour Moyen',!Cycle,!Entity,!Periods,!Indicateur - Mois) /
#divide by the number of periods
['Period Populated'],
The soft fail (\) for the DIV zero issue would return 316 if populated periods was somehow returning zero so if I change the code to give a hard fail Div0 error (/) I should see 26 and then Div0 when the behaviour changes. I still get 26/316 so this change had no impact.
/EndEdit
All on 9.0SP3U9, keeping the old school alive!