Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
sculptorlv
Creator III
Creator III

Count unique values only

Hello, I guess my question is very easy, still can't find solution..

I have table:

 

ClassNr2.
LIRIKAK000545
LIRIKAK000545
LIRIKAK000545
LIRIKAK000650
LIRIKAK000703
LIRIKAK000168
LIRIKAK000551

I need to get count of all unique Nr2 for each class.

I use Count(nr2) and get sum of all rows - the result is 7

But I need only count unique Nr2 .. and the result must be 5. How can I modify my COUNT?

ClassNr2.
LIRIKAK000545
LIRIKAK000650
LIRIKAK000703
LIRIKAK000168
LIRIKAK000551
1 Solution

Accepted Solutions
Mark_Little
Luminary
Luminary

Hi

Try

Count(Distinct nr2)


Mark

View solution in original post

5 Replies
Mark_Little
Luminary
Luminary

Hi

Try

Count(Distinct nr2)


Mark

sunny_talwar

May be one of these:

Count(DISTINCT nr2)

or

Count(Aggr(Count(Distinct nr2), Class))

Chanty4u
MVP
MVP

use rownum() 

or

count(distinct urfield)

Anonymous
Not applicable

Count(Distinct Nr2.)

sculptorlv
Creator III
Creator III
Author

Thanks to all of you!