PLSQL - Element Entry History - Oracle HCM
Budget: $30 – $250 USD
Attached PL SQL Query shows the salary breakdown history (Employee Number, Element Name, Start date, end date, amount, monthly increment, gross salary).
shows
- Element Name: like Basic Salary, .. etc.
- Start Date: Effective start date of the element (sorted DESC)
- End Date: Effective End date of the element
- Amount: (each element separately) based on effective start date and effective end date of the element.
- Monthly increment. Sum(Current Value - Previous Value) for all elements in the row
- Gross Salary. Sum(Actual Value for all elements after increment)
The problem is in (Monthly increment column).
Normally, it shows Sum(Current Value - Previous Value). But it doesn't consider the previous value if there was an end date for previous value.
What is required:
- Solve the issue of (Monthly increment column), calculate based on Sum(Current Value - Previous Value). If an end date was assigned for previous value, pick last value greater than 0 before element end date
- It must be reflected correctly in (Gross Salary Column)
- Attached image explains the scenario.
- Attached txt file includes the sql query.
- Attached excel file includes sample data for testing
Thanks
shows
- Element Name: like Basic Salary, .. etc.
- Start Date: Effective start date of the element (sorted DESC)
- End Date: Effective End date of the element
- Amount: (each element separately) based on effective start date and effective end date of the element.
- Monthly increment. Sum(Current Value - Previous Value) for all elements in the row
- Gross Salary. Sum(Actual Value for all elements after increment)
The problem is in (Monthly increment column).
Normally, it shows Sum(Current Value - Previous Value). But it doesn't consider the previous value if there was an end date for previous value.
What is required:
- Solve the issue of (Monthly increment column), calculate based on Sum(Current Value - Previous Value). If an end date was assigned for previous value, pick last value greater than 0 before element end date
- It must be reflected correctly in (Gross Salary Column)
- Attached image explains the scenario.
- Attached txt file includes the sql query.
- Attached excel file includes sample data for testing
Thanks