Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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
MVP
MVP

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 ....

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
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;