Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
sculptorlv
Creator III
Creator III

Count unique

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!

1 Solution

Accepted Solutions
pathiqvd
Creator III
Creator III

Try this,


count(distinct Location_Code)

View solution in original post

3 Replies
pathiqvd
Creator III
Creator III

Try this,


count(distinct Location_Code)

agigliotti
Partner - Champion
Partner - Champion

you could use the below expressions in a chart object:

dimension: Driver_ID

measure : count( distinct Location_Code )


using a simple script like this:

LOAD

     Driver_ID,

     Delivery_Date,

     Location_Code

FROM ....

mdmukramali
Specialist III
Specialist III

Dear ,

Try

LOAD

     Driver_ID,

     Delivery_Date,

     COUNT (distinct Location_Code) AS Count_Delivery_Points

GROUP BY

     Driver_ID,

     Delivery_Date;