Hello Everyone,
I am looking for a help on How to get the duplicate rows in a separate DT without removing them, depending on the conditions given on the Columns.
For Example:
If Payment /Receipt Reference and Credit LC matches then only we need to get the Duplicate rows in a Data Table.
Thank you very much in Advance.
Regards
Vishnu
lakshman
(Ganta lakshman)
June 11, 2019, 5:51am
2
@winningvish
use Read Range activity to read the data from excel file and will give you output as dataTable say ‘DT’.
Then try below expression to get duplicate records.
DuplicateDT = DT.DefaultView.ToTable(false,“Payment /Receipt Reference”,“Credit LC”).CopyToDataTable
Note: False - for Duplicate records
True - for Unique records
2 Likes
Hi @winningvish
To get the duplicate rows alone from a DT, kindly have a view on this once
HI @Sunitha_Bist1 ,
Duplicate records from the same data table
(From p in dt.Select() where( From q in dt.Select() where string.Join(",",q.ItemArray).Equals(string.Join(",",p.ItemArray)) Select q).ToArray.Count>1 Select p).ToArray.CopyToDataTable()
Try this one
If you want specific Column alone mention the column name
(From p in dt.Select() where( From q in dt.Select() where q("ColumnName").Equals(p("ColumnName")) Select q).ToArray.Count>1 Select p).ToArray.CopyToDataTable()
Regards,
Arivu …
Cheers @winningvish
2 Likes
Hi Lakshman,
Thank you for your kind reply.
As per your code it is giving entire rows.
Regards
Vishnu
1 Like
lakshman
(Ganta lakshman)
June 11, 2019, 6:30am
5
@winningvish
If possible could you please share that excel and xaml file. Will check and update you.
1 Like
Hi Palaniyappan,
Thank you but still in confusion to get the Duplicate Rows from DT. Would you please elaborate a bit more.
Before that let me explain my scenario again.
I have a Status Column and would like to get the Duplicate rows in a different DT.
Regards
Vishnu
Sure Lakshman,
Please find attachedDuplicateRows.zip (25.6 KB)
1 Like
I have a Status Column and would like to get the Duplicate rows in a different DT.
lakshman
(Ganta lakshman)
June 11, 2019, 7:02am
9
@winningvish
Sorry its my bad.
If you specify True , then it will delete duplicate records and will give unique records.
If you specify False , then it will give all records.
To find duplicate records, please check below thread.
Hi,
I am new to UiPath. I have a request of how to find and copy the duplicate records to new sheet of the excel sheet.
1 Like
system
(system)
Closed
June 14, 2019, 7:02am
10
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.