3 Replies Latest reply: Sep 12, 2017 4:07 AM by Mohammed Mukram RSS

    Count unique

    Ruslans KLimovs

      Good day!

      Please help find optimal solution.

       

      I have data - drivers delivers documents to different locations. To some locations may be delivered several document.

      I need to count, how many  locations were visited by driver each month.

       

      I use construction:

       

      LOAD

           Driver_ID,

           Delivery_Date,

           COUNT (Location_Code) AS Count_Delivery_Points

      GROUP BY

           Driver_ID,

           Delivery_Date;

       

      But I guess, this construction counts repeated locations, when several documents were delivered to same location.

       

      Can you please tell me, how to cunt only unique values?

       

      Thank you in advance!