12 Replies Latest reply on Dec 5, 2012 4:34 PM by Jonathan Drummey

    Summary Function at Individual Row Level

    Karl Jensen

      I have struggled with this kind of thing several times.  I have always got around it, but don't think I can this time.  Any ideas would be greatly appreciated.

       

      I have a table where I list the average and standard Deviation for each Diagnosis.  I can then calculate the metric I need (mean + 1 stdev).  HOWEVER, what I need to do now, is take this calculation and then compare to the individual values.  If it is greater than this, I want to calculate the difference between the two and sum them up for the given Diagnosis.  For example,

       

      DiagnosisCaseCostDiag StdevDiag Meanmean + 1 stdevif above include
      3011$3,492$772$2,885$3,657$0
      3012$2,393$772$2,885$3,657$0
      3013$3,049$772$2,885$3,657$0
      3014$2,039$772$2,885$3,657$0
      3015$4,033$772$2,885$3,657$376
      3016$2,093$772$2,885$3,657$0
      3017$2,720$772$2,885$3,657$0
      3018$3,029$772$2,885$3,657$0
      3019$4,000$772$2,885$3,657$343
      30110$2,002$772$2,885$3,657$0
      301 Total$772$2,885$3,657$718
      30211$9,807$29,199$21,757$50,956$0
      30212$80,796$29,199$21,757$50,956$29,840
      30213$7,079$29,199$21,757$50,956$0
      30214$8,079$29,199$21,757$50,956$0
      30215$80,769$29,199$21,757$50,956$29,813
      30216$8,405$29,199$21,757$50,956$0
      30217$8,965$29,199$21,757$50,956$0
      30218$9,304$29,199$21,757$50,956$0
      30219$9,304$29,199$21,757$50,956$0
      30220$9,820$29,199$21,757$50,956$0
      30221$7,000$29,199$21,757$50,956$0
      302 Total$29,199$21,757$50,956$59,653

       

       

      Thoughts?