You are on page 1of 21

Unlocking the Power of Oracle Fast Formula

Prepared by Thomas Russell Xcelicor, Inc.

OAUG Spring 2002

Contents

Introduction............................................................................................................................. 1 Purpose ............................................................................................................................. 1 Summary........................................................................................................................... 1 Advantages of Using Fast Formula / Rules ....................................................................... 2 How To Use Fast Formula (Rules) - Naming ..................................................................... 3 How To Use Fast Formula (Rules) - Syntax ........................................................................ 4 How To Use Fast Formula (Rules) - Conditional Logic .................................................... 6 How To Use Fast Formula (Rules) - Functions................................................................... 8 How To Use Fast Formula (Rules) - DBitems ..................................................................... 9 How To Use Fast Formula (Rules) Return Statement................................................... 10 Fast Formula / Rules Where can they be used and how ............................................. 11 Payroll Run Time calculations ..................................................................................... 12 Payroll Element input validation edits.................................................................... 13 Payroll Skip Rules....................................................................................................... 14 PTO Accruals Calculations for accrual and carryover .......................................... 15 Benefits Enforce client specific eligibilities, coverage rates, inception of coverage, etc. .................................................................................................................................... 16 Benefits System Extract data selection..................................................................... 17 HRMS Quickpaint for displaying employee information .................................... 18 Conclusion ............................................................................................................................. 19 Questions ........................................................................................................................ 19

Document Control

Page ii

Introduction Purpose
Oracle Fast Formula are extremely versatile. The purpose of thisdocument is to focus on that versatility. It is not meant to be an all encompassing how to guide. Instead, standard Oracle fast Formula documentation and functionality will be referred to rather than re-defined.

Summary
Oracle Fast Formulae are most often thought of as a payroll feature and something too technical for the average user to use. It is generally known by Oracle payroll clients that fast formulae are programs that calculate earnings, deductions and taxes. This is a fairly narrow scope. Oracle has been inserting this technology in other applications within the HRMS umbrella. This presentation will dispel the misguided notion that fast formulae are for payroll only and that they are only for the super technical. It will present fast formulae uses in payroll, benefits and system extract. It will unlock the power of these applications; with fast formulae one can truly be free to enforce ones own client rules. In payroll, fast formulae are used to determine if and when an element is processed , how it is processed and the result of that processing. In benefits each comp object is furnished with a rule window that allows one to create custom fast formulae for all benefit requirements including eligibilities, post processing edits, etc.. Additionally in the standard benefits product system extract enables one to extract prescribed data from the application and fast formulae explodes this realm in such a way that many extract files can be created by this feature. This presentation is not intended to present payroll, benefits or system extract but rather the underlying oft misunderstood tool that can make implementing and maintaining client rules a routine task .

OAUG Spring 2002

Advantages of Using Fast Formula / Rules


Easy for the non technical to use Knowledge of SQL not necessary Integrated into Oracle HR, Payroll, Benefits : easy access to data (including balances) An easy way to implement client specific rules

OAUG Spring 2002

How To Use Fast Formula (Rules) - Naming


The formula type will determine where a fast formula is accessible. For example if a fast formula is of type Oracle Payroll it will not be eligible for processing as a Benefits age-related-derived-factor. It is critical that before one codes a formula that the type for the formula be researched. Documentation for these is maintained by Oracle in the Fast Formula documentation.

OAUG Spring 2002

How To Use Fast Formula (Rules) - Syntax


Improper syntax results in fast formula compilation errors. Formula like these will not execute. Syntax and usage guidelines are defined by Oracle in the Fast Formula documentation.

/**************************************** FORMULA NAME: mass transit FORMULA TYPE: Payroll Change History 22-FEB-2001 T Russell Created . ****************************************/ /* Alias Section */ ALIAS SCL_ASG_US_WORK_SCHEDULE AS Work_Schedule /* Defaults Section */ default for tax_free_amount is 0 default for taxable_amount is 0

/* Inputs Section */ Inputs are tax_free_amount, taxable_amount

IF taxable_amount WAS DEFAULTED or tax_free_amount WAS DEFAULTED THEN ( mesg = 'Mass transit requires both tax free and taxable amounts to be inputted' RETURN mesg ) ELSE
OAUG Spring 2002 4

( nottaxed = tax_free_amount istaxed = taxable_amount RETURN nottaxed, istaxed, mesg )

OAUG Spring 2002

How To Use Fast Formula (Rules) - Conditional Logic

If-Then-Else , conditional and nested logic allows great versatility in coding. /******************************************************************** FORMULA NAME: MILEAGE_FLAT_AMOUNT_NONRECUR FORMULA TYPE: Payroll DESCRIPTION: calculate $ mileage using global

********************************************************************** Change History 17-APR-01 T Russell Created.

**********************************************************************/ /* Input Value Defaults */ Default for MILEAGE_00_ADDITIONAL_ASG_GRE_ITD Default for MILEAGE_00_REPLACEMENT_ASG_GRE_ITD Default for MILEAGE_00_ASG_GRE_RUN Default for MILEAGE_00_ASG_GRE_YTD Default for Distance /* Inputs */ INPUTS ARE Distance is 0 is 0 is 0 is 0 is 0

Amount=Distance * cents_per_mile_00 /* global */ mesg = 'amount='+to_text(amount) +' global='+to_text(cents_per_mile_00)

IF MILEAGE_00_REPLACEMENT_ASG_GRE_ITD WAS DEFAULTED OR MILEAGE_00_REPLACEMENT_ASG_GRE_ITD = 0 THEN (flat_amount = Amount + MILEAGE_00_ADDITIONAL_ASG_GRE_ITD + MILEAGE_00_ADDITIONAL_ASG_GRE_ITD)

OAUG Spring 2002

ELSE (flat_amount = MILEAGE_00_REPLACEMENT_ASG_GRE_ITD + MILEAGE_00_ADDITIONAL_ASG_GRE_ITD clear_repl_amt = -1 * MILEAGE_00_REPLACEMENT_ASG_GRE_ITD mesg = 'MILEAGE_00 Amount overridden by Replacement Amount.')

IF MILEAGE_00_ADDITIONAL_ASG_GRE_ITD <> 0 THEN clear_addl_amt = -1 * MILEAGE_00_ADDITIONAL_ASG_GRE_ITD if (1 = 1) then ( ) RETURN flat_amount, clear_addl_amt, clear_repl_amt, mesg

OAUG Spring 2002

How To Use Fast Formula (Rules) - Functions

These are PL/SQL scripts that are catalogued for and made available to fast formula. These perform complex data manipulations and allow one to be more economical in the coding of a fast formula. Oracle delivers many useful functions and clients can define their own. The standard / delivered functions are documented by Oracle in the Using Fast Formula manual. Some of the delivered functions are: To_Char : used to transform character data to numeric To_Num : used to transform data from char to numeric Trunc: to truncate decimals Days_Between : to return the days between two dates Months_Between : to return the months between two dates Years_Between : to return the years between two dates Greatest : returns the greatest in a string Least : returns the least in a string Calculate_Payroll_periods Get_Absence Many More.

OAUG Spring 2002

How To Use Fast Formula (Rules) - DBitems

The data that is accessed in fast formula are registered as dbitems (data base items). Dbitems have context which determine where they can be accessed. For example a dbitem for payroll may not be accessible to benefits. The client can define dbitems automatically when a element, earning,deduction, balance, globals, person, etc. is defined. On occasion though a dbitem needs to be defined technically; this entails technical support to update those Oracle tables defining the dbitem and its context(s). Automatically defined dbitems are called dynamic dbitems. Those dbitems pre-defined within the application are called static dbitems. Dynamic Dbitems Elements (earnings, deductions, information) Element input values Balances Flex Fields Global Values

Static Dbitems Accrual Plans Applicant Employee Contact Location Address Date Payroll etc

OAUG Spring 2002

How To Use Fast Formula (Rules) Return Statement

Every fast formula should have a return statement. This fast formula statement when processed ends execution of the formula and passes the result of its execution to the appropriate destination. Payroll uses the formula results form to map return variables as direct feeds (the result of the calculation or indirect feeds (pass data to another element for subsequent processing or balance processing or message processing). The client is free to name their own results, passing them thru the return statement and mapping them as desired. Benefits There are prescribed returns predefined within the benefits application. So, in addition to determining the type of fast formula one must also select the corresponding return. Failure to do this will result in the benefit rule not performing as desired..it will appear that the formula did not execute.

OAUG Spring 2002

10

Fast Formula / Rules Where can they be used and how


A Fast Formula or Rule is only valuable when it can be executed. The following lists some of the places in Oracle HRMS/Benefits where these rules can be executed Payroll Payroll run time calculations Payroll Element input validation edits Payroll Skip Rule PTO Accruals Calculations for accrual and carryover Benefits Enforce client specific eligibilities, coverage rates, inception of coverage, etc. Benefits System Extract data selection HRMS Quickpaint for displaying employee information HRMS Assignment Sets

OAUG Spring 2002

11

Payroll Run Time calculations

OAUG Spring 2002

12

Payroll Element input validation edits

OAUG Spring 2002

13

Payroll Skip Rules

OAUG Spring 2002

14

PTO Accruals Calculations for accrual and carryover

OAUG Spring 2002

15

Benefits Enforce client specific eligibilities, coverage rates, inception of coverage, etc.

OAUG Spring 2002

16

Benefits System Extract data selection

OAUG Spring 2002

17

HRMS Quickpaint for displaying employee information

OAUG Spring 2002

18

Conclusion
Fast Formula (Rules) empower the non technical super user Fast Formula (Rules) are versatile Fast Formula (Rules) are integrated in the HRMS suite of applications Future enhancements to Oracle HRMS/Benefits will continue to include Fast Formula (Rules)

Questions

OAUG Spring 2002

19