Temporal rules can be used to calculate an amount for each month within a specified time period. To do this you would use an Interval Aggregate function (or a Filtered Interval Aggregate function if there are dependencies on the inclusion of values in the calculation). (See Calculate an amount in a time period for more information on these functions.)
For example, a family benefit is calculated on a daily rate that is summed to give an amount that is paid monthly. To calculate the family's monthly benefit you would use the Interval Daily Sum function as follows:
the family's monthly benefit = IntervalDailySum(the start of the payment month, the start of the following month, the family's daily benefit)
To calculate the start of the following month, you use the Add Months function as follows:
the start of the following month = AddMonths(the start of the payment month, 1)
Using these rules you would need to enter the start date of the payment month as an input. It might be preferable, however, to have the start of the payment month as a time-varying attribute which gives the start date of the current month. To do this, you would add the following rule using the Temporal Months Since function:
the start of the payment month = AddMonths(the start date, TemporalMonthsSince(the start date, the end date))
If you wanted to calculate the start date of every month from the specified start date onwards for 20 years, you could replace 'the end date' in the rule above with a variable which calculates 20 years from the specified start date (using the Add Years function).
the start of the payment month = AddMonths(the start date, TemporalMonthsSince(the start date, AddYears(the start date, 20)))
Using these rules, the rulebase would return the family's monthly benefits for each month within the specified 20 year time period.
In a similar way you could calculate a weekly or yearly amount using the Add Weeks and Add Years functions in place of the Add Months functions.