2 Replies Latest reply on Feb 18, 2016 4:44 PM by Bora Beran

# Calculating LOS

Hello all, I am seeking to create a calculated field for the number of days a patient is present in our hospital each month. It begins by looking at the admission and discharge dates for the patient and "assigning" days to each month.

For example, if a patient is admitted on 9/28/15 and discharged on 11/5/15, then they were present for 3 days in September, 31 days in October and 5 days in November.  We would them sum up the number of days across all patients to give us the total bed days for the month.  We would then segment patients into different categories to look at bed day detail.  For example, we may look at the percentage of bed days taken up by patients of a specific diagnosis or legal status.

I am providing an excel workbook and Tableau.txbx file with some sample data.  The calculated # of bed days was done manually to illustrate what we are looking to re-create in Tableau, using the admission and discharge dates.

Thanks in advance for any help.

• ###### 1. Re: Calculating LOS

Luis,

This is one of the most difficult challenge to Tableau's existing feature,I believe.

You can refer this past thread to get some hints.

Thanks,

Shin

1 of 1 people found this helpful
• ###### 2. Re: Calculating LOS

I hope this helps. The darker shades are the ones computed inside Tableau. Some of the numbers don't match but looks like those were issues with the Excel formula.E.g. August 6th to October 13th only contains 13 days in October but your Excel calc found 18. October 7, 2014 to November 14th 2015 contains the full month of October 2015 in it so should be 31 days but Excel had 24. Null date to Null date is 0 days but original calc found 346 days etc.