When we navigate through person screen
Enter and maintain->others->Absence Screen
There are Running Total and In Current Year Columns
What is the source for those columns
Through Record history I found PER_ABSENCE_ATTENDANCES_V view
But couldn't find the actual table name and column name for those columns
As mentioned earlier those two fields are not stored anywhere directly in the table, but are calculated on the form:
Running total - Sum of all leave taken under respective leave type - You can get this value tallied by writing a simple query like SELECT SUM(ABSENCE_DAYS) from PER_ABSENCE_ATTENDANCES where person_id = <your person id> and absence_attendance_type_id = <your absence type id>
I am still struck with Running Total Column
When i fetch running total using this query it works for some of the employees
SELECT SUM(ABSENCE_hours) from PER_ABSENCE_ATTENDANCES where person_id = <your person id> and absence_attendance_type_id = <your absence type id>
As there are three different cases here as Days,Hours and No Balance
I am missing the logic again here when it comes for no balance and days
Why dont you try a DECODE function to check the absence type (Hours, days, etc) andbuild you logic accordingly.
If you cannotn manage by DECODE then build a custom function which will have input parameter as person_id and absence_type_id and fetch you the desired result.