Defining Historical Rule Elements

To define historical rule elements, use the Historical Rules (GP_HIST_RULE) component.

Page Name

Definition Name

Usage

Historical Calculation Name Page

GP_PIN

Name the element and define its basic parameters.

Processing Period Page

GP_HIST_RULE1

Define the details of the processing period for the historical rule. Depending on what you select as the rule type, some fields may not be available for entry.

Parameters and Mapping Page

GP_HIST_RULE2

Define the formula for a historical rule.

You can use historical rule elements to set up rules that retrieve data from prior periods. Historical rules can be used in formulas.

A historical rule can be associated with any element that's stored in the Earnings/Deductions results table, Accumulators results table, or Other Elements results table.

To define a historical rule:

  1. Define the naming information for the historical rule on the Historical Rules Name page.

  2. Define the rule type and the periods to be processed on the Processing Period page.

  3. Define the formula for a historical rule on the Parameters and Mapping page.

You can attach a historical rule to an earning or deduction element on the Formula Definition page or to any element that's stored in the Earnings/Deductions results table (GP_RSLT_ERN_DED), Accumulators results table (GP_RSLT_ACUM), or Other Elements results table (GP_RSLT_PIN).

A historical rule resolves to one if it's successful and to zero if it's not successful. This works the same way as an array element. A historical rule can then be used in a formula such as:

IF HIST_RULE_TEST =1, THEN

Use variable elements populated by historical rule

ELSE

Generate an error

END-IF

A historical rule is set to one when either the end-of-process formula resolves without errors, or if that formula is not used in the processes, the stop-process-if-true variable is set to TRUE.

In all other situations, a historical rule is set to zero and SQL returns no data.

How the System Processes Historical Rule Elements

Here's how the system processes historical rules:

  1. The system dynamically creates SQL to load elements requested from the Absence Management result tables.

    It can get data from multiple result tables at one time by using a SQL UNION, meaning direct access to the database each time the historical rule is called. A SELECT and a series of FETCHES are performed each time. The use of this element type affects performance.

  2. The system maps columns to variables.

    The variables are available for use in a formula.

  3. The first fetch establishes the keys for the first retrieved segment.

    The program continues fetching records until there is a break in the segment keys. It then populates the input and output interface copybook (PINL) with the values for the retrieved elements or with the null values for the elements in the element mapping that were not found. Then the program requests the resolution of Formula to Execute By Segment.

  4. The system performs formula resolution per segment.

  5. The system resolves an end of process formula for additional calculations such as averaging.

This table lists how calendars and segments are processed in the reverse order in which they were initially run:

Original Processing Sequence

Processing Sequence for Historical Rules

January absence calendar

February absence calendar

February absence calendar

January absence calendar

Use the Historical Calculation Name page (GP_PIN) to name the element and define its basic parameters.

Navigation:

Set Up HCM > Product Related > Global Payroll & Absence Mgmt > Elements > Supporting Elements > Historical Rules > Historical Calculation Name

Note: You name every element and define its basic parameters on an element name page with the object name of GP_PIN. The page title and general appearance of this page change based on the type of Absence Management element that you are naming and defining.

Use the Processing Period page (GP_HIST_RULE1) to define the details of the processing period for the historical rule.

Depending on what you select as the rule type, some fields may not be available for entry.

Navigation:

Set Up HCM > Product Related > Global Payroll & Absence Mgmt > Elements > Supporting Elements > Historical Rules > Processing Period

This example illustrates the fields and controls on the Processing Period page.

Processing Period page

Note: On the Processing Period page, you create the periods from the date from to the date to date. You then map the selected result data to the processing periods. If no data exists for an element in a period, it is set to spaces for character and date elements and to zeros for numeric and monetary elements.

Field or Control

Description

Rule Type

Select the type of historical rule from these options:

Use in Fictitious Calculation: This is not used with Absence Management.

Retrieve Values: Select when you want to use a historical rule element in a formula to retrieve previously calculated values.

Go back from Date Range

Define the date from, date to type, date from element, and date to element to establish the rule's date range. If you select a Retrieve Values rule type, this field appears as Go Back From Date Range.

Select from the following values in the Date From Type and Date To Type fields:

Bracket

Cal Date (calendar date) Enter a date instead of an element that resolves to a date. In the next field, specify the date to start going back from.

Date

Formula

SystemElem (system element)

Variable

Use Based On

Select a date that tells the system which data values from the GP_RSLT tables are processed by a historical rule. Select from these values: Period End Date, Period Begin Date or Payment Date.

Log statement at run time

Select this check box to see the text of the SQL statement dynamically generated by the array module during batch processing. You can direct the output display into a file by selecting the Redirect Output option in PeopleTools Configuration Manager.

Example

You want to determine three months of salary (element SALARY) for the period between March 28 and June 27. This table lists the GP_RSLT table values:

Period Payment Date

Result

Period Begin

Period End Date

Payment Date

January 2003

100

January 1, 2003

January 31, 2003

February 2, 2003

February 2003

100

February 1, 2003

February 28, 2003

March 2, 2003

March 2003

100

March 1, 2003

March 31, 2003

April 2, 2003

April 2003

100

April 1, 2003

April 30, 2003

May 2, 2003

May 2003

100

May 1, 2003

May 31, 2003

June 2, 2003

June 2003

100

June 1, 2003

June 30, 2003

July 2, 2003

July 2003

100

July 1, 2003

July 31, 2003

August 2, 2003

If you select Period Begin Date, the historical rule processes only June, May, and April. It does not process July, because July 1, 2003 (the period begin date) is later than the date from date of the historical period (June 27, 2003). It also does not process March, because March 1, 2003 (the period begin date) is before the date to date of the historical period (March 28, 2003).

Note: Historical rules start from the date from date and look at periods and segments in the reverse order in which they were originally processed and go back to the date to date.

If you select Period End Date, the rule processes May, April, and March. It does not process June, because June 30, 2003 (the period end date) is later than the date from date of the historical period (June 27, 2003). It also does not process February, because February 28, 2003 (the period end date) is before the date to date of the historical period (March 28, 2003).

If you select Payment Date, the rule processes May, April, and March. It does not process June, because July 2, 2003 (the payment date) is later than the date from date of the historical period (June 27, 2003). It also does not process February, because March 2, 2003 (the payment date) is before the date to date of the historical period (March 28, 2003).

See the product documentation for PeopleTools: Data Management

Use the Parameters and Mapping page (GP_HIST_RULE2) to define the formula for a historical rule.

Navigation:

Set Up HCM > Product Related > Global Payroll & Absence Mgmt > Elements > Supporting Elements > Historical Rules > Parameters and Mapping

This example illustrates the fields and controls on the Parameters and Mapping page.

Parameters and Mapping page

When you run an absence run, the system resolves the Formula to Execute by Segment field per historical period until the Stop Process If True variable is not equal to zero or the last historical period is processed. The system then resolves the formula specified in the Formula To Execute at End field.

Field or Control

Description

Formula to Execute By Segment

Enter the formula to be resolved for each segment or period.

Stop Process If True

Enter a variable. The process keeps looping through periods, resolving the formula for each period, until this variable doesn't equal zero, the date to date is reached, or no more data is found.

Formula To Execute At End

Select the formula to resolve when period processing is completed.

Use Period If True

This field appears for Use in Fictitious Calculation rule types only. This is not used with Absence Management.

Element Mapping

The grid in the Element Mapping group box lists the elements for retrieval from the Absence Management result tables for a historical rule.

Field or Control

Description

Element Type

Select the type of element—such as the earning, deduction, or variable—to retrieve.

Historical Period Element

Enter the element that you want to retrieve.

Current Period Element

Enter the variable in which the retrieved value is to be stored. This variable becomes available for use in the Formula to Execute By Segment field.

Slice Option

Specify how the system resolves multiple instances of an element in the historical period. Values are:

  • Sum Slices: The system sums all slices.

  • Use Last Slice: The system uses the value of only the last slice.

  • Sum Slices - Current Empl Rcd: The system sums all slices, but only for rows of data where the EMPL_RCD equals the current EMPL_RCD.

  • Use Last Slice - Cur. Empl Rcd: The system uses the value of only the last slice, but only for rows of data where the EMPL_RCD equals the current EMPL_RCD.