I am having a bit of trouble trying to find a solution or at least a start to a solution for this datatable manipulation. I’m starting with a datatable that looks something like this
Where I have a list of locations and dates followed by a lot of other information(it wont be taken into account in this, I wanted to mention it however). I am looking find a way to count the number of the same dates per location and create a datatable that looks similar to this
I know that I could loop through the table row by row and and create a table similar to my output by storing counts but I want to avoid that if possible since there will be a large number of rows and there could be a lot of different dates and locations.
I also know that a similar task can be done in excel quite easily using the pivot table function which is what is being done in the process right now (I will not need the grand total columns).
I’m hoping someone can point me in the right direction and help me create a LINQ function that could do a similar thing. Thank you all!