1 Reply Latest reply on May 26, 2016 4:06 PM by Jennifer Petti

    percent of a group where a condition exists

    david sharbaugh

      I work in a hospital and I am building a supply utilization dashboard for surgical service.  I have detail charges for all the patients for items used in the oR and Im trying to be able to show all the doctors and show what percent of all of their patients received a certain supply item.  Some of the challenges is that there are many records for each patient (all the detail charges) so I need to count distinct patientIDs to get the number of patients, then I need to figure out how to see if they did or didnt have the supply item.  In the example here I used aspirin and put a small example data file together.  ideally, Ill be able to show the total spend on aspirin then when I click on the total spentd (action filter) there will be a table below that shows all the doctors and their total cases, as well as the number of cases that use the aspirin and the percent...  See attached.  Thanks!

        • 1. Re: percent of a group where a condition exists
          Jennifer Petti

          Hi David,

          Using a feature called Quick Table Calculations, this is actually pretty easy to do!


          I started by building a view of your Count Distinct of patients, broken down by Charge Items and Physician.  This is the view below.



          Now, you'll want to navigate to the columns shelf and right click on your CNTD green pill.  This gives you a menu of options.  You'll select Quick Table Calculation and then, Percent of Total.

          Tableau is computing that percent of total calculation for you, without you having to write anything! Hurrah! But you'll want to change how it's being computed to get the correct result for your use case.  You're interested in the percentage of a physicians patients that used a particular item out of all of the physicians patients.  You'll calculate this using Pane Down, which tells Tableau, (in the context of this viz), that we want this calculation to rerun for each physician.  In this case, you're breaking down your bar charts by physician so each new physician is a new pane.



          And that's it! I added some fake cost information to the data set, to show how you can use color to display additional information.  Then you can easily compare multiple metrics.  I'm attaching a workbook for your use.