Forum

Hospital stay and d...
 
Notifications
Clear all

Hospital stay and discharge dates

3 Posts
2 Users
0 Reactions
105 Views
(@cjeffreywiesnergmail-com)
Posts: 2
New Member
Topic starter
 

Hello Everyone,

My data set has a list of dates on which specific diet orders stopped and started.  Presumably, if there are gaps in the dates (if the dates are not contiguous), those gaps represent times when the patient was not in the hospital.  Is there a way to group these dates by hospitalization?  I have a column for the diet order and a column for the start and stop dates for that diet order.  Capture-Diet-Order-vs-dates.PNG

Could I use the firstdate and lastdate in Power Pivot to help me accomplish this?

 
Posted : 03/09/2021 9:17 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Charles,

I'd use Power Query to split the date and time components into separate columns, just in case there is a minute or two difference from one date-time to the next. Then you can use this technique to reference the next row in Power Query (use option 2) to see if the dates are the same from one row to the next. 

See example file attached. Note: you didn't give an example of your desired result, so I have only taken this so far. In future, please share a sample Excel file to save us having to manually recreate your data.

Mynda

 
Posted : 03/09/2021 11:28 pm
(@cjeffreywiesnergmail-com)
Posts: 2
New Member
Topic starter
 

Thank you Mynda.  From reading your "Read first" post, I see that I should have attached my data set.  Sorry I did not read that before I posted.  Lesson learned.

Thanks again,

Jeff

 
Posted : 04/09/2021 7:20 am
Share: