I agree with Stefan in both using the EXISTS() with unique value fields and using the QlikView Cookbook.
Taking a look at your script, there are several things I can think of
First is that you might not need a loop to load from several tables, you can do a
FROM *.QVD (QVD);
Second is that you can load all values you want to keep (or get rid of) in a table and loop that table (or use a mapping table, or the exists clause) in the WHERE part to load only those records. The problem here is how do you identify uniquely those records you want to load. There are function such as Max() or FirstSortedValue() that usually return one value depending on the GROUP BY part, but if the values are not unique, you need something else.
Post some sample data to see how can we help further.