title: How to grouping and summing Jarrays based on certain keys
body: <p>i have data and code like this for filtering by country and count it.
  but i can only filter them one by one.</p>
  <p>Data :</p>
  <pre><code>[
     {
        &quot;Name&quot;:&quot;Amal&quot;,
        &quot;Country&quot;:&quot;India&quot;,
        &quot;salary&quot;:&quot;4.000,00&quot;
     },
     {
        &quot;Name&quot;:&quot;Luke&quot;,
        &quot;Country&quot;:&quot;England&quot;,
        &quot;salary&quot;:&quot;2.500,00&quot;
     },
     {
        &quot;Name&quot;:&quot;Tom&quot;,
        &quot;Country&quot;:&quot;Australia&quot;,
        &quot;salary&quot;:&quot;2.700,00&quot;
     },
     {
        &quot;Name&quot;:&quot;Ram&quot;,
        &quot;Country&quot;:&quot;India&quot;,
        &quot;salary&quot;:&quot;2.000,00&quot;
     }
  ]
  </code></pre>
  <p>Code :</p>
  <pre><code>using System;
  using Newtonsoft.Json.Linq;
     
          public class Program
          {
              public static void Main()
              {
                  string inputJson = &quot;[{'Name':'Amal', 'Country':'India','salary':'4.000,00'},{'Name':'Luke', 'Country':'England','salary':'2.500,00'},{'Name':'Tom', 'Country':'Australia','salary':'2.700,00'}, {'Name':'Ram', 'Country':'India','salary':'2.000,00'}]&quot;;
                  var jArrObject = JArray.Parse(inputJson);
                  Console.WriteLine(&quot;***Employee Data***&quot;);
                  var employee = new JArray(jArrObject.SelectTokens(&quot;$.[?(@.Country=='India')]&quot;));
                  Console.WriteLine(&quot;Total Employee : &quot;+employee.Count);
                  Console.WriteLine(&quot;Employee : &quot;+employee);
              }
          }
  </code></pre>
  <p>I was expecting to get a result like this :</p>
  <pre><code>[
     {
        &quot;country&quot;:&quot;India&quot;,
        &quot;Total Employee&quot;:&quot;2&quot;,
        &quot;Total Salary&quot;:&quot;6.000,00&quot;
     },
     {
        &quot;country&quot;:&quot;England&quot;,
        &quot;Total Employee&quot;:&quot;1&quot;,
        &quot;Total Salary&quot;:&quot;2.500,00&quot;
     },
     {
        &quot;country&quot;:&quot;Australia&quot;,
        &quot;Total Employee&quot;:&quot;1&quot;,
        &quot;Total Salary&quot;:&quot;2.700,00&quot;
     }
  ]
  </code></pre>
  <p>how to make an array object group by country and add sum salaries according to the country?</p>