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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to count Duplicate Id's only?


Hi ,

I want to count only duplicate id's.

Ex:

id

1

2

3

4

5

1

2

1

3

2.

In above 1,2,3 id are repeating so my output count should be:3 

How we can calculate????

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try something  like:

=Count (If(Aggr(Count(id),id)>1,id) )

Edit: Parenthesis correction

View solution in original post

10 Replies
tresesco
MVP
MVP

Try something  like:

=Count (If(Aggr(Count(id),id)>1,id) )

Edit: Parenthesis correction

christian77
Partner - Specialist
Partner - Specialist

Hi.

COUNT(

IF(

AGGR(COUNT(ID),ID)

>1

,1)

christian77
Partner - Specialist
Partner - Specialist

that was fast.

I think your first count needs distinct.

jagan
Partner - Champion III
Partner - Champion III

Hi Ashok,

Try this

=Sum(Aggr(If(Count(id) > 1, 1, 0), id))

Regards,

Jagan.

Not applicable
Author


Hi

tx for ur reply, but in above case i am getting difference value means

above expreesion works like this

=count(distinct id )-count(id)

I need count of id's where repeting more than once's

er_mohit
Master II
Master II

try this in text object

=Count(Aggr(NODISTINCT Count(id),id))

swuehl
MVP
MVP

Or try

=count({<id = {"=count(id)>1"}>} distinct id)

tresesco
MVP
MVP

Nope! I guess you are missing somewhere. Because that is already aggregated. Isn't it so?

Not applicable
Author

Can anybody tell me how to do that in script?