Check dup by column

I want to check dup by row condition as below.

  1. CusName and PlanCode as same → check value in column FPP —> keep row that FPP
    most value
  2. CusName and PlanCode as same → value in column FPP same value ----> keep 1 row

Please guide me about it.
remark : Real Data have 1K rows
input2.xlsx (9.7 KB)

1 Like

Hi @fairymemay

  1. You can create a datatable with Build Datatable activity first var_DT_Final
  2. Apply for each loop on Input table/sheet
  3. Filter 2nd table/sheet with CusName and PlanCode as same, sort the filtered datatable in desc order for FPP column and take first row. Add this row in Build datatable variable var_DT_Final
  4. Filter 2nd table/sheet with CusName and PlanCode as same → value in column FPP same value condition if it returns any value take the first row and add in the var_DT_Final.
  5. At the end of the loop var_DT_Final would have the required data.

Thanks,
Prankur

1 Like

@PrankurJoshi i don’t clear in step3.

You can create flow for sample to me.

1 Like

@fairymemay After reading excel use below code in assign activity this will remove duplicate rows.

DT = Dt.AsEnumerable.GroupBy(Function(i) i.Field(Of String)(“CusName”)).Select(Function(g) g.First).CopyToDataTable

image

@indra condition​ check​ dup​ as​ below.
Not​ check​ column​ CusName​ only.

  1. CusName and PlanCode as same → check value in column FPP —> keep row that FPP
    most value
  2. CusName and PlanCode as same → value in column FPP same value ----> keep 1 row

@indra @PrankurJoshi Can you create flow for guide to me?

Hello,

For this problem, you can First flag the rows that are duplicates and later delete them from excel with an Insert/Delete Rows activity to delete the rows that are flagged. I have created a solution, you can have a look, and do let me know if you have any further queries.

ExcelDupicateDelete.xaml (35.4 KB)

2 Likes

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