Apologies if this has been asked before, but I'm not sure if I've asked the correct question. Here's my problem:
I have data such as
AA01 JAN 100
AA01 JAN 200
AA01 FEB 200
AA02 JAN 50
AA03 FEB 500
AA03 MAR 250
AA03 MAR 75
And I'd like to get this into a result IEnumerable looking something like:
Result{
string Key,
int Jan,
int Feb,
int Mar,
...
}
IEnumerable<Result> results = .....
KEY JAN FEB MAR
AA01 300 200 0
AA02 50 0 0
AA03 0 500 325
The month columns are fixed if that helps, but I can't work out how to get a linq query to produce these results? I can repeatedly iterate the data and add to the results in standard loops, but this sounds like the wrong way to be going.
Thanks for any assistance :)