PeriodIndex

The PeriodIndex function allows to obtain an integer based on the current period which the script is evaluated for. Thus the following syntax

[LO].[X00000] := [C00000] / PeriodIndex;

allows to divide the value of the account C00000 by:

  • 1 when the assignment is evaluated for period 01;
  • 2 when the assignment is evaluated for period 02;
  • 3 when the assignment is evaluated for period 03;
  • ...
  • 12when the assignment is evaluated for period 12.

The PeriodIndex function can be used also in a parametric way, namely it is possible to write, for example, PeriodIndex(P3), where P3 (quarter) specifies the time range to consider, so as to have the following results:

  • 1 when the assignment is evaluated for periods 01, 04, 07, 10
  • 2 when the assignment is evaluated for periods 02, 05, 08, 11
  • 3 when the assignment is evaluated for periods 03, 06, 09, 12