Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How can I check for duplicate records?

I've fetched the result of a SQL in a table-box. I want to check if there are any duplicate records. How can I do that?

3 Replies
SunilChauhan
Champion
Champion

after load table

take primary key into list box

go to list box properties-> Frequency

if it showing more than 1 then duplicates is available.

hope this helps

Sunil Chauhan
Not applicable
Author

Hi vawarali,

Sometimes you get duplicate sets of fields in the table but with different primary keys. I would personally write something in the script, as this is much more efficient but if I am doing this in the QVW I would use a chart object rather than a table box to display the number of records.

Use all the fields that you are interested in looking for as duplicates as the dimensions.

Then the expression will be = count(key_field)

or whatever the primary key is.

You can then either sort by the expression field, or set the expression to something like  = count(key_field)>1 to list only the duplicates.

Erica

Not applicable
Author

Hello,

Adding further to above count(Key_field) expression gives the total count and count(DISTINCT key_field) gives the distinct count.. try this in any list box.

Thanks