Oracle Fast Formulas - Practice Exercises

 

Exercise 1: Modular Formula Creation

👉 Task:
Create a Payroll Fast Formula that calculates the basic salary, bonus, and tax using a modular approach. Split the logic into:

  • A formula to calculate Bonus

  • A formula to calculate Tax

  • A main formula that calls both and returns the final net salary


Exercise 2: Error Handling

👉 Task:
Write a Fast Formula to calculate overtime pay that:

  • Takes Overtime Hours and Hourly Rate as inputs.

  • Adds error handling to return a meaningful message if Overtime Hours is NULL or negative.


Exercise 3: Optimize Conditional Logic

👉 Task:
Given the below logic, optimize it using ternary (shorthand IF) statements to improve performance and readability.

text
IF ServiceYears > 10 THEN LeaveEntitlement = 30 ELSE IF ServiceYears > 5 THEN LeaveEntitlement = 25 ELSE LeaveEntitlement = 20 ENDIF ENDIF

Exercise 4: Avoid Hardcoding

👉 Task:
Create a formula that calculates allowance based on Grade.
Store the Grade-Amount mapping in a User-Defined Table (UDT) instead of hardcoding the amounts in the formula.


Exercise 5: Test with Real Data

👉 Task:
Test one of your existing Payroll Fast Formulas with real employee data.

  • Note down any performance issues.

  • Identify parts of the formula that can be optimized (for example, reducing repeated calculations).


Bonus Challenge: Version Control

👉 Task:
Implement a version history table for your formula updates.

  • For each formula update, record:

    • Formula Name

    • Version Number

    • Date of Change

    • Summary of Changes

No comments:

Post a Comment