Remove duplicate rows based on 2 columns in excel

Hello,

I want to remove the duplicate rows which has same as invoices number and keep the row which has success in status for that invoice number

As far as I see it you just need to filter out where the status reports “failed…”

Filter DataTable Activity
Option : Rows (click remove):
ColumnName : “Status” – Contains – “Failed”

@Chaitan

let us introduce a case pretty similar to yours. So maybe it is matching your case or just require some minor reworks.

given data:

Ref Info Status
A ABC Init
A ABC Failed
B Failed
C Failed
C Success
D Success
D PostEdited Success
E TestCase Success

we can set up following rules and scenarios

  • duplicates are defined by having the same value from column Ref
  • A: has duplicates, but no success - keep all
  • B: is not duplicated - keep it
  • C: has duplicates, has success - keep only success
  • D: has duplicates, has only success - keep all success
  • E: for completenes reasons, no duplicates - keep it

Applying all these rules leads to following result:

[Ref Info Status
A ABC Init
A ABC Failed
B Failed
C Success
D Success
D PostEdited Success
E TestCase Success

So we do get:
all rules are applied
C - removal from non success

find demo XAML here:
FilterDups_1Col_IfPresentOrAll_1ColFilter.xaml (8.0 KB)

in general it should also work for your scenario. It was fast prototyped with LINQ, but we can also decomposite it and do mapping the different blocks to essential UiPath activities.

Let us know your feedback

Hi @Chaitan,

Check this .

Regards
Balamurugan.S

Ok this below scenario. remove duplicate invoices nu,mber and keep the success status of that invoice number.

Some invoice can fail as status but they are valid scenario