I have an Excel file with 3 columns (ID,Channel, Date).
In the first column “ID” are some equal values respectively duplicates, which i want to erase from the file (the whole row).
How can I delete all the “ID” duplicates?
Is it possible to do this directly in a data table? (Read range-> generate DT → erase duplicates)
Furthermore I would like to count the ID’s per Date and put the amount of each Date in a specific cell of another Excel file.
Is there an easy way to solve this? Is it possible to evaluate this directly in a data table or should I do it in a separate Excel file with a formula (write cell)?
Yes, in order to do it you could use LINQ like the example from this link:
I’m trying the following LINQ query, but it’s not working yet:
(From sales In From row In dtResult.AsEnumerable()
Group row By row.Field(Of Int32)("Id") Into sales
Order By sales.Id
Select New With { _
.Id = sales.Id, _
.CountOfClients = sales.Count() _
})
It says that it contains an error, but I couldn’t find how to solve it until now.