Skip to main content

I have been asked to identify hospital patients that are readmitted into the ICU after spending time in another department (So, for example, they're in the ICU, then they go to Cardiac dept, then they visit the ICU again). I've spent a considerable amount of time trying to come up with a calculated field that assigns a value of "Readmitted" to the patient's account, but have not been successful so far. Patients that have only had one trip to the ICU, even if it was multiple days, would have a value of "Not Readmitted".

 

Because of private information, I cannot upload a workbook, but I've attached a screenshot of what I'm working with. The "Enc - Patient Account" field is the specific patient, and the "Charge - Revenue Center Desc" field is basically the department.

 

Thanks!

11 answers
  1. Jul 5, 2023, 2:52 PM

    Ok, I don't see a straightforward LOD on this because we're using rows to look forward/backward on and they generally require a Table Calc. In this case:

    IF LAST()=0 THEN

    MAX({FIXED [Patient Name], [Department]: IF COUNT([Department])>1 AND MAX([Department])='ICU' THEN 'Readmit' END}) END

    Would check for the most recent condition and return:

    Ok, I don't see a straightforward LOD on this because we're using rows to look forward/backward on and they generally require a Table Calc.This is set to use Patient Name. LAST() is a table calculation, so its usage is limiting. 1) table calculations provide a displayed value, not an actual value to work with going forward, such as incorporating the result in another calculation (2) attempts to remove or modify the structure of the table could cause the calculation to error or the table to collapse. Such as when creating a bar/line chart or aggregating/summarizing. Those are the caveats, the watch-outs, when using table calculations.

     Screen Shot 2023-07-05 at 7.54.29 AMSo, while this may get you your result, it won't be able to be aggregated or used in a chart. Because, if you start removing fields it will collapse and either null or error out. Hence, the question about whether Tableau Prep was an option to produce an actual value - not a displayed result. Your only other option with this situation is to export out the table result - then bring it back into Tableau and then you can count and/or visualize the results.

     

    Best, Don

    (Please, don't forget to click Select as Best or Upvote !)

0/9000