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

Count (distinct ..) with 2 parameters

Hi Experts,

I came across an expression in which 2 parameters were passed in the Count(Distinct para1&para2) and I am not pretty sure whether i get it correctly or not, hence would like to hear from the experts on this.

Expression : =count({<[Type]={'Document'}>} DISTINCT ID&[DOC Name])

In the expression above Count (Distinct) is used with 2 parameters i.e. ID and NAME followed by a where condition of Type= "Document".

According to my understanding the above expression is counting number of Distinct ID of respective DOC Name followed by where condition.

Would like to hear from you whether my understanding is correct or not?

Thanks,

Punit

1 Solution

Accepted Solutions
tresesco
MVP
MVP

It counts the Distinct combination of ID and NAME. You can assume of a composite key made of ID and NAME, and the expression gives the distinct count of the key followed by where clause (like you said).

View solution in original post

2 Replies
Anil_Babu_Samineni

Assume, If we have the same values from those two fields of concatenate it will work as you think.

But,

Load *, [DOC Name] & ID as Key Inline [

ID, DOC Name, Type

1, A, Document

2, B, Document

3, C, Document

1, A, Document1

];

=count({<[Type]={'Document'}>} DISTINCT Key)

Try this from your end on your personal edition.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
tresesco
MVP
MVP

It counts the Distinct combination of ID and NAME. You can assume of a composite key made of ID and NAME, and the expression gives the distinct count of the key followed by where clause (like you said).