Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Contributor

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 (3)
5 Replies
Highlighted

Re: Count Duplicate Field 2 from a Table

Perhaps this?

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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Contributor

Re: Count Duplicate Field 2 from a Table

It did not work.

Highlighted

Re: Count Duplicate Field 2 from a Table

What is the exact output and where?

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Valued Contributor

Re: Count Duplicate Field 2 from a Table

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

 

Highlighted
Partner
Partner

Re: Count Duplicate Field 2 from a Table

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]
;