DOLOOP

Returns the results of a formula that loops as long as the 'while' condition equals TRUE (1).

Formula Syntax

DOLOOP("Formula", "WhileFormula", ReturnType, ShowLoopResults (optional), "CalcDateFormula" (optional), "PaymentStartFormula" (optional), "AccountDateFormula" (optional), "SBCOFormula" (optional), "SumIfFormula" (optional))

"Formula": the name of the Formula Derived Item that is to be repeatedly calculated. Note that this formula name must be contained in quotes.

"WhileFormula": the Formula specified above will be repeatedly calculated until this Formula equals FALSE (0). Note that this formula name must be contained in quotes.

ReturnType: 0: Returns final value in loop, 1: Returns the sum of all values in loop (accumulation), 2: Returns final loop count (number of iterations that 'while' condition is satisfied).

ShowLoopResults (optional): set equal to TRUE (1) to display formula results of each loop iteration. The default is to not display such results but rather only show the final result.

"CalcDateFormula" (optional): specify the name of the Formula Derived Item that will return the Calculation Date to use with each loop iteration. Note that this formula name must be contained in quotes. Only use if this date needs to vary within the loop.

"PaymentStartFormula" (optional): specify the name of the Formula Derived Item that will return the Payment Start Date to use with each loop iteration. Note that this formula name must be contained in quotes. Only use if this date needs to vary within the loop.

"AccountDateFormula" (optional): specify the name of the Formula Derived Item that will return the Account Determination Date to use with each loop iteration. Note that this formula name must be contained in quotes. Only use if this date needs to vary within the loop.

"SBCOFormula" (optional): specify the name of the Formula Derived Item that will return the Small Benefit Cashout Date to use with each loop iteration. Note that this formula name must be contained in quotes. Only use if this date needs to vary within the loop.

"SumIfFormula" (optional): specify the name of the Formula Derived Item that will determine whether to include a loop result in the total (only applicable if ReturnType = 1). Note that this formula name must be contained in quotes. Only use if this date needs to vary within the loop.

Examples

DOLOOP("MyFormula", "UntilFormula", 1): Will return the sum of all values of "MyFormula" run while UntilFormula is TRUE.

Comments

For purposes of writing the formulas above, there are several key Formula Operands that are applicable all of which can be included in any formula within the plan.

LOOP_COUNT: indicates the current loop iteration (starting with 0).

LOOP_VALUEPRIOR: indicates the value of the prior loop iteration.

LOOP_VALUEACCUMPRIOR: indicates the accumulated value of the prior loop iteration (useful if accumulating some value within a loop).

PensionSoft Corporation | 860.540.3690 | support@pensionsoft.com