1 Reply Latest reply on Oct 24, 2016 4:04 PM by Jonathan Drummey

# Calculation Help

Hey all - I am new to Tableau and am looking for some calculation help.  I am trying to calculate the average number of OP Therapy visits for our TKA and THA patients. In the simple example below George has 4 visits while Abe has 6 resulting in an average of 5 visits per patient for Dx Z96.652.  We would like to get an overall organizational average but also be able to filter it by site and physical therapists (which i am guessing i can just do by filters.)  any help would be much appreciated!

 Pt First Name Pt Middle Initial Pt Last Name Contact Date DX Visit Diag Prov Dept George A Washington 8/1/2016 Z96.652 Status Post Left Knee Repalcement Jackson, Andrew ABC Physical Therapy George A Washington 8/7/2016 Z96.652 Status Post Left Knee Repalcement Jackson, Andrew ABC Physical Therapy George A Washington 8/12/2016 Z96.652 Status Post Left Knee Repalcement Jackson, Andrew ABC Physical Therapy George A Washington 8/18/2016 Z96.652 Status Post Left Knee Repalcement Jackson, Andrew ABC Physical Therapy Abe B Lincoln 8/19/2016 Z96.653 Status Post Left Knee Repalcement Jackson, Andrew ABC Physical Therapy Abe B Lincoln 8/20/2016 Z96.654 Status Post Left Knee Repalcement Jackson, Andrew ABC Physical Therapy Abe B Lincoln 8/21/2016 Z96.655 Status Post Left Knee Repalcement Jackson, Andrew ABC Physical Therapy Abe B Lincoln 8/22/2016 Z96.656 Status Post Left Knee Repalcement Jackson, Andrew ABC Physical Therapy Abe B Lincoln 8/23/2016 Z96.657 Status Post Left Knee Repalcement Jackson, Andrew ABC Physical Therapy Abe B Lincoln 8/24/2016 Z96.658 Status Post Left Knee Repalcement Jackson, Andrew ABC Physical Therapy
• ###### 1. Re: Calculation Help

Hi Ryan,

Try AVG({INCLUDE [unique patient ID field] : SUM([Number of Records])} in a view that doesn't have the unique patient ID in it and filters for DX = Z96.52. The {INCLUDE... is a Level of Detail expression that computes the average number of visits per patient *plus* any dimensions in the level of detail of the viz.

Jonathan