2 Replies Latest reply: Jan 19, 2017 12:49 PM by Wallo Atkinson RSS

    Sum a value with duplicate data

    Jay Fitchett

      I have data that looks something like this:

       

      UserIDCourse NameOther Value
      1

      Course 1

      10
      1Course 14
      1Course 110
      1Course 210
      1Course 24
      1Course 210

       

      The data is like this due to me joining two tables together - the "Course Name" and "Other Value" have nothing in common other than that they apply to the same user.

       

      What I need to do is sum the "Other Value" so I get 24 for the user, regardless of the number of courses they have. I think I have to use some sort of aggregate function, I've played around with aggr but haven't had any luck.

       

      Any help would be appreciated!!