Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to find the matching records in a table?

I have a table where Names are getting repeated. I want to pull all those repeating names in a separate table. How should I that?

So My table is,

NameCountryUnitSystem
Ran PittSAelectricpu
Jack MouPAenginemo
Ran PittSAthermaltg
Shriy SharmaAAhydrotg
Ran PittNAelectricpu
Jack MouPAenginegf
Honey SinghWIhydroba

After pulling duplicate records, output should be

NameCountryUnitSystem
Ran PittSAelectripu
Ran PittSAthermaltg
Ran PittNAelectricpu
Jack MouPAenginemo
Jack MouPAenginegf

Many thanks in advance ❤️

3 Replies
swuehl
MVP
MVP

Maybe like

Table:

LOAD Name,

     Country,

     Unit,

     System

FROM

[https://community.qlik.com/thread/292316]

(html, codepage is 1252, embedded labels, table is @1);

Right JOIN

LOAD Name

WHERE Count>1;

LOAD Count(Name) as Count, Name

Resident Table

GROUP BY Name;

Anonymous
Not applicable
Author

I really appreciate your help, but somehow it is not working.

I did this way also, but still no luck.

Table:

LOAD Name,

     Country,

     Unit,

     System

FROM

xyz;

Table1:

Load *,
If((Count(Name)>1),'Repeated', 'Non-Repeated') as Repeaters
Resident Table
Group By Name;

Drop table Table;

Please suggest.

swuehl
MVP
MVP

The code I've posted should work as requested, I get this result:

Name Country System Unit
Ran PittNApuelectric
Jack MouPAgfengine
Jack MouPAmoengine
Ran PittSApuelectric
Ran PittSAtgthermal

Your code is not executing because you need to either aggregate the fields in your second table load or add them to the GROUP BY clause.

Guess this is what you want to do instead (replacing your second LOAD):

Table1:

LEFT JOIN (Table)

Load Name,

If((Count(Name)>1),'Repeated', 'Non-Repeated') as Repeaters

Resident Table

Group By Name;

Name Country System Unit Repeaters
Honey SinghWIbahydroNon-Repeated
Jack MouPAgfengineRepeated
Jack MouPAmoengineRepeated
Ran PittNApuelectricRepeated
Ran PittSApuelectricRepeated
Ran PittSAtgthermalRepeated
Shriy SharmaAAtghydroNon-Repeated