How to pick duplicate records based on column?

Hi Friends,

I have two columns in excel.i need my output as below:

i need to filter duplicate records from excel based on column’address’.
image

INPUT
ORDERNO. Street Address(A)
11661297 8750 FRESNEL
11661297 694-6 Alem Zona 1 Campana, Pica
11583987 6 Rodovia
11654839 5123 JUAN RAMÓN ESTOMBA
11654839 5123 JUAN RAMÓN ESTOMBA
11551462 841 CALLE FELIX DE AZARA
11551462 419 AVENIDA COLON
11551462 419 AVENIDA COLON
11551462 419 AVENIDA COLON

OUTPUT:
ORDERNO. Street Address(A)
11654839 5123 JUAN RAMÓN ESTOMBA
11654839 5123 JUAN RAMÓN ESTOMBA

Note: we need to pick order numbers which have same addresses.

Thanks,
Chandini.

@chandini_dudekula

Welcome to our UiPath Community.

  1. use Read Range activity to read the data from excel file and will give you output as DataTable and say ‘inputDT’

  2. And then try below expression.

       duplicateDT = (From p in dt.Select() where( From q in dt.Select() where q("Street Address(A)").Equals(p("Street Address(A)")) Select q).ToArray.Count>1 Select p).ToArray.CopyToDataTable()

Hi
Welcome to uipath community
Kindly have a view on this thread

Cheers @chandini_dudekula

Hi lakshmn, i tried the same way,but im getting below error

@chandini_dudekula

Please follow below mentioned steps to resolve this error.

@lakshman
my output should be
ORDERNO. Street Address(A)
11654839 5123 JUAN RAMÓN ESTOMBA
11654839 5123 JUAN RAMÓN ESTOMBA

but i’m getting output as
image ORDERNO. Street Address(A)
11654839 5123 JUAN RAMÓN ESTOMBA
11654839 5123 JUAN RAMÓN ESTOMBA
11551462 419 AVENIDA COLON
11551462 419 AVENIDA COLON
11551462 419 AVENIDA COLON

here we should ignore the order 11551462 where all of its addresses are not same.

1 Like

Did this thread help us in this


Cheers @

@Palaniyappan

i’m not getting correct output.

My desired output should be:
11654839 5123 JUAN RAMÓN ESTOMBA
11654839 5123 JUAN RAMÓN ESTOMBA

but i’m getting output as:
ORDERNO. Street Address(A)
11654839 5123 JUAN RAMÓN ESTOMBA
11654839 5123 JUAN RAMÓN ESTOMBA
11551462 419 AVENIDA COLON
11551462 419 AVENIDA COLON
11551462 419 AVENIDA COLON

But I hope your requirement is met

Cheers @chandini_dudekula

@chandini_dudekula

This is what you asked right. You said want to find all duplicate records from the input data.

If you want to find particular Order No. duplicate records then try below expression.

          orderDuplicateDT = inputDT.Select("ORDERNO. = '11654839'").CopyToDataTable