Page 1 of 1

Question on TM1 rule function TODAY()

Posted: Tue Jul 27, 2010 9:46 am
by harrytm1
Hi all,

I'm planning to use the rule function TODAY() to obtain the current date, then use SUBST to extract YY-MM base on the 1st 5 characters in the returned date.

Is TODAY function dynamic such that the rule is always evaluating the current date? So I will see another YY-MM-DD tomorrow as compared to what I have seen today? Or is it base on the date that the rules are loaded into memory. If the latter is true, this will mean that TODAY is evaluated once only during rule loading, and then this same value is used until the rules are next compiled again.

I tried this before and I vaguely remember that it is static until the next rule compilation. Any ideas? Many thanks!

Re: Question on TM1 rule function TODAY()

Posted: Tue Jul 27, 2010 10:07 am
by Alan Kirk
harrytm1 wrote: I'm planning to use the rule function TODAY() to obtain the current date, then use SUBST to extract YY-MM base on the 1st 5 characters in the returned date.

Is TODAY function dynamic such that the rule is always evaluating the current date? So I will see another YY-MM-DD tomorrow as compared to what I have seen today? Or is it base on the date that the rules are loaded into memory. If the latter is true, this will mean that TODAY is evaluated once only during rule loading, and then this same value is used until the rules are next compiled again.

I tried this before and I vaguely remember that it is static until the next rule compilation. Any ideas?
Not sure where you picked up that idea from. We use the Today() function in rules in our TI control cube, and it always shows the date of calculation.

Re: Question on TM1 rule function TODAY()

Posted: Tue Jul 27, 2010 10:21 am
by lotsaram
The values of string rules are not cached, strings are re-evaluated every time they are queried. Although the value of the rule will not update itself in the background, it will return the correct value whenever the result is re queried. So from a user perspective the value will always be correct.

Re: Question on TM1 rule function TODAY()

Posted: Tue Jul 27, 2010 1:30 pm
by harrytm1
cool, this means that i can use TODAY() in the rule since it always re-evaluates when the derived value is recalculated.

thanks!