I want to take first row data column 3 to column 12 other all below data will be delete which has duplicate ID and Duplicate Address value

Condition:
1.Take first row dat which has duplicate ID and State if ID is one but state is different then its different data
2. only update column 3 to 12 (Value 1 to value 10)

Hi @Garyy ,
Have same topic with you,
You can use activity, find first value, next row if similar → blank,
If differ → assign to new value
regards,

this topic is not working

Can you share your file?
I will test it

Sure
Output.xlsx (10.5 KB)

I need confirm, file have 2 sheets
sheet input is expect output and sheet output is input
that’s right?


Sorry i miss match the name above one is input and below one is output

I see, sheet input is expect output and sheet output is input
→ math with orginal QA

yes @Nguyen_Van_Luong1
Hi, You got solution?

Sr reply late, today is monday, I have meeting with customer
my code
Graay.zip (12.6 KB)
my in/out
Output.xlsx (11.8 KB)

intput

my output

pls confirm it correct or not?

Hi Thanks for solution @Nguyen_Van_Luong1 Is there any solution to we pass only column index because i dont want to put hard code column name

Hi @Garyy ,
We can use index of columns
eg: row(0),…
But I think we can use LINQ, but now I have test with LINQ, you can use that way if it has correct result

We can use columns name or index

Yes we can @Nguyen_Van_Luong1

Yes, quick time, I used index to fast have output, you can edit it to name of columns

Hi @Garyy ,

Below LINQ will be useful for your query.

inputDt.AsEnumerable.GroupBy(Function(a) a(0).ToString).SelectMany(Function(b) b.Select(Function(c,i) inputDt.Clone.LoadDataRow(new object(){c(0),c(1),if(i=0, c(2).ToString,“”),if(i=0, c(3).ToString,“”),if(i=0, c(4).ToString,“”),if(i=0, c(5).ToString,“”),if(i=0, c(6).ToString,“”),if(i=0, c(7).ToString,“”),if(i=0, c(8).ToString,“”),if(i=0, c(9).ToString,“”),if(i=0, c(10).ToString,“”),if(i=0, c(11).ToString,“”),c(12),c(13)},false ))).CopyToDataTable

And you can modify the column indices accordingly.

Tried with the same input like as yours. Hope it solves. and mark solution.



Regards,
Shaik Najeer.