4 Replies Latest reply: May 30, 2013 4:38 AM by Sokkorn Cheav RSS

    Simple sum/group by giving wrong results

      Can someone give me a reason why the SumReadPassed column does not give me a correct result?

      The Passed_both_num consists of only "0" and "1". Each Employee initials appear max. 4 times - but still my sum is returning values from 1 to 45 (should not be possible)

       

      Anything wrong with my Group By / Sum script???

       

      TABLE:

           LOAD [Employee ID],
          
      Name,
          
      Num#([Passed_both]) as Passed_both_num,
          
      [SOP ID],
          
      [SOP Task Code],
          
      [SOP Revision],
          
      [SOP Due Date],
          
      [SOP Sign Date],
          
      [SOP Taken On Time],
          
      [SOP Status],
          
      [Test ID]

       

       

      FROM
      \\BE_training.qvd
      (
      qvd);

      SUM:

      LOAD[Employee ID],

      SUM (Passed_both_num) AS SumReadPassed

      RESIDENT
      TABLE

      GROUP BY[Employee ID];

      COUNT:

      LOAD[Employee ID],

      TEXTCOUNT (DISTINCT ([SOP ID])) AS CountSOPID

      RESIDENT
      TABLE

      GROUP BY[Employee ID];