Oracle HCM Cloud: Fast Formula 4 - 2
Types of statements that could be in a calculation section:
• WHILE loop
• Formula from formula call using CALL_FORMULA
• Formula from formula call using SET_INPUT, EXECUTE, GET_OUTPUT
• IF statement
• DEFAULT_DATA_VALUE FOR for array database items
• EXIT statement to exit a WHILE loop or IF statement
• GET_CONTEXT to get the value of a context, for example l_hr_asg_id =
get_context(hr_assignment_id, -1)
• CONTEXT_IS_SET condition to test whether or not a context value is set, for example
IF CONTEXT_IS_SET(HR_ASSIGNMENT_ID) THEN …
• CHANGE_CONTEXTS to change context values
Note: A Return Statement can be in the calculation section if it is added to conditional logic.
But if the condition is true and the Return is executed within the IF statement, then any
following lines in the formula will not be read.
Oracle HCM Cloud: Fast Formula 4 - 3
Note
Using an Alias is more efficient than assigning the database item to a local variable with a
short name.
Oracle HCM Cloud: Fast Formula 4 - 4
Oracle HCM Cloud: Fast Formula 4 - 5
Oracle HCM Cloud: Fast Formula 4 - 6
Instructor Note
In this example, the input value HOURS_WORKED is numeric. If the input value is not
numeric, you must indicate whether it is text or date. For example: INPUTS ARE
START_DATE (date).
Oracle HCM Cloud: Fast Formula 4 - 7
Oracle HCM Cloud: Fast Formula 4 - 8
Some programs expect values to be returned using predefined names for the output variable.
For more information, see the fast formula reference guide for your product.
Oracle HCM Cloud: Fast Formula 4 - 9
Oracle HCM Cloud: Fast Formula 4 - 10
Since the formula is executed linearly all statements after the first Return statement are not
processed. Brackets are needed with conditional logic to ensure correct processing.
INPUTS ARE ACCT_BALANCE, ACCOUNT(text), DEBIT_AMT
IF ACCT_BALANCE >= DEBIT_AMT
THEN
(NEW_BALANCE = ACCT_BALANCE – DEBIT_AMT
MESSAGE = ‘Full amount deducted.’
RETURN NEW BALANCE)
ELSE
(MESSAGE = ‘Account number’ + ACCOUNT + ‘has insufficient
funds.’
RETURN MESSAGE)
Oracle HCM Cloud: Fast Formula 4 - 11
Oracle Fast Formula begins calculating inside the brackets and from left to right, in the
following steps:
1. SALARY_AMOUNT / 100
2. Result of step 1. * BONUS_PERCENTAGE
3. Result of step 2. / 183
4. DAYS_BETWEEN(END_PERIOD_DATE, START_DATE)
5. Result of step 4. + 1
6. Result of step 3. * 5.
7. TRUNC(6.,2)
Notice that TRUNC is another function. It rounds a numeric value down to the number of
decimal places specified after the comma (2 in this case).
Oracle HCM Cloud: Fast Formula 4 - 12
Use the waiting period value formula type if the waiting period varies from employee to
employee based on their organization or for a rehired employee
• Participants need to complete a waiting period before they can gain eligibility to a
benefits object
• Sometimes employees have to wait for six months to get eligibility to a benefits object
Oracle HCM Cloud: Fast Formula 4 - 13
Answer: d
The correct structure is Alias statement, Default statement, Inputs, Calculation section, and
Return statement.
Oracle HCM Cloud: Fast Formula 4 - 14
Answer: a
Some values can be empty (NULL) and some inputs may not be passed to the formula. Your
formula will fail if default values are not provided for them.
Oracle HCM Cloud: Fast Formula 4 - 15
Answer: a
Conditional processing must occur within the calculation section.
Oracle HCM Cloud: Fast Formula 4 - 16
Oracle HCM Cloud: Fast Formula 4 - 17