I’ve a data table and interval size as 10
Input table:
DateTime ChNo Data
--------------------------
6/10 10:10 1 0.1
6/10 10:20 1 0.1
6/10 11:05 2 0.1
6/10 11:06 2 0.1
6/10 11:07 2 0.1
6/10 11:08 2 0.1
6/10 11:09 2 0.1
6/10 11:10 2 0.1
6/10 11:11 2 0.1
6/10 11:12 2 0.1
6/10 11:13 2 0.1
I need to convert above table based on interval size, as i explained above if interval size is 10 my target table should look like
DateTime ChNo Data
--------------------------
6/10 10:10 1 0.1
6/10 10:20 1 0.1
6/10 11:10 2 0.6 -----> sum of intervals from 11:05 to 11:10
6/10 11:13 2 0.3 -----> sum of intervals from 11:11 to 11:13
What is the best way to get desired output like above using linqs
Thanks,
Murali.
I haven’t found the Linq solution but I can offer you a programmatic one. Note that I did this using full DateTime representation because of parsing instead of your that doesn’t have year. Check the code: