Duplicate Filter with more conditions

Hi ,

I want to add another condition for duplicate selection. How to add Column 2 to the duplicate flter condition.

  1. Select row for a Product with earliest date but if Column 2 is “No” then select that without any consideration .

So for Product 2 -4th row is selected as it has earliest date in product 2 but for Product 1 first row needs to be selected as Column = NO

How can i add Column 2 in duplicate Filter condition.

Column 1 Column 2 Column 3 Column 4
Product 1 No 5/10/2025
Product 1 Yes 2/10/2025
Product 1 Yes 3/10/2025
Product 2 Yes 1/10/2025
Product 2 Yes 2/10/2025
Product 2 Yes 3/10/2025

Thanks,

@rds you can try and use window functions in a local H2 SQL database

2 Likes

Hi @rds , your actual requirement appears to be that you are wanting to remove duplicates of Column 1 so that you retain only a single row for each product.

Since you have specific criteria by which you want to choose which row to keep, you can just make use of the fact that by default the Duplicate Row Filter will keep the first row it encounters for each duplicate. You can change the criteria used by Duplicate Row Filter (especially by opening the “advanced” setting) but this won’t give you the ability to include more than one “other” column on which to base the decision, so instead, make sure your data set is in the correct row order so that the first row for each product is the one you wish to keep.

You will of course need to ensure that Column 3 is actually a date (or is in yyyy-mm-dd format) so that you can sort it correctly in ascending date order:

Do this:

By Sorting on Column 2 asc, it will ensure that No appears before Yes. Make sure this appears in the sort ordering before Column 3 because it then has priority.

Set the Duplicate Row Filter to then just find duplicates for Column 1:

The duplicate Row Filter will then return the first row encountered for each product

Result of Sorter:

Result of Duplicate Row Filter:

7 Likes

Thanks @takbb really appreciate it mate. This once actually resolved my problem.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.