Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Uzumaki_N
Contributor III
Contributor III

Remove duplicate row from a table

qlik.png

 

 

How to remove the row where id is duplicate and column xyz is "No" ? 

It should be at the script level.

 

 

Labels (3)
6 Replies
Uzumaki_N
Contributor III
Contributor III
Author

salonicdk28
Creator II
Creator II

Hi, 

You ca create a flag like 

If( ID =Previous(ID) and xyz='No',1,2) as Flag

Then after that you can place the value of flag as 1 in the expression, it should work 

Uzumaki_N
Contributor III
Contributor III
Author

Hi,

 

There are thousands of rows and what if duplicate id are not successive? 

marcus_sommer

You could apply the suggestion from @salonicdk28 on a resident-load by using an order by on the id and maybe some other fields. 

Uzumaki_N
Contributor III
Contributor III
Author

This is not working 100% are there are many duplicates for a single id.

marcus_sommer

The main-logic will work but you may need one or two more if-loops to check and to react on further conditions and/or to adjust the right load-order. Applying the various condition as extra fields will show how they are evaluated and adding recno() and rowno() to the load will show which source-record is now loaded in which order.