Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am calculating a Length of Stay (LOS), for which I use 2 fields (start_date & end_date) and the following logic.
end_date - start_date = Length of Stay (LOS in days).
The following is an example of my table and results.
ID | end_date | start_date | LOS |
---|---|---|---|
1 | 6/20/17 | 6/15/17 | 5 |
2 | 6/11/17 | 6/10/17 | 1 |
3 | 6/10/17 | 5/10/17 | 30 |
What I need is to calculate the number of LOS days occurred in each month. For example. ID 3, has an LOS 30 days, but in 20 of the days occurred in the month May and 10 days occurred in the month June.
I believe my end result should be a table like this
ID | LOS May | LOS June |
---|---|---|
1 | 0 | 5 |
2 | 0 | 1 |
3 | 20 | 10 |
Which would allow to me to calculate that the Total Patient Stay days in May = 20 and in June = 16.
I am not sure how to tackle this problem.
If anyone can help, that would be greatly appreciated.
Thank you,
Hi,
May be as at attached file.
Regards,
Andrey
Большое спасибо !!!