Workforce Compensation Fastformula Reference Guide: Contexts
Workforce Compensation Fastformula Reference Guide: Contexts
Workforce Compensation Fastformula Reference Guide: Contexts
Prepared by
Authors: David Manoharan
Introduction
Fast formulas are generic expressions of calculations or comparisons that you want to repeat with different
input variables.
• You can use fast formulas to:
• Define custom calculations for compensation
• Validate element inputs or user-defined tables
• Edit the rules for object group population for elements or people
When setting up a compensation plan, you can select the defined formula after
you select Formula as the Compensation Start Date value.
Contexts
The following contexts are available to formulas of this type:
• EFFECTIVE_DATE
• HR_ASSIGNMENT_ID
Database Items
Database items are not available to formulas of this type.
Input Variables
The following input variables are available to formulas of this type:
Return Values
The following return variables are available to formulas of this type.
Return Value Data Type Required Description
Errors
CMP_VC_ALLOC_FORMULA_FAILURE - Error occurred during formula processing.
Sample Formula
This sample formula calculates the compensation start date to be 3 months later from the given date.
/*********************************************************
FORMULA NAME : Compensation Start Date Formula
FORMULA TYPE : Compensation Start Date
DESCRIPTION : Formula that returns Compensation Start Date to be 3 month
later of the given date
*******************************************************/
/*=========== DATABASE ITEM DEFAULTS BEGIN ==============*/
N/A
/*=========== DATABASE ITEM DEFAULTS ENDS ===============*/
/*=========== FORMULA SECTION BEGIN =====================*/
INPUTS ARE CMP_IV_EFFECTIVE_DATE (text)
DEFAULT FOR CMP_IV_EFFECTIVE_DATE IS '4012/01/01'
l_date = ADD_MONTHS(TO_DATE(CMP_IV_EFFECTIVE_DATE, 'YYYY/MM/DD'),3)
compensation_start_date = TO_CHAR(ldate, 'YYYY/MM/DD')
RETURN compensation_start_date
/*=========== FORMULA SECTION END =======================*
When setting up a compensation plan, you can select the defined formula after you select Formula as the
Compensation End Date value.
Contexts
The following contexts are available to formulas of this type:
• EFFECTIVE_DATE
• HR_ASSIGNMENT_ID
Database Items
Database items are not available to formulas of this type.
Input Variables
The following input variables are available to formulas of this type:
Return Values
The following return variables are available to formulas of this type.
Return Value Data Type Required Description
Errors
CMP_VC_ALLOC_FORMULA_FAILURE - Error occurred during formula
processing.
Sample Formula
This sample formula calculates the compensation end date to be 6 months later
of the given date.
/*********************************************************
FORMULA NAME: Compensation End Date Formula
FORMULA TYPE: Compensation End Date
DESCRIPTION: Formula that returns Compensation End Date
*******************************************************/
/*=========== DATABASE ITEM DEFAULTS BEGIN ==============*/
N/A
/*=========== DATABASE ITEM DEFAULTS ENDS ===============*/
/*=========== FORMULA SECTION BEGIN =====================*/
INPUTS ARE CMP_IV_EFFECTIVE_DATE (text)
DEFAULT FOR CMP_IV_EFFECTIVE_DATE IS '4012/01/01'
l_date = ADD_MONTHS (TO_DATE (CMP_IV_EFFECTIVE_DATE, 'YYYY/MM/DD'),6)
compensation_end_date = TO_CHAR(ldate, 'YYYY/MM/DD')
RETURN compensation_end_date
/*=========== FORMULA SECTION END =======================*/
Formulas for Workforce Compensation Plans
Formula Type: Compensation Currency Selection
The Compensation Currency Selection formula determines the currency associated with a workforce compensation
component.
Contexts
The following contexts are available to formulas of this type:
• EFFECTIVE_DATE
• HR_ASSIGNMENT_ID
Database Items
Database items are not available to formulas of this type.
Input Variables
The following input variables are available to formulas of this type.
Return Values
The following return variables are available to formulas of this type.
Return Value Data Type Required Description
Sample Formula
This sample formula determines if a person is selected for a plan based on their assignment_id.
/*******************************************************************
FORMULA NAME: Compensation Currency Selection Formula
FORMULA TYPE: Compensation Currency Selection
DESCRIPTION: It returns the currency code based on
component_id.
*******************************************************************/
/*=========== INPUT VALUES DEFAULTS BEGIN =====================*/
INPUTS ARE CMP_IV_ASSIGNMENT_ID (number), CMP_IV_PLAN_ID (number),
CMP_IV_PERIOD_ID (number), CMP_IV_COMPONENT_ID (number)
/*=========== INPUT VALUES DEFAULTS ENDS======================*/
/*================ FORMULA SECTION BEGIN =======================*/
DEFAULT FOR CMP_IV_COMPONENT_ID IS 0
l_curr_code = 'XXX'
IF (CMP_IV_COMPONENT_ID = 489) THEN
(
l_curr_code = 'USD'
)
ELSE IF (CMP_IV_COMPONENT_ID = 490) THEN
(
l_curr_code = 'GBP'
)
RETURN l_curr_code
/*================ FORMULA SECTION END =======================*/
You select the formula when you configure the worksheet display for a column using the Default Values tab on the
Define Column Properties window.
Contexts
The following contexts are available to formulas of this type:
• EFFECTIVE_DATE
• HR_ASSIGNMENT_ID
Define Elements, Balances, and Formulas 3-51
• PAYROLL_ASSIGNMENT_ID
Database Items
Database items are not available to formulas of this type.
Input Variables
The following input variables are available to formulas of this type.
Return Values
Use predefined names for return variables. The following return variables are available to formulas of this type.
Return Value Data Type Required Description
Contexts
The following contexts are available to formulas of this type:
• EFFECTIVE_DATE
• HR_ASSIGNMENT_ID
• PAYROLL_ASSIGNMENT_ID
Database Items
Database items are not available to formulas of this type.
Input Variables
The following input variables are available to formulas of this type.
Sample Formula
This sample formula determines the manager of a person when the assignment_id is passed.
/*******************************************************************
FORMULA NAME: Compensation Hierarchy Determination Formula
FORMULA TYPE: Compensation Hierarchy Determination
DESCRIPTION: Hierarchy determination fast formula which is based on
assignment_id
*******************************************************************/
/*=========== INPUT VALUES DEFAULTS BEGIN =====================*/
INPUTS ARE CMP_IV_ASSIGNMENT_ID (number), CMP_IV_PLAN_ID (number),
CMP_IV_PERIOD_ID (number)
/*=========== INPUT VALUES DEFAULTS ENDS======================*/
/*================ FORMULA SECTION BEGIN =======================*/
DEFAULT FOR CMP_IV_ASSIGNMENT_ID IS 0
L_PERSON_ID = '0'
L_ASSIGNMENT_ID = '0'
if ( CMP_IV_ASSIGNMENT_ID = 100000008154060 ) THEN
(
L_PERSON_ID = to_char(-999) //-999 indicates top level//Manager.
L_ASSIGNMENT_ID = to_char(-999)
)
ELSE
(
L_PERSON_ID = to_char(100000008153756)
L_ASSIGNMENT_ID = to_char(100000008154060)
)
RETURN L_PERSON_ID , L_ASSIGNMENT_ID
/*================ FORMULA SECTION END =======================*/
The Compensation Person Selection formula determines whether a person is selected for an associated workforce
compensation plan.
You select the formula when you run the Start Workforce Compensation Cycle process.
Contexts
The following contexts are available to formulas of this type:
• EFFECTIVE_DATE
• HR_ASSIGNMENT_ID
• PAYROLL_ASSIGNMENT_ID
Database Items
Database items are not available to formulas of this type.
Input Variables
The following input variables are available to formulas of this type.
Input Data Type Required Description
Return Values
Use predefined names for return variables. The following return variables are available to formulas of this type.
L_SELECTED Char N Y or N
Sample Formula
This sample formula determines if a person is selected for a plan based on their assignment_id.
/*******************************************************************
FORMULA NAME: Compensation Selection Formula
FORMULA TYPE: Compensation Person Selection
DESCRIPTION: Assignment_id based selection fast formula
*******************************************************************/
/*=========== INPUT VALUES DEFAULTS BEGIN =====================*/
INPUTS ARE CMP_IV_ASSIGNMENT_ID (number), CMP_IV_PLAN_ID (number)
/*=========== INPUT VALUES DEFAULTS ENDS======================*/
/*================ FORMULA SECTION BEGIN =======================*/
DEFAULT FOR CMP_IV_ASSIGNMENT_ID IS 0
l_selected = 'Y'
/* 100000008154095 - Ariel.Aimar@oracle.com - GBI data*/
If (CMP_IV_ASSIGNMENT_ID = 100000008154095) THEN
(
l_selected = 'N'
)
else
(
l_selected = 'Y'
)
RETURN l_selected
/*================ FORMULA SECTION END =======================*/
What's the difference between a formula compilation error and an execution error?
Compilation errors occur in the Manage Fast Formulas page when you compile the formula. An error message
explains the nature of the error. Common compilation errors are syntax errors resulting from typing mistakes.
Execution errors occur when a problem arises while a formula is running. The usual cause is a data problem, either
in the formula or in the application database.
If you need to compile many fast formulas at the same time, you can run the Compile Formula process on the
Submit a Process or Report page. Also, if you make any changes to a function after you have compiled a formula
that uses it, you need to recompile the formula for the changes to take effect.