2 Replies Latest reply on Aug 8, 2012 10:36 AM by ethan.chernin

    Logic Statement


      I am trying to do the following and could use some help. My data is outlined below...


      EventPatient IDDuration Minutes*
      Patient Exam 1120
      Patient With Staff160
      Patient Alone in Room140
      Patient Alone in Room110
      Patient Exam 260
      Patient With Staff220
      Patient Alone in Room210
      Patient Alone in Room210

      * Durations Minutes is already a caluclation of two times a start and end time.


      I would like a calculation that gives me the AVG duration for each individual events EXCEPT "Patient Alone in Room" as this needs to be a SUM. I tried an IF/THEN statement using contains, however it says you can't mix an aggregate and non aggregate. This is the formula I tried...


      IF CONTAINS([EventName],"Patient Alone in Room") THEN SUM([Duration Minutes]) ELSE [Duration Minutes] END