Sei sulla pagina 1di 95

Fast Formulas in Fusion HCM

Get the most out of new features

Elena Forrest, presenter


Senior Technical Support Engineer
Oracle Fusion HCM Support

Greg Clark, co-presenter


Senior Support Manager
Oracle Fusion HCM Support
June 11, 2014

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied upon
in making purchasing decisions. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole discretion of Oracle.

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 3
Join the MOS Community Challenge to win a Kindle Fire HD
Come by Support Central - Montego A

Support Central Hours:


• Tues – Thurs
• 9am – 4pm (PST)
• Montego A

Support Experts from EBS, Fusion, PeopleSoft, Taleo


Proactive Toolkits
My Oracle Support (MOS) Information
HCM Communities
Product and Support Tools Demos
One-on-One Assistance
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Fast Formulas in Fusion HCM

1 Introduction to Fast Formula


2 Formula Creation and Components
3 Formula Syntax
4 Fast Formula Examples
5 Troubleshooting Tips

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 5
Fast Formulas in Fusion HCM

1 Introduction to Fast Formula


2 Formula Creation and Components
3 Formula Syntax
4 Fast Formula Examples
5 Troubleshooting Tips

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 6
What is Fast Formulas
• Oracle FastFormula is a simple way to write formulas using English words
and basic mathematical functions

• You can write generic expressions for any calculation or comparison you
may want to repeat with different input values

+ =
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 7
Uses of Fast Formula
• Fast Formulas can be used across various Fusion HCM products to:
– Perform Payroll Calculations
– Define rules for paid time off (PTO) accruals
– Calculate absence duration
– Define custom calculations for benefits administration
– Edit rules for object group population for elements or people
– Validate Element Input Values or User-Defined Tables
– Validation and HCM Extracts

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 8
Uses of Fast Formula
• Different formula types are used across various parts of Fusion HCM
applications:
– Payroll
– Benefits
– Human Resources HCM Extracts
– Compensation Management
– Absence Management
– Time and Labor

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 9
Fast Formula Types
• Each formula must have a type which determines:
– How the formula can be used
– What contexts are automatically available to the
formula
– Which rules about the inputs and outputs apply

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 10
Formula Types
• There are more then 120 formula types available in Fusion HCM:

• Auto Indirect • Element Skip • Oracle payroll


• Balance adjustment • Extract Advanced • Payroll access to HR
condition • Payroll relationship group
• Calculation Method
• Extract criteria • Payroll run proration
• Calculation type
• Calculation utility • Extract record • Rate Conversion
• Extract rule • User table validation
• Deduction Component
Group • Legislative check • Work relationship group
• Element Input Validation • Net to gross • And more…

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 11
Formula Creation Methods
• Predefined
– Delivered with Oracle Fusion HCM
– Specific to the localizations (for example US tax calculation)
– Cannot and should not be modified
• User-Defined
– Users create their own fast formulas (for example input validation)
• Generated
– User setup and system generated from legislative templates (for example HCM
Extract generates formulas for blocks and items, element templates generate fast
formula for main and hidden elements)

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 12
Formula Levels
In Fusion fast formulas can be defined at global or legislation or level:
• Global
– Can be used at any legislation. These formulas do not have legislation data group
assigned to them (CALC_ARREARS)
• Legislation
– If formula is applicable to only one legislation it has legislation data group assigned to it
(US_TAX_MEDICARE)

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 13
How Formulas Are Used in Fusion HCM
• In Payroll Processing fast formulas are used to:
– Calculate element run results
– Prorate payroll results
– Perform legislative checks during the payroll run
– Specify rules for skipping an element during payroll processing

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 14
Payroll License Effect on Fast Formula Creation
• Depending on the payroll license setup in the Application Payroll fast
formulas will be created from different templates:
– HR_ONLY: a basic element is created but none of the formulas, balances, etc that are
required to process the element in Fusion Payroll
– PAYROLL_INTERFACE: earnings elements are created with all the formulas, balances,
etc required to process the element in the Calculate Gross Earnings process. Only
deduction is created
– PAYROLL: complete set of payroll-related element templates is available when
creating elements. The complete set of payroll-related element templates is available
when creating elements. These element templates assist in element creation and
automatically create and generate fast formulas for new elements
– NO LICENSE – fast formulas is available in other modules

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 15
How Formulas Are Used in Fusion HCM
• Benefits Administration formula usages
– Create rules, for example eligibility determination
– Post-election edits
– Service calculation
– Coverage amount limits
• Compensation Management formula usages
– Specify compensation worksheet defaults
– Process only specific employees
– Create unique hierarchy for compensation

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 16
How Formulas Are Used in Fusion HCM
• In Absence Management formulas are used to:
– Determine Accrual terms
– Calculate how much time is accrued, and how much time can be carried over to the
next accrual term
– Determine Vesting criteria
• Oracle Time and Labor
– Transform incoming data from a third party time keeping system for a payroll batch
loader
– Error and Warning validation of time entries
– Generate process results from employee reported entries

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 17
How Formulas Are Used in Fusion HCM
• Validation formula usages
– Check that element entry values are valid for the element
– Check element entries to a user defined tables
– Extract HCM data for archiving and reporting

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 18
How Formulas Are Used in Fusion HCM
• HCM Extract Formula Usages
– Extract HCM data for archiving and reporting

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 19
Fast Formulas in Fusion HCM

1 Introduction to Fast Formula


2 Formula Creation and Structure
3 Formula Syntax
4 Fast Formula Examples
5 Troubleshooting Tips

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 20
How to create Fast Formulas in Fusion HCM
• Navigation: Payroll Calculation > Manage Fast Formulas or from Setup and
Management task in Functional Setup Manager (FSM)

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 21
Ways to Create Fast Formulas: Text Editor
• Formula type determines the formula editor
• Most formulas are created with the text editor

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 22
Ways to Create Fast Formulas – Expression Builder
• Expression builder is used for formula types:
– Deduction Component Group
– Payroll Relationship Group
– Work Relationship Group
To add conditional or relations logic add a new row and add a condition such as AND,
OR, Greater than, Less than.

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 23
Expression Builder
• Expression builder allows:
– Formula creation based on the values chosen or entered in the Formula Details fields
– The user can enter many arguments in the Expression Editor wizard

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 24
Security
• Two duty roles are associated with Fast Formulas:
– FastFormula View Duty allows access to view formula definitions for validation and
calculations
– FastFormula Management Duty allows access to view and manage Fast Formula
definitions for validation and calculations

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 25
Seeded Roles
• At least one of the following Job Roles must be assigned to the user in
order to view and manage Fast Formulas:
– Benefits Administrator
– Benefits Manager
– Benefits Specialist
– Compensation Administrator
– Human Capital Management Application Administrator
– Human Resources Manager (can view only)
– Human Resources Specialist
– Payroll Manager

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 26
DEFAULT for PER_PER_*** is 'XXXX'
DEFAULT for PER_PER_DATE_OF_BIRTH is '01-JAN-1951' (date)
DEFAULT_DATA_VALUE for PER_EXT_CONT_CONTACT_TYPE is 'NA'
Sample Formula DEFAULT_DATA_VALUE for PER_EXT_CONT_*** is 'NA'
DEFAULT_DATA_VALUE for PER_EXT_CONT_DATE_OF_BIRTH is '01-JAN-1951' (date)
default for i is 1

ELIGIBLE = 'N'
l_default_value = '01-JAN-2013' (date)
l_per_*** = PER_PER_***
l_per_dob = PER_PER_DATE_OF_BIRTH
l_effective_date = GET_CONTEXT(EFFECTIVE_DATE, to_date('1951/01/01
00:00:00'))

i=1
while PER_EXT_CONT_CONTACT_TYPE.exists(i) loop
(
l_dep_dob=PER_EXT_CONT_DATE_OF_BIRTH[i]
if (PER_EXT_CONT_***[i] = l_per_*** ) then
( ELIGIBLE ='Y')
else
(If ( Add_months (l_per_dob,744) > l_effective_date ) or ( Add_months
(l_dep_dob,744) > l_effective_date ) then
(ELIGIBLE ='Y')
)
i=i+1
)
return ELIGIBLE

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 27
Formula Structure
• Each formula must have five sections:

ALIAS variable1 as var1 Alias section


DEFAULT for var1 is CONSTANT Default Section
INPUTS ARE hours, rate Inputs Section
var1 = expression
IF expression1 THEN statement section Calculation Section
[ELSE statement]
RETURN return1, return2 Return Section

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 28
Formula Inputs and Outputs
• Formulas can take input from the window, database, or a process such as a
payroll run and can return values or messages.

Page Inputs Values

Database Inputs Outputs

Process Inputs Messages

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 29
Three Types of Inputs
• Input Statements
– Values are passed at runtime
– Contents of inputs statement depends on formula type
• Database Items
– Values from the database
– Browse a list of database items from the Formula window or the Add Database Items
page of the Fast Formula Assistant
• Global Values
– Used for information that changes infrequently, but is often referenced
– Can be loaded via Batch Loader

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 30
Database Items Definition
• Database items (DBIs) is a code (route)
that points to a particular value in the
database.
– For example DBI
PER_ASG_ASSIGNMENT_STATUS_TYPE is
located in table PER_ALL_ASSIGNMENTS_F in
column ASSIGNMENT_STATUS_TYPE
(paf_asg.assignment_status_type)

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 31
Types of Database Items
• Static
– Static database items are predefined. They include standard types of information,
such as the gender, birth date, work location of an employee, or the start and end
dates of a payroll period. For example: PER_PER_MARITAL_STATUS
• Dynamic
– Dynamic database items are created automatically when you define:
• Elements and input values – element and input value names are DBI name prefix
FAST_SALARY_ELEMENT_AMOUNT_ENTRY_VALUE
• Formula Global Values
• Balances – balance name followed by balance dimension name is the DBI name
US_COUNTY_WITHHELD_REL_TU_COUNTY_PTD
• Grade rates, Pay Scale Rates, Absence types

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 32
List of Database Items
• There are more then 10,000 database items in the Fusion HCM
• List of DBIs and user Entities (UEs) for are available in
– Note 1565118.1 for release 5
– Note 1546399.1 for release 7 and above
• DBIs are used in various extracts, archives and reports across Fusion HCM

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 33
Database Items
• DBIs are read only values. Attempts to write to them will cause compilation
error
• Specific to the context they are used in
• DBI that returns multiple rows can not be assigned to a single variable
– Fusion Absence Management: Unable To Access Religion Related DBI In
CORE_ABSENCE_DURATION Fast Formula (Doc ID 1670627.1)
• The HR DBIs need to be called in a separate formula type called Payroll
Access to HR. This formula can then be called form the payroll formula. If
you query up a seeded formula of this type you can see the database items
you have access to. This is deliberate separation of functionality.

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 34
Alias Statements
• Some database items have long names
• Use an Alias statement to set up a shorter name to use within the formula
• Alias statement must be the first statement in the formula
• Aliases are optional

• ALIAS PER_PER_DATE_OF_BIRTH AS DOB


• ALIAS PER_PER_MARITAL_STATUS AS MARITAL_STATUS
• ALIAS PER_PERSON_EIT_EFF_BU AS B_UNIT

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 35
Defaults: DEFAULT
• Allows a value to be used for a formula input if a value is not provided.
• DBIs must be defaulted in the formula because they can be null
• Input values that can be null also must be defaulted

• DEFAULT FOR PER_PER_DATE_OF_BIRTH IS '0001/01/01


00:00:00' (date)
• DEFAULT FOR PER_PER_MARITAL_STATUS IS ' '
• DEFAULT FOR PER_PERSON_EIT_EFF_BU IS 0

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 36
Defaults: DEFAULT_DATA_VALUE
• Allows a value to be used for an array database item where individual data
values are NULL

• DEFAULT_DATA_VALUE for PER_EXT_CONT_CONTACT_TYPE is 'NA'


• DEFAULT_DATA_VALUE for PER_EXT_CONT_DATE_OF_BIRTH is
'01-JAN-1951' (date)

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 37
Checking for Defaults
• Use the WAS DEFAULTED to check if the DBI or input is null

IF HOURS_WORKED WAS DEFAULTED


THEN

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 38
Defaults
• The Defaults statement need to be places before the Input statements

DEFAULT FOR HOURS_WORKED IS 0


DEFAULT FOR HOURLY_RATE IS 25
INPUTS ARE HOURS_WORKED
WAGE = HOURS_WORKED * HOURLY_RATE
RETURN WAGE

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 39
Data Base Items
• Using Aliases and Default statements

• ALIAS PER_PER_DATE_OF_BIRTH AS DOB


• ALIAS PER_PER_MARITAL_STATUS AS MARITAL_STATUS
• ALIAS PER_PERSON_EIT_EFF_BU AS B_UNIT
• DEFAULT FOR DOB IS '0001/01/01 00:00:00' (date)
• DEFAULT FOR MARITAL_STATUS IS ' '
• DEFAULT FOR P B_UNIT IS 0

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 40
Calculation Section
• Calculation section is a core of the formula where values are calculated and
validated
• Includes assignment statements

IF (ANC_ABS_PLN_NAME='XX PTO ACCRUAL')


then(
IF(ANC_ABS_PLN_PLAN_UOM ='H')
THEN(
IF l_length_of_service < 3
THEN accrual = 10
ELSE IF((l_length_of_service =>3)

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 41
Return Section
• Returns values of local variables
• Passes calculations back to the application
• Single RETURN statement can return several variables
• Formulas stops executing after RETURN statement

RETURN travel_payment, message

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 42
Formula Creation
• Case Study: Fusion Payroll: How to Create and Modify a Fast
Formula(1579738.1)

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 43
Creating a Fast Formula

• Depending on the license type different formulas, balances will be created


• Main element and several hidden (“shadow”) elements are created

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 44
Fast Formulas in Fusion HCM

1 Introduction to Fast Formula


2 Formula Creation and Components
3 Formula Syntax
4 Fast Formula Examples
5 Troubleshooting Tips

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 45
Documentation on Fast Formulas
• Oracle Online Documentation Oracle Fusion Applications Fast Formula Guide
http://docs.oracle.com/cd/E38454_01/doc.1117/e36894.pdf (Release 7)
• Fusion Payroll: Fast Formula Frequently Asked Questions (FAQ) (Note 1579739.1)
• Fusion Payroll: Fast Formulas Troubleshooting Guide (Note 1560556.1)
• Case Study : Fusion Fast Formula: How to Create Fast Formula For Element Entry Input
Value Validation (Note 1615323.1)
• Case Study: Fusion Payroll: How to Create and Modify a Fast Formula (Note 1579738.1)
• Benefits Fast Formula Reference Guide for Oracle Fusion Benefits (Note 1456985.1)

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 46
Documentation on Fast Formulas
• Loading Data using Payroll Batch Loader - Technical Essay (Note 1590004.1)
• How to Enable Logging for Oracle Fusion Global Payroll (Note 1536245.1)
• How To Create New Global Values To Be Used In FF (Note 1637426.1)
• Extracts: Database Items (DBIs) and User Entities (UEs)(Note 1546399.1)
• Database Items for Extracts and Formulas in Oracle Fusion HCM (Note1565118.1)
• HCM Communities
https://community.oracle.com/community/support/fusion_applications/human_capital
_management_%28hcm%29

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 47
Variables
• There are three classes of variables:
– Input variables appear on INPUT statements and bring value into a formula
– Output variables appear in RETURN statements and return values from a formula. A
variable can be both input and output.
– Local variable can be used inside the formula.
• Variable can be changed during an assignment statement and referenced
within expressions
INPUTS ARE HOURS_WORKED
Wages = HOURS_WORKED * HOURLY_RATE
RETURN Wages

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 48
Global Values
• Global Values are used for information that changes infrequently, but is
often referenced
• Currently Global values can be loaded only via Batch Loader. User Interface
will be delivered later
• Documentation: How To Create New Global Values To Be Used In FF (Note
1637426.1)

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 49
Contexts
• Context is information that is always available to each formula type at run
• Contexts are available for certain formula types
• Examples of contexts:
– EFFECTIVE_DATE for the effective date the formula is executing
– PAYROLL_ID for the running payroll
– PERSON_ID identifying the person for whom the formula is executing
• Context values act as SQL bind values when database item values are
fetched from the database. They can also be passed into formula function
calls.

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 50
Context Change
• Use CHANGE_CONTEXTS to change any of these values dynamically within
the formula
• After leaving the context changing block any changed context values are
restored to their previous values
• Example: get manager person number in HCM extract:

CHANGE_CONTEXTS(PERSON_ID = TO_NUMBER(PER_ORG_ORGMGR_MANAGER))
(
RULE_VALUE = PER_PER_PERSON_NUMBER
)
RETURN RULE_VALUE

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 51
Contexts for Payroll
• GET_CONTEXT(context, default value) - returns a context's value if the
context is set, otherwise it returns the default value specified in its second
argument
– Example of how to get the effective date
l_effective_date =
GET_CONTEXT(EFFECTIVE_DATE,'0001/01/01 00:00:00'(date))

– Example of how to set the effective date

l_effective_date =
GET_CONTEXT(EFFECTIVE_DATE,to_date('01-JAN-1951'))

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 52
Contexts and GET_TABLE_VALUE Function
• GET_TABLE_VALUE function is used to get the value from User-Defined
Tables (UTDs)
• The formula type for the GET_TABLE_VALUE function must support the
LEGISLATIVE_DATA_GROUP_ID and EFFECTIVE_DATE contexts
– For example Batch Loader type formulas do not support contexts

VALUE = GET_TABLE_VALUE(TABLE, COLUMN, ROW ,DEFAULT-


VALUE)

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 53
GET_TABLE_VALUE Function
• All parameters and return value is of type TEXT. If DEFAULT-VALUE is
optional and if not provided and a value could not be found in the table
then a NO-DATA-FOUND error is raised. If DEFAULT-VALUE is provided and a
value could not be found then DEFAULT-VALUE is returned
• If DATE or NUMBER values are stored in the table then the return value
must be appropriately converted
• For 'match' processing, the column parameter must exactly match that on
the table
• For 'range' processing, the column parameter must be within the numeric
range for the column - this is in canonical format e.g. -1.2345

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 54
New Fast Formula Capabilities in Fusion
• Array processing
• Looping
• Working Storage Area
• New functions

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 55
Array Processing
• Formulas have array variables holding date, number, or text values.
• Arrays are similar to PL/SQL index-by tables
• Large arrays will result in excessive memory consumption
• Arrays can be used for inputs and local variables
• Formula functions cannot return array nor take array parameters
• Methods are provided to get the first and last indexes and to get the next
or prior index given an index
• Contexts cannot be array types
• Referencing an nonexistent index causes error

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 56
Looping
• WHILE-loop type is supported
• Allows to go through a set of values (users-defined tables, date tracked
values)

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 57
WHILE Loop Example
I = 1
N = 0
WHILE PER_PERSON_EIT_EFF_DT_ST.EXISTS(I) LOOP
(
IF (PER_EXT_RESET_EFFECTIVE_DATE[1] >
PER_PERSON_EIT_EFF_DT_ST[I]
AND PER_EXT_RESET_EFFECTIVE_DATE[1] <=
PER_PERSON_EIT_EFF_DT_END[I] ) THEN (
N = PER_PERSON_EIT_EFF_CO[I]
)
I=I+1
)
RULE_VALUE = TO_CHAR(N)
RETURN RULE_VALUE

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 58
Working Storage Area
• The working storage area is a mechanism for storing global values across
formulas. The values are accessed by name. The names are case-
independent.
• There are four working storage area call methods:
– WSA_EXISTS
– WSA_DELETE
– WSA_SET
– WSA_GET

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 59
Working Storage Area: Example

WSA_DELETE ('US_WORK_PAY_REL_ACTION_ID')
WSA_DELETE ('US_WORK_TAX_UNIT_ID')
WSA_DELETE ('US_WORK_JURISDICTION')

IF WSA_EXISTS ('US_EARN_PAY_REL_ACTION_ID',
'NUMBER_NUMBER') THEN
WSA_EXISTS ('US_EARN_PAY_REL_ACTION_ID')…

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 60
Calling Formula from a Formula
• A formula can be called from another formula
• When the formula runs, checks are performed to ensure the called formula
can be executed, and whether the specified input and output data types
are correct
• There are 4 methods available:
– IS_EXECUTE(formula name)
– EXECUTE(formula name)
– SET_INPUT(input [,value])
– GET_OUTPUT(output, default-value)

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 61
Calling Formula from a Formula Example
• Fusion Absence Management: Unable To Access Religion Related DBI In
CORE_ABSENCE_DURATION Fast Formula (Doc ID 1670627.1)
RELIGION = 'BBB'
assignment_id = GET_CONTEXT(HR_ASSIGNMENT_ID,1)

SET_INPUT('hr_asg_id',assignment_id)
EXECUTE('GET_RELIGION_FORMULA')
RELIGION = GET_OUTPUT('RELIGION','AAA')

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 62
New Functions in Fusion
• Many new functions are available in Fusion HCM
• Full list of functions in Fusion HCM is available in Fast Formula Guide
• Examples:
– Text functions to manipulate the data:
• GREATEST, INSTR, LEAST, LENGTH, LOWER, LPAD, LTRIM, REPLACE, RPAD, RTRIM, SUBSTR, TRIM,
UPPER
– Numeric formula functions:
• ABS, FLOOR, GREATEST, LEAST, MOD, POWER, ROUND, ROUNDUP, TRUNC
– Date formula functions:
• ADD_DAYS, ADD_MONTHS, ADD_YEARS, DAYS_BETWEEN, GREATEST, LAST_DAY, LEAST,
MONTHS_BETWEEN, NEW_TIME, NEXT_DAY, ROUND, TRUNC

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 63
Fast Formulas in Fusion HCM

1 Introduction to Fast Formula


2 Formula Creation and Components
3 Formula Syntax
4 Fast Formula Examples
5 Troubleshooting Tips

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 64
/***************************************************************
FORMULA NAME: Conference Travel Payment
Payroll Formula FORMULA TYPE: Oracle Payroll
DESCRIPTION: Calculate the travel payment for the Distance input value
for the Travel Payment element.
***************************************************************/
/***************************************************************
Change History: Name: <Enter your name> Date: <Enter Today’s Date>
Comments:
***************************************************************/
/* Database Items Default Statement Section */
DEFAULT FOR distance IS 0
DEFAULT FOR override_travel_rate IS 0
/* Inputs Statement Section */
INPUTS ARE distance, override_travel_rate
/* Calculation Section */
IF override_travel_rate WAS DEFAULTED
THEN
travel_payment = ROUND((distance * ZYX_COMPANY_TRAVEL_RATE),2)
ELSE
travel_payment = ROUND((distance * override_travel_rate),2)
/* Return Statement Section */
RETURN travel_payment

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 65
/**********************************************************************
FORMULA NAME: BEN_PER_SEL_RULE2
Benefits Formula FORMULA TYPE: Person Selection
DESCRIPTION: The formula selects employees based on person numbers.
Change History:
Name Date Comments
-----------------------------------------------------------------------
---------------------------------------------------
Nagaraj Hunur 22-Jan-2012 Initial Version
**********************************************************************/
/*=========== DATABASE ITEM DEFAULTS BEGIN =====================*/
DEFAULT for PER_ASG_PERSON_NUMBER IS '-1'
/*=========== DATABASE ITEM DEFAULTS ENDS======================*/
/*================ FORMULA SECTION BEGIN =======================*/
l_output = 'N'
l_per_number = PER_ASG_PERSON_NUMBER
if ( l_per_number = '1138' OR l_per_number = '1139' OR l_per_number =
'1140'
OR l_per_number = '1141' OR l_per_number = '100023' )
then
( l_output = 'Y' )
return l_output
/*================ FORMULA SECTION END =======================*/

• Reference: Benefits Fast Formula Guide, Note 1456985.1.

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 66
DEFAULT FOR PER_ASG_EFFECTIVE_START_DATE IS '0001/01/01 00:00:00'
(date)
Talent Formula DEFAULT FOR PER_ASG_ACTION_CODE IS ' '

l_Hire_Date = '2013/01/01 00:00:00' (date)


ELIGIBLE = 'N'

IF TRUNC(PER_ASG_EFFECTIVE_START_DATE) = TRUNC(l_hire_Date)
THEN
( ELIGIBLE = 'Y’ )
ELSE
( ELIGIBLE = 'N’ )

RETURN ELIGIBLE

• Process "Manage Eligibility Batch Process" has published certain performance documents
• Reference: communities thread https://community.oracle.com/thread/3562053

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 67
Input Validation
• Case Study : Fusion Fast Formula: How to Create Fast Formula For Element
Entry Input Value Validation (Note 1615323.1)

DEFAULT FOR ENTRY_VALUE IS 0


INPUTS ARE ENTRY_VALUE
IF ENTRY_VALUE <> 14
THEN
(FORMULA_MESSAGE = 'The amount is invalid, enter an
amount of 14.'
FORMULA_STATUS = 'E')

RETURN FORMULA_STATUS, FORMULA_MESSAGE

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 68
HCM Extract
• Data masking example:

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 69
HCM Extract
• Fast Formula is generated based on the data element criteria:

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 70
HCM Extract
• Example of filtering out terminated employees from HCM Extract:

DEFAULT for PER_ASG_ASSIGNMENT_STATUS_TYPE IS


'INACTIVE'

INCLUDE = 'FALSE'

IF (PER_ASG_ASSIGNMENT_STATUS_TYPE = 'ACTIVE') THEN (


INCLUDE = 'TRUE')

RETURN INCLUDE

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 71
Transformation Formula in Payroll Batch Loader
• Transformation formula is used in the Payroll Bath loader, it transforms the
data so it be loaded in the batch
• Time card data from Ceridian and KRONOS time keeping systems into the
Fusion HCM via bathes
• There are sample formulas available for Ceridian and KRONOS in the
Loading Data using Payroll Batch Loader - Technical Essay (Note 1590004.1)

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 72
Accrual Formulas
• Several PTO formulas are seeded in Fusion HCM

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 73
Fusion Time and Labor Formulas
• Several formulas are available in Fusion Time and Labor release 8
– Calculation formula divides defined daily or weekly reported time into calculated time
attributes for values above and below a defined threshold hours value
– Time entry rules formulas validate if reported time entries are greater than a defined
maximum hours value

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 74
Fast Formulas in Fusion HCM

1 Introduction to Fast Formula


2 Formula Creation and Components
3 Formula Syntax
4 Fast Formula Examples
5 Troubleshooting Tips

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 75
Writing Efficient Formulas
• Each input value requires a default value.
• Comments and white space do not affect efficiency.
–Comment your formula abundantly, does not effect performance
• Application does not resolve Alias statements until it uses the statement
• Make a backup copy
• Upgrade can change pre-defined formulas and invalidate user defined
formulas. Check release notes for seeded formula changes.

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 76
Database Items
• An input value is more efficient than using a database item
• Refer to a database item or balance only when it is required by your
formula
• Do not assign a database item to a local variable
• Understand priorities for your “IF” statements and sequences to design for
minimal database item resolution.

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 77
Functions
• Passing an optional date parameter in a function call may change or lose
context in a payroll process
• When possible, create database items or balances instead of functions for
prior values
• GET_TABLE value function uses contexts and cannot be used in formula
types has no context usages (for example Batch Loader formula type).

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 78
Compile Fast Formulas
• Use bulk formula compile
– Navigate to Payroll > Checklists. Click on Submit a Process or Report. Select Compile
Formula flow pattern
• Re-generate and compile all formulas for HCM extract
• Compile formulas after an upgrade
• If the function was changed, formula needs to be re-compiled

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 79
Common Errors
• “Local value used before initialized” error can mean that a database item is
not available and is being treated as a local variable
• Formula type determines which database items are available
• Database items rely on contexts which are predefined for each formula
type

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 80
Performance Guidelines
• The more elements entered for an assignment, the longer its processing
time
• The longer the formula, the longer its processing time
• One element associated with a longer formula usually processes faster than
two related elements each associated with short formulas
• The number of elements per assignment affects processing time more than
the number of elements and formulas
• Use balance dimensions for single assignments whenever possible
(ASG_TRU_ vs. PER_)

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 81
Performance Guidelines
• Do not refer to database items until needed
• Do not default unnecessary database items
• Input statements are up to 10x faster than using database items
• Using an ALIAS instead of assigning a database item to a local variable is
more efficient
• Assign date constants using DATE component instead of the TO_DATE
function

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 82
Contexts and Performance
• Payroll Formulas
– Consider the order of entities that payroll acts upon:
– Assignment - multiple assignments mean context change
– Elements - more elements usually increase processing time
– Database Items - each reference requires resolution
– Contexts - changes require database call
– Avoid calling formula from a formula
– Use latest balances tables

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 83
Logging and Tracing
• How to Trace and Log Fast Formulas in Fusion Payroll (Doc ID 1559909.1)
• Logging to ESS log
• Tracing
• Output message

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 84
Fast Formula Logging
• Logging to ESS log
RET = PAY_INTERNAL_LOG_WRITE ('[Loan_VOL_DEDN_CALCULATOR]
Arrears_Balance = '||to_char(Arrears_Balance))
• Logging with GM parameters will output fast formulas
PAY_INTERNAL_LOG_WRITE messages into the ESS log
• Navigation to turn the logging on: Manage Payroll Process Configuration

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 85
HR_TRACE
• HR_TRACE function is still available in Fusion HCM
ret = HR_TRACE ('This is My debug message')
ret = HR_TRACE ('This is My debug message'||to_char(l_val))
• It is more efficient to use an application-specific logging than HR_TRACE
• Cloud and On-Demand customers do not have direct access to the trace file

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 86
Fast Formula Output Messages
• Output is available for certain Fast Formula types
• Output message can be viewed in View Person Run Results page
mesg2='Test debug'
RETURN flat_amount, clear_addl_amt, clear_repl_amt, neg_earn,
STOP_ENTRY, mesg, mesg2

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 87
Fusion Logging
• How to Trace and Log Fast Formulas in Fusion Payroll (Note 1559909.1)
• Fusion Applications Troubleshooting Overview Master Note (Note 109.1)
• How To Get The Most From Fusion Applications Diagnostic Logging (Note
1310286.1)
• FAQ on Configuring Fusion Applications Logging (Note 1380027.1)

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 88
References on Fast Formulas
• Oracle Online Documentation Oracle Fusion Applications Fast Formula Guide
http://docs.oracle.com/cd/E38454_01/doc.1117/e36894.pdf (Release 7)
• Fusion Payroll: Fast Formula Frequently Asked Questions (FAQ) (Note 1579739.1)
• Fusion Payroll: Fast Formulas Troubleshooting Guide (Note 1560556.1)
• Case Study: Fusion Payroll: How to Create and Modify a Fast Formula(Note 1579738.1)
• Case Study : Fusion Fast Formula: How to Create Fast Formula For Element Entry Input
Value Validation (Note 1615323.1)
• Fusion Global Payroll: Types Of License In Fusion Payroll (Note1611941.1)
• Benefits Fast Formula Reference Guide for Oracle Fusion Benefits (Note 1456985.1)

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 89
References on Fast Formulas (Cont’d)
• Loading Data using Payroll Batch Loader - Technical Essay (Note 1590004.1)
• How to Enable Logging for Oracle Fusion Global Payroll (Note 1536245.1)
• How To Create New Global Values To Be Used In FF (Note 1637426.1)
• Extracts: Database Items (DBIs) and User Entities (UEs)(Note 1546399.1)
• Database Items for Extracts and Formulas in Oracle Fusion HCM (Doc ID 1565118.1)
• DBIs For HR Fields Are Not Compiling In Payroll Fast Formulas (Doc ID 1589192.1)
• HCM Communities
https://community.oracle.com/community/support/fusion_applications/human_capital
_management_%28hcm%29

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 90
Communities
• Use HCM Communities to benefit from questions of others and receive answers to your
questions

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 91
OHUG Global Conference 2014
Thank you for attending. Please remember
to complete your evaluation of this session
in the mobile app by selecting the thumbs
up icon in the session.

Each session evaluation submission in the


mobile app equals one entry into a raffle for
$75 gift cards!

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |


Q&A
• Post-session questions can be directed to Elena (elena.forrest@oracle.com) and Greg
(gregory.clark@oracle.com)
• Please prefix e-mail subject with OHUG FF
• Question and answers with be posted in MOS Communities at
https://community.oracle.com/community/support/fusion_applications/human_capital
_management_%28hcm%29

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 93
Safe Harbor Statement
The preceding is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied upon
in making purchasing decisions. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole discretion of Oracle.

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 94

Potrebbero piacerti anche