0% found this document useful (0 votes)
9 views

Les03_Basic Fast Formula Syntax

The document provides an overview of Oracle HCM Cloud Fast Formula components, including comments, input statements, database items, variables, and functions. It emphasizes the importance of adding comments for clarity, using appropriate input values, and generating flexfield database items for formulas. Additionally, it covers the compilation process, error handling, and the context values available for different formula types.

Uploaded by

Miguel Torres
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Les03_Basic Fast Formula Syntax

The document provides an overview of Oracle HCM Cloud Fast Formula components, including comments, input statements, database items, variables, and functions. It emphasizes the importance of adding comments for clarity, using appropriate input values, and generating flexfield database items for formulas. Additionally, it covers the compilation process, error handling, and the context values available for different formula types.

Uploaded by

Miguel Torres
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

Oracle HCM Cloud: Fast Formula 3 - 2

Formula components:
• Comments
• Inputs Statement
• Database Items
• Variables
• Conditions
• Expressions
• Operators
• Functions
• Assignment Statement
• Return Statement
• Compile

Oracle HCM Cloud: Fast Formula 3 - 3


Add as many comments as you can to help others understand your formula. You will also
benefit from your own comments. Often you know exactly what you are trying to do as you
write your formula. But it may not be clear at all later on.
You should add comments:
• At the beginning of a formula to describe what you are doing in the formula.
• At different sections of a formula to describe what each section does within the formula.
Note
• Comments do not have any effect on processing time.
• Use white space and indentation, as well as comments, to make your formulas easier to
read and understand
• Do not put a comment inside a comment

Oracle HCM Cloud: Fast Formula 3 - 4


Not all formula types have available input values. Examples of differing inputs statement
content:
• Input values from element being processed
• Date for calculating PTO accrual
• Length of service factor ID, for a benefits length of service calculation
• Maximum number of work hours for a time entry validation rule template
For more information about input values, see the fast formula reference guide for your
product.

Oracle HCM Cloud: Fast Formula 3 - 5


You use some entry values to provide inputs to element calculations, such as hours worked.
These can be used as INPUTS in a formula. Other entry values store results from payroll
calculations, for example of elements processed earlier in the payroll run.

Oracle HCM Cloud: Fast Formula 3 - 6


Additional Reference:
• Database Items for Extracts and Formulas in Oracle Fusion HCM (Doc ID 1565118.1)
https://mosemp.us.oracle.com/epmos/faces/DocumentDisplay?id=1565118.1
• Extracts: Database Items (DBIs) and User Entities (UEs) (Doc ID 1546399.1)
• How to Get the Most Current List of DBIs from Your Database (Doc ID 1919091.1).
• Database Items: Explained (nonembedded help)

Oracle HCM Cloud: Fast Formula 3 - 7


Oracle HCM Cloud: Fast Formula 3 - 8
Oracle HCM Cloud: Fast Formula 3 - 9
Oracle HCM Cloud: Fast Formula 3 - 10
Generating Flexfield Database Items
• You configure registered HCM flexfields to add contexts and segments for your business
requirements.
• After you deploy the flexfield, you can generate database items for the flexfield for use in
your formulas and extracts by submitting the Generate Flexfield Database Items process
from the Payroll Checklist or Payroll Calculation work areas.
You can generate DBIs for the following flexfields:
• Descriptive flexfields
• Extensible flexfields for single and multiple row routes
• Key flexfields
Related Nonembedded Help Resources:
• Generating Flexfield Database Items: Explained
• Generating Flexfield Database Items: Worked Example

Oracle HCM Cloud: Fast Formula 3 - 11


Batch loader workbooks are a fast way to upload batches of data. You load data into staging
tables using the payroll batch loader then transfer the batch into live HCM tables.
To access the batch loader, either:
• Select Manage Batch Uploads from the Data Exchange work area
• For payroll managers and administrators, select the Batch Loader task in the Payroll
Administration work area
• If a flow includes the batch loader, you can also access it from the Payroll Checklist
work area using the Enter Batch task on the Payroll Flow page

Oracle HCM Cloud: Fast Formula 3 - 12


Oracle HCM Cloud: Fast Formula 3 - 13
Output variables appear in RETURN statements. Examples of different output variables:
• A Compensation End Date formula type can be used to determine the end date of
compensation awarded using an individual compensation plan. It returns the value using
the output variable COMPENSATION_END_DATE.
• A Life Event Reason Timeliness formula type can be used to determine whether a
potential life event should be processed or not. It returns the value (Y or N) using the
output variable L_LIFEEVENT_VOIDED.
Return statements are discussed in the next lesson.
For more information about output values, see the fast formula reference guide for your
product.

Oracle HCM Cloud: Fast Formula 3 - 14


Note
The name must be different from any database item name or the formula compiler will treat it
as a database item and it will be processed as one.

Oracle HCM Cloud: Fast Formula 3 - 15


Oracle HCM Cloud: Fast Formula 3 - 16
When you use a formula, the context values corresponding to the formula type are available.
• The contexts available to a formula are limited by the formula type
Formula contexts are connected to the type of processing being run. For example, payroll
processing formula types have contexts for payroll processing, such as PAYROLL_ID,
PAYROLL_ACTION_ID but don’t have contexts for benefits processing, such as LER_ID.

Oracle HCM Cloud: Fast Formula 3 - 17


Oracle HCM Cloud: Fast Formula 3 - 18
The example is of an accrual leave formula.
• The formula checks whether the condition (Years_Service >= 10) is true
• If it is true, the formula processes the statement Annual_Leave = 25
• If it is false, the formula processes the statement Annual_Leave = 20
Note: The ELSE condition in an IF statement is optional.
It is needed in this example unless you set the value of ANNUAL_LEAVE prior to the IF
statement.

Oracle HCM Cloud: Fast Formula 3 - 19


Oracle HCM Cloud: Fast Formula 3 - 20
Oracle HCM Cloud: Fast Formula 3 - 21
Oracle HCM Cloud: Fast Formula 3 - 22
Functions Examples:
• Text LENGTH(expression)
- Returns the number of characters in the text string operand expression
• Number ROUND(m, [n])
- Rounds m to n decimal places. The default number of decimal places is 0
• Date ADD_MONTHS(date, n)
- Adds n whole months to date
• Data Conversion NUM_TO_CHAR(n, format)
- Converts the number n to a character string in the specified format
• Miscellaneous ESS_LOG_WRITE(text-expression)
- Used for non-payroll processes running on the Enterprise Scheduler (ESS) to write
messages to the ESS log file for the process that calls the formula.
Note: For payroll processes, use the PAY_INTERNAL_LOG_WRITE function.
Logging needs to be enabled to support this function. See:
How to Enable Logging for Oracle Fusion Global Payroll (Doc ID 1536245.1)
How to Trace and Log Fast Formulas? (Doc ID 1559909.1)

Oracle HCM Cloud: Fast Formula 3 - 23


A function is specified by its name, return data type, parameter data types, and parameter
usage behavior. The general form of a function is:
NAME-OF-FUNCTION(operand,operand,...)
Additional resources listing all functions by data type, are located in the Applications Help or
the Fast Formula Users Guide:
• Text Formula Functions
• Numeric Formula Functions
• Date Formula Functions
• Data Conversion Formula Functions
• Miscellaneous Formula Functions

Oracle HCM Cloud: Fast Formula 3 - 24


Oracle HCM Cloud: Fast Formula 3 - 25
Note
The compiler only checks for accuracy of syntax, it does not check for accuracy of its output.

Oracle HCM Cloud: Fast Formula 3 - 26


If you run the Compile Formula process, any compilation errors can be viewed on the Payroll
Messages page. No matter which way a formula is compiled, all errors must be resolved and
the formula re-compiled until it is successful.

Oracle HCM Cloud: Fast Formula 3 - 27


Oracle HCM Cloud: Fast Formula 3 - 28
Oracle HCM Cloud: Fast Formula 3 - 29
Answer: a
Avoid referring to database items until you need them, this reduces unnecessary database
calls and increases efficiency.

Oracle HCM Cloud: Fast Formula 3 - 30


Answer: b, d
The THEN and ELSE clauses are used with an IF statement. Also, a conditional logic is used
with WHILE statements.

Oracle HCM Cloud: Fast Formula 3 - 31


Answer: b
A formula context is the information that is always available to a formula at runtime.

Oracle HCM Cloud: Fast Formula 3 - 32


Answer: b
A successfully compiled formula indicates the formula syntax is correct, but it does not
indicate that the outcome will be as expected.

Oracle HCM Cloud: Fast Formula 3 - 33


Oracle HCM Cloud: Fast Formula 3 - 34

You might also like