hello all
I have a table ,created in memory as below:
how to sumarize this table ,so it merge (sum) the value in column where ever the year and the month are same.
Here I show the table after summarized also
//----------------------before
year Month Val1 Val2 val3 Val4
2009 11 900000 0 0 0
2009 11 0 700000 0 0
2010 3 6100000 0 0 0
2010 3 0 7500000 0 0
2010 3 0 0 900000 0
2010 3 0 0 0 0
//------------------------after
year Month Val1 Val2 val3 Val4
2009 11 900000 700000 0 0
2010 3 6100000 7500000 900000 0
Loading
Sam HobbsPosted Mar 13, 2010, 1:27 PM
Just iterate through the data and when the next year and month are the same as the previous, summarize; when they are not the same, set the summaries to the current values.