Fast Formulas
Fast Formulas
OVERVIEW
WHAT IS FAST FORMULAE?
BUSINESS PROCESSES – USING FAST
FORMULAE
FAST FORMULAE USAGES
FAST FORMULAE USAGES (PAYROLL)
FAST FORMULAE USAGES (BENEFITS)
FAST FORMULAE USAGES (COMPESNATION)
FAST FORMULAE USAGES (ABSENCE)
FAST FORMULAE USAGES (TIME & LABOR)
FAST FORMULAE USAGES (VALIDATIONS &
EXTRACTS)
FAST FORMULAE TYPES
FAST FORMULAE TYPES (CONTD…)
FAST FORMULAE TYPES (CONTD…)
FAST FORMULAE CREATION METHODS
WHERE CAN WE CREATE/ACCESS FAST
FORMULAS
Found in: Payroll Admin > Batch Loader > Globals type
DATABASE ITEMS DEFINITION
DATABASE ITEMS TYPES
DYNAMIC DATABASE ITEMS
Dynamic Database items are created automatically when you define:
Elements
The element name is the DBI name prefix.
Balances
The balance name followed by balance dimension name is the DBI name.
Input values
The element and input value names are the DBI name prefix.
Grade Rates
Pay Scale Rates
Absence Types
DATABASE ITEMS
Using Database Items
• To use a Database item in a formula, simply refer to it by name.
• To find the Database items you need, click Show Items on the Formula window and run
a query, or use the Search for Database Item Name feature available with the fast formula
Assistant
• Do not refer to Database items until you need them to avoid unnecessary database calls
• Formulas cannot be used to update Database items
• Where you have a choice use an Inputs statement instead of Database items — this is
more efficient.
DATABASE ITEMS
How to Find the Formula Type where you can use the particular DBI and the CONTEXT
which is required by the particular DBI?
Step 1:
To find the route id for the DBI which is required to Find Formula type where we can use this DBI,Input is DBI NAME:
select route_id from ff_user_entities_b where user_entity_id in
(select user_entity_id from ff_database_items_b where base_user_name
='HWM_PER_ASG_REL_DATE_START');
Step 2:
Query to find the Formula Type where we can use the Particular DBI with the DBI Route ID, Input is route_id:
select * from FF_FORMULA_TYPES_B where formula_type_id in
(select formula_type_id from FF_FTYPE_CONTEXT_USAGES where context_id in
(select CONTEXT_ID from FF_CONTEXTS_B where CONTEXT_ID in
(select CONTEXT_ID from
ff_route_context_usages where route_id in (300000000198407))
)
);
Step 3:
To find out the Context for the particular DBI , Input is DBI NAME:
select * from FF_CONTEXTS_TL where LANGUAGE='US' AND context_id in
(select CONTEXT_ID from FF_CONTEXTS_B where CONTEXT_ID in
(select CONTEXT_ID from ff_route_context_usages where route_id in
(select route_id from ff_user_entities_b where user_entity_id in
(select user_entity_id from ff_database_items_b where base_user_name
='HWM_PER_ASG_REL_DATE_START')
)
)
LIST OF DATABASE ITEMS
Please refer to the following documentation which contains list of DBIs per each
release:
Note 1565118.1 Database Items for Extracts and Formulas in Oracle Fusion HCM
New DBIs are delivered with each Monthly Release Update (MRU). Please run the
sql from the below note to get the most current list of DBIs from your system:
Note 1919091.1 FUSION HCM: How to Get the Most Current List of DBIs from
Your Database
FAST FORMULA – COMMENTS
FAST FORMULA – ALIAS STATEMENTS
FAST FORMULA – DEFAULTS
FAST FORMULA – DEFAULTS
FAST FORMULA – DEFAULTS
FAST FORMULA – CALCULATION SECTION
CALCULATION SECTION – TYPES OF
STATEMENTS
FAST FORMULA – RETURNS SECTION
FAST FORMULA – LOCAL VARIABLES
FAST FORMULA – LOCAL VARIABLES – NAMING
CONVENTIONS
FAST FORMULA – CONDITIONS
FAST FORMULA – CONDITIONS
OPERATORS, FUNCTIONS & ASSIGNMENTS
FAST FORMULAE - COMPILATION
FAST FORMULAE - SCENARIOS
test1 = MONTHS_BETWEEN(to_date('01/01/2010','DD/MM/YYYY'),to_date('01/01/2011','DD/MM/YYYY'))
l = months_between (l_Hire_Date,PER_REL_DATE_START)
RULE_VALUE = to_char(l)
return RULE_VALUE
SAMPLE CODE
/*
Version Date Created/Modified By Comments
---------------------------------------------------
1.0 1/2/18 Lakshmi Draft version
*/
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.
select t.base_formula_type_name
, ttl.formula_type_name
, ttl.description
, c.base_context_name
from ff_formula_types_b t
, ff_formula_types_tl ttl
, ff_ftype_context_usages u
, ff_contexts_b c
where t.formula_type_id = u.formula_type_id
and ttl.formula_type_id = t.formula_type_id
and ttl.language = userenv('LANG')
and ttl.formula_type_name like 'Oracle%Payroll%'
and c.context_id = u.context_id;
FAST FORMULA – INPUTS & OUTPUTS
Formulas can take input from the window, database, or a process such as a payroll
run and can return values or messages.
Values are passed at runtime and contents of inputs statement depends on formula
type.
LIST OF CONTEXTS FOR EACH FORMULA TYPE
select
t.base_formula_type_name,ttl.formula_type_name,ttl.descrip
tion, c.base_context_name
from
ff_formula_types_b t,
ff_formula_types_tl ttl,
ff_ftype_context_usages u,
ff_contexts_b c
where t.formula_type_id = u.formula_type_id
and ttl.formula_type_id = t.formula_type_id and
ttl.language = userenv('LANG')
and ttl.formula_type_name like 'Extract%Criteria%'
and c.context_id = u.context_id
CONTEXTS, DBI’S & FORMULA TYPE
To find the Formula Type where you can use the particular DBI
Step 1:
To find the route id for the DBI which is required to Find Formula type where we can use this DBI,Input is DBI NAME:
select route_id from ff_user_entities_b where user_entity_id in
(select user_entity_id from ff_database_items_b where base_user_name
='HWM_PER_ASG_REL_DATE_START');
Step 2:
Query to find the Formula Type where we can use the Particular DBI with the DBI Route ID, Input is route_id:
select * from FF_FORMULA_TYPES_B where formula_type_id in
(select formula_type_id from FF_FTYPE_CONTEXT_USAGES where context_id in
(select CONTEXT_ID from FF_CONTEXTS_B where CONTEXT_ID in
(select CONTEXT_ID from
ff_route_context_usages where route_id in (300000000198407))
)
);
Step 3:
To find out the Context for the particular DBI , Input is DBI NAME:
select * from FF_CONTEXTS_TL where LANGUAGE='US' AND context_id in
(select CONTEXT_ID from FF_CONTEXTS_B where CONTEXT_ID in
(select CONTEXT_ID from ff_route_context_usages where route_id in
(select route_id from ff_user_entities_b where user_entity_id in
(select user_entity_id from ff_database_items_b where base_user_name
='HWM_PER_ASG_REL_DATE_START')
)
)
);
ARRAYS
ARRAY – INDEX TYPES
ARRAY – RETURN METHODS
ARRAY – METHODS
LOOPS
INCLUDE = 'FALSE'
I=1
I=I+1
)
l_debug = ESS_LOG_WRITE('Debug2 - Retun value : '+INCLUDE)
RETURN INCLUDE
CHANGE CONTEXTS
DEFAULT FOR PER_ASG_PERSON_NUMBER is 'XX'
DEFAULT for PER_ASG_ASSIGNMENT_TYPE is 'NA'
DEFAULT for PER_ORG_ORGMGR_MANAGER is 'NA'
INCLUDE = 'FALSE'
I=1
CHANGE_CONTEXTS(PERSON_ID = to_number(PER_ORG_ORGMGR_MANAGER))
(
l = PER_ASG_PERSON_NUMBER
)