Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi,
I have data in the below format.
| ID | Admit date | Discharge date | days |
|---|---|---|---|
| 1 | 04/11/2014 17:22 | 04/11/2014 19:46 | 1 |
| 1 | 04/11/2014 19:46 | 04/12/2014 19:59 | 2 |
| 1 | 04/12/2014 19:59 | 04/14/2014 21:50 | 3 |
| 1 | 04/14/2014 21:50 | 04/14/2014 21:18 | 1 |
"days" is calculated by considering only the date part (time part is not considered. So "04/14/2014 21:18" is equivalent to "04/14/2014").
For the above scenario, when aggregated by "ID" the sum(days) = 1+2+3+1 = 7 whereas the expected value is"no of days"= 4 (11th, 12th, 13th, 14th)
How to achieve this?
Hi,
Try this expression.
sum((Interval([Discharge date]-[Admit date],'dd:hh')))
Regards,
Neelam