Find Duplicates and Sum the values and update in Status Column

Hi,

PFA input data
Test1

PFA Output Data required
Test2

If there are Duplicate rows as shown in Input data, The Total column should be added and update the sum and update the Status column with Single/Duplicate values.

1 Like

Welcome to the UiPath Community @Srividya_N!

First create a build datatable with the column you need to check the duplicate for, you can create all three columns, say datatable is dtTemp

Read the file in a datatable, use a for each data row to loop through it,

Use loop up datatable activity, put current row element as Lookup Value, mention datatable as dtTemp and take the output in a variable

if the value is there already, that means it’s a duplicate and hence you can populate the actual datatable column for status as duplicate. You can use IF condition to check if the lookup datatable has return a integer value greater than 0 or not, it’ll be - 1 if the element is not found and this means the item is not pressent in the dtTemp.

after this simply add the data row in the dtTemp created at the start.

As the loop iterates, values will be added to dtTemp after confirmation of duplicate value

Hope this helps!

Check if attached code works for you.RemoveDuplicates.zip (9.5 KB)
I have created an excel file in the project similar to the one showed by you.

Mark this as solution is works for you.

Read in Excel into a datatable - read range

Variables:

Flow:

Later write back to Excel with a write range

Find starter help here:
SrividyaN.xaml (11.2 KB)

Also, have a look here: