views:

199

answers:

1

I have DataSet. it returns date, and value by date.

for ex:

01.01.2009   454
02.01.2009   785
03.01.2009   475
----------   ---
30.01.2009   523

I need new DataSet, that group by week. for ex:

1 Week 1-7   2017
2 Week 7-15  4586  
-----------------
5 Week 24-30 1482

Week begin from monday.

not importand only for this example, important that, how group by (x) initial DataSet.

Please, any Idea.

+1  A: 

Either iterate by the original dataset, gather the info and enter it to the new dataset, or add a week column to the database, and query the table using group by to get the dataset that you want.

Dani
I'm interested in first variant.
loviji
so just iterate through all the rows. if they are ordered by date it is even easier, create a new dataset with the new columns you need and build it row by row.
Dani
thanks, i'll try
loviji