Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8264481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:28:23+00:00 2026-06-08T04:28:23+00:00

my data look like: read_date | T1 | T2 | 15.02.2000 | 2 |

  • 0

my data look like:

 read_date |  T1  |  T2  |
15.02.2000 |   2  |   3  |
16.02.2000 |   4  |   5  |
15.03.2000 |   2  |   3  |
16.03.2000 |   5  |   4  |

I want to get mountly sum of T1 and T2, like this:

 read_date |  T1  |  T2  |
   02.2000 |   6  |   8  |
   03.2000 |   7  |   7  |   

I try to write something like this:

var result = from s in meter_readings.Take(10)
             group s by new { s.read_date} into g
             select new
             {
                 read_date = g.Key.read_date,
                 T1 = g.Sum(x => x.T1),
                 T2 = g.Sum(x => x.T2)
             };

but this does not give expected data.Is there any example to give data hourly sums, daily sums, etc.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T04:28:25+00:00Added an answer on June 8, 2026 at 4:28 am

    You should only take the year and month into account when grouping:

    var result = 
        from s in  meter_readings.Take(10)
        group s by new { date = new DateTime(s.read_date.Year, s.read_date.Month, 1) } into g
        select new
        {
            read_date = g.Key.date,
            T1 = g.Sum(x => x.T1),
            T2 = g.Sum(x => x.T2)
        };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I large messy data files that look something like this: 1 2 3 4
I'm using JSON.Net for serializeation. I need my data to look like this json
Because data from file look like this: line 1 is name (first last), next
This is what my data model classes look like: public class Employee { public
I have a data source with about 2000 lines that look like the following:
I have a large nested vector that look like this: import Data.Vector let x
I'm plotting some data curves with gnuplot, and they look like this: However, the
I am writing data in a file. The file will look like this. [section1]
I need to read in data files which look like this: * SZA: 10.00
I have a python file like this import urllib2 try: data = urllib2.urlopen('http:....').read() except

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.