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: 
rpavan17
Creator
Creator

Count Duplicate Field 2 from a Table

Hi,

I have Field 1 and Field 2 in a Table. 

Field 1, Field 2

Orange, O1

Orange, O2

Green, G1

Green, G2

Yellow, O1,

Purple, O1

 

Like above, i need to find which is field 2 is duplicated and how many times it is duplicated?

Expected Answer is O1 is duplicated and 3 times.

Thanks in advance

Labels (2)
5 Replies
Anil_Babu_Samineni

Perhaps this?

Count({<[Field 2]={"=Count([Field 2])>1"}>} [Field 2])

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
rpavan17
Creator
Creator
Author

It did not work.

Anil_Babu_Samineni

What is the exact output and where?

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
Mauritz_SA
Partner - Specialist
Partner - Specialist

Hi there

Maybe not exactly what you want, but AGGR(Count([Field 2]),[Field 2]) will give you the number of times that Field 2 appears. If you use it with your Field 2 then you can easily manipulate it to only give you the values where it appears more than once.

Regards,

Mauritz

 

StarinieriG
Partner - Specialist
Partner - Specialist

Hi,

could you do it inside the script?

TABLE:
LOAD * Inline [
Field 1, Field 2
Orange, O1
Orange, O2
Green, G1
Green, G2
Yellow, O1
Purple, O1
]
;

Left Join (TABLE)

LOAD *

If(Count_field_2>1,'duplicated','not duplicated) as flag

;
LOAD
[Field 2],
Count([Field 2]) as Count_field_2
Resident TABLE
Group By
[Field 2]
;