Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
I am having a field say Total_CasualLeave which is static and predefined.
Now I have to show Day wise balance if he or she takes any CasualLeave.
Example:
Name | Date | Total_CasualLeave | CL TAKEN | Closing CL Balance |
A | 21st May | 10 | 1 | 9 |
A | 28th May | 9 | 0 | 9 |
A | 18th June | 7 | 2 | 7 |
What is the solution and How I can solve it?
Regards,
Balraj
Provide some more information on your data model or tables...
10 - [CL TAKEN]
Manish,
I am having a LeaveLedger table which is having static/Fix set of leave defined for a person.
In other table LeaveRequest with fields like(LeaveDate, LeaveCode, NoOfLeaveDays etc), which keep the track if any person have taken any leave.
Let me know if you required any other info?
Regards,
Balraj
Here is table details:
LOAD PAYCODE,
L01_ADD as Total_CL(Allotted for a Year),
L02_ADD as Total_SL,
L03_ADD as Total_EL,
LYEAR
from LeaveLedger;
Another table is:
LOAD PAYCODE,
//request_date,
leave_from,
leave_to,
leavecode as LEAVECODE,
leavedays
from LeaveRequest;
With these info I need to drive above result.
Pls suggest.
HI Balraj,
You can resolve this by fallowing code,
Load Name ,
Date,
Total_CasualLeave as [Total casual Leaves],
Total_CasualLeave - previous(Total_CasualLeave) as [Leaves Taken] ,
Total_CasualLeave - (Total_CasualLeave - previous(Total_CasualLeave)) as Leave balance
from Table Orderby Date ;
I hope it helps...........
Koti,
Thanks for your reply.
But Total_CasualLeave is a fix value field for each employee, it is not changing by date.