Hi Everyone. I need to delete duplicate rows in excel. But in that duplicate rows i need to keep one row.For example, in one column 3 more duplicate values is there.
@Buvaneshwaran_R Have you tried Remove Duplicate rows Activity ? In the Screenshot I donât think there are Proper Duplicates present. Is the duplicates based on a Column Value ?
@supermanPunch in that excel a column INVOICE124 itâs duplicate only if it is duplicate i want to first one keep it as same value in excel. Second duplicate i need to change the value for example
A B
INVOICE124 bbb
INVOICE124 0
I need this output. Second duplicate i want to replace the value name as 0
You could do it by using by using the following code:
DataTable distinctTable = dtRows.DefaultView.ToTable(true, "column1");
For example
Hope this helps!
DataTable FilterDt= MainDataTable.DefaultView.ToTable(true,âCompany Nameâ,âDateâ)
or use Remove Duplicate Rows Activity
MainDT.AsEnumerable().GroupBy(Function(a) a.Field(Of String)(âCompany Nameâ)).Select(Function(b) b.First).CopyToDataTable() - This is for finding only unique company
Thanks
Latika
@Buvaneshwaran_R Check this Workflow :
I have made it work by keeping only two of the Duplicates if any using a Linq Query and then Update the Value for the Second Duplicate using a For Each Row. I think this is the Output that you were expecting. If it doesnât match your required Output, please explain a bit more in detail.
Check the Input File. Execute the workflow. It should generate an Output Sheet in the same Excel. Revert back if it doesnât work.
RemoveProcessedDuplicates.zip (8.4 KB)
@supermanPunch I checked your zip file. Mean while 3 duplicate rows is there 3rd itâs automatically deleted. can you check once i have 2 more duplicates itâs there. Can you help me to solve this issue
@Buvaneshwaran_R Donât you need to keep only two Duplicates (including the original one) and Update the Second Duplicate ?
@supermanPunch in that your zip file. I have 4 duplicate values is there it will be automatically deleting 2 rows.
@supermanPunch I have more than 5 duplicates is there same invoice #
can you check and resolve this issue. can you help me
@Buvaneshwaran_R Can you give me the Input data where you are facing this issue and the Output that you are expecting? It will help faster to understand and solve it.
@supermanPunch canyou check this excel. There is 4 duplicate row is thereInput.xlsx (9.4 KB)
I need to keep 1 row same other 3 i need to change as 0
@Buvaneshwaran_R Ohh, So you want to keep all the duplicates as well and just update all duplicates to 0 keeping only one original value
@supermanPunch Yeah Correct. Like that i need can you help me
@Buvaneshwaran_R Considering the data in the âInvoice#â column will always be in that format. The workflow below should be able to give you the right output.
Check this workflow :
RemoveProcessedDuplicates.zip (9.5 KB)
@supermanPunch Thanks bro itâs working fine. Thanks for your help.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.