This function calculates the average value of a given account over a specified number of prior periods. If the source is a balance type account, the average is based on the entered data. If the source is a flow type account, the average is based on the periodic data only.
The Average value will be derived differently based on the Periods parameter passed to the function.
If the Periods parameter is "YTD", the average value will be the sum of all periods in the current year up to the current divided by the current period number.
If the Periods parameter is "Periodic", the average value will be the sum of the current and immediately prior periods divided by 2. If the current period is the first period of the year, the average value will be the same value as the source.
If the Periods parameter is a number, the average value will be the sum of the current and each preceding period for the specified number of periods, divided by the specified number.