Pre Process and Post Process Formulas

When defining an earning or deduction element, you can assign it a pre process formula, a post-process formula, or both using the Calculation page.

  • A pre process formula is executed immediately before the resolution of the earning or deduction element.

    For example, you might use a pre process formula to retrieve data for use in the resolution of the earning or deduction.

  • A post process formula is executed immediately after the resolution of the earning or deduction element.

    For example, you can use a post-process formula to change the calculated value of an earning or deduction and its components before the resolved value is stored (in the PINV array) and becomes available for use elsewhere. You might use a post-process formula to enforce an annual limit for a deduction or to add an additional amount.

Pre process and post process formulas are executed for each instance of an element; however, you can use system elements to control when resolution occurs. PeopleSoft delivers numerous system elements for use with pre- and post-process formulas.

System Elements for Post Process Formulas

The following table lists the system elements that PeopleSoft delivers for use in post process formulas. As is true of all system elements, these elements resolve only if they are referenced in the process; for example, in a formula.

System Element Description

CURR x VAL (x = AMT, PCT, UNITS, BASE, or RT)

Stores the resolved value of the most recent instance of the amount or of the percent, unit, base, or rate component. This element is populated by the value of the amount immediately after the amount is calculated or by the value of the percent, unit, base, or rate component immediately after the component is resolved. This is after frequency conversion, proration, and rounding, if applicable, are applied. This value can be used as input for the post-process formula. CURR x VAL is updated by setting SET CURR x VAL to a nonzero number. The primary use of the system element is to check its value for the current amount or for the current percent, unit, base, or rate component of the deduction or earning.

OVRD CURR x VAL (x = AMT, PCT, UNIT, BASE, or RT)

Stores the value to be used to override the most recently resolved instance of the amount or of the percent, unit, base, or rate component. Think of this as the output of a post-process formula. You can assign override values to this set of elements.

OVRD CURR x VAL is updated by setting SET CURR x VAL to true (a nonzero number).

SET CURR x VAL (x = AMT, PCT, UNIT, BASE, or RT)

To override the value of the most recently resolved instance of the amount or of the percent, unit, base, or rate component, set this system element to a nonzero value. This causes the system to assign the value of OVRD CURR x VAL to the amount or to the percent, unit, base, or rate component.

Example

This example illustrates how you might use a post-process formula to enforce an annual deduction limit. After the system computes the deduction, it calls a post-process formula to determine whether the limit has been reached, and if so, what to do with the deduction.

Assumptions:

  • DD represents the deduction element.

  • YTD Limit Amt is a variable that represents the year-to-date limit amount.

  • Amt Over is a variable that represents the amount that exceeds the limit.

Here's what the code looks like:

If DD YTD Accum + CURR AMT VAL + DD Arrears Amt<= YTD Limit Amt
Then exit 

Else
DD YTD Accum + CURR AMT VAL + DD Arrears Amt - YTD Limit Amt = Amt Over 
CURR AMT VAL − Amt Over = OVRD_CURR_AMT_VAL
1 = SET CURR AMT VAL

To illustrate with numbers, assume that a deduction has an annual limit of 1,000. The payee's year-to-date balance for the deduction is 950. The deduction for the current period is 125, and there is no arrears balance. Processing occurs as follows:

If 950 + 125 + 0 <= 1000

then exit

else

950 + 125 + 0 - 1000 = 75

125 - 75 = 50

A value of 50 is assigned to the override element (OVRD_CURR_AMT_VAL), and the value of SET CURR AMT VAL is set to 1, so the system retrieves the value of the override element and assigns it to the deduction.

The rounding rule defined for the resolved amount is applied after the post-process formula.

Note:

Post-process formulas are resolved before arrears processing. Therefore, if you use a post-process formula to limit an amount, the amount that exceeds the limit that is defined in your formula does not update the arrears balance.

System Elements that Control the Timing of Resolutions

You can use delivered system elements to control when resolution of a pre- or post-process formula occurs. The following table lists some of the system elements that could be useful when you want to execute a pre- or post-process formula on a specific instance:

System Element Description

PI INSTANCE NUMBER

Positive input instance number. Resolves to the instance number if positive input exists. Otherwise, resolves to zero.

PI INSTANCE FIRST

First instance of positive input (Y / N). Resolves to Y for the first instance of positive input; otherwise resolves to N.

PI INSTANCE LAST

Last instance of positive input. (Y / N). Resolves to Y for the last instance of positive input; otherwise resolves to N.