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 8168613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:35:04+00:00 2026-06-06T20:35:04+00:00

I have following data structure (simplified): A giant list of the class TestClass public

  • 0

I have following data structure (simplified): A giant list of the class TestClass

public class TestClass
{
   public string Name { get; set; }
   public int Value { get; set; }
   public DateTime Date { get; set; }
}

I’m trying to find a LINQ-Query to get the number of items with the same Name and Value on one day. I tried it with multiple groupby-Statements but I didn’t get it…
Example:

Name  | Value | Date
Alice | 42    | 11.02.1900
Bob   | 4211  | 22.03.2030
Bob   | 4211  | 22.03.2030
Bob   | 42    | 22.03.2030
Bob   | 42    | 22.03.2030
Alice | 4711  | 30.01.2045

This data I want to get (Last number is the important one)

Alice, 42, 11.02.1900, 1
Bob, 4211, 22.03.2030, 3
Bob, 42, 22.03.2030, 2
Alice, 4711, 30.01.2045, 1

Thanks for your help!

Regards

  • 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-06T20:35:06+00:00Added an answer on June 6, 2026 at 8:35 pm

    You’re looking for

    list.GroupBy(o => new { o.Name, o.Value, o.Date })
        .Select(g => new { g.Key.Name, g.Key.Value, g.Key.Date, Count = g.Count() })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following data structure: public class Person { public string Name{get;set;} public
I have the following data structure: [DataServiceEntity] public class User { public string RowKey
I have the following data structure: public class Difference { public Difference() { }
I have a table emp with following structure and data: name dept salary -----
I have following data ct<-structure(list(Conc = c(50L, 100L, 150L, 50L, 100L, 150L, 50L, 100L,
So I have the following data-structure coming back from my server. {date:'2/1', name: 'product
I have the following (simplified) HTML structure <td> <DIV class=t-numerictextbox> <DIV class=t-formatted-value>$0.00</DIV> <INPUT id=MyObj_PropertyName
I have a table with the following (simplified) structure: INT id, INT type, INT
I have the following data structure and data: CREATE TABLE `parent` ( `id` int(11)
I have the following data structure (a list of lists) [ ['4', '21', '1',

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.