linq sum group by

var result = source
    .GroupBy(x => x.Currency)
    .Select(g => new {
        Currency = g.Key,
        Total = g.Sum(x => x.FeesCustom > 0 ? x.FeesCustom : x.FeesNormal)
    });

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
c# linq group by with sum Linq method syntax group by sum group by and sum c# linq group by and sum timeSpan in linq list group by sum using linq in c# linq group by sum column c# linq group sum linq group multiple by sum functional linq group by sum linq sum value of groupby c# linq sum value of groupby group by and sum linq group by in linq with sum c# linq group by and sum linq groupby and sum linq sum by group how to sum grouped value in linq linq group by and get sum linq group by into with sum group by sum and sum linq C# linq group by sum sales sum with group by linq without group sum in linq sum and group linq conditionnal sum in a linq group LINQ group and sum LINQ sum by grouped field groupby and sum linq group by sum linq linq sum without group by diffrent sum based on group by linq c# sum in linq without group by linq group by with sum linq query syntax where on group sum Linq group by sum inn c# linq grouping and sum data linq query syntax group by sum linq group into sum c# linq sum group by linq group by and sum sum without group by linq group by sum in linq c# sum group linq Linq gropu by sum sum without group linq c# linq method syntax groupby sum c# group by sum linq group by and sum linqc# linq group and sum list linq query sum group by inline query linq query sum group by c# linq group by sum sum group by linq c# sum linq group by LINQ g.Sum(x=>x.fields1 + x.fields2... linq sum with group by sql sum group by linq core group by sum linq sum column querydsl group by sum example linq to objects sum multiple properties SQL SUM in linq linq to entities sum linq group by sum how to sum same products in sql in asp linq linq object with select and sum linq sum object group by and sum in list c linq sum group by
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source