Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

sculptorlv
Contributor II

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!

Tags (1)
1 Solution

Accepted Solutions
pathiqvd
Contributor III

Re: Count unique

Try this,


count(distinct Location_Code)

3 Replies
pathiqvd
Contributor III

Re: Count unique

Try this,


count(distinct Location_Code)

agigliotti
Honored Contributor II

Re: Count unique

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
Valued Contributor II

Re: Count unique

Dear ,

Try

LOAD

     Driver_ID,

     Delivery_Date,

     COUNT (distinct Location_Code) AS Count_Delivery_Points

GROUP BY

     Driver_ID,

     Delivery_Date;