Check text between column same or not?

I want to check value in column Cusname and Name1 if same —> write True in column ChkName1 , But if not same write False

and check value in column Cusname and Name2 if same —> write True in column ChkName2 , But if not same write False

chk.xlsx (8.8 KB)

Remark : My data have 4K rows.

Please guide me about it.

Hi @fairymemay ,

Could you try this and see if it works out for you?

(From row In dt_sampleData.AsEnumerable()
Let ck1 = If(row("Cusname").ToString.Trim.ToLower.Equals(row("Name1").ToString.Trim.ToLower),"TRUE","FALSE")
Let ck2 = If(row("Cusname").ToString.Trim.ToLower.Equals(row("Name2").ToString.Trim.ToLower),"TRUE","FALSE")
Let ra = new object(){row(0),row(1),row(2),ck1,ck2,row(5)}
Select dt_result.Rows.Add(ra)).CopyToDataTable()

checkNames.xaml (6.7 KB)

Kind Regards,
Ashwin A.K

1 Like

@fairymemay As suggested by @ashwin.ashok kindly go with LINQ approach …let us know if you are stuck

Thanks

@ashwin.ashok @nikhil.girish In real file I have 50 column.
It have shortly code in line

Let ra = new object(){row(0),row(1),row(2),ck1,ck2,row(5)}

Hi @fairymemay ,

Can try this instead:

row.ItemArray.Take(2).Concat({ck1,ck2}).Concat(row.ItemArray.Skip(4)).ToArray()

Kind Regards,
Ashwin A.K