title: How to sum array value of duplicate data
body: <p>I have an array with some of same <code>ID</code> value as shown in below.</p>
  
  <pre><code>[
      {"ID":"126871","total":"200.00","currency":"USD","name":"John"},
      {"ID":"126872","total":"2000.00","currency":"Euro","name":"John"},
      {"ID":"126872","total":"1000.00","currency":"Euro","name":"John"},
      {"ID":"126872","total":"500.00","currency":"USD","name":"John"},
      {"ID":"126872","total":"1000.00","currency":"Euro","name":"John"},
  ]
  </code></pre>
  
  <p>If the <code>ID</code> value is duplicate, sum the total value of the same <code>currency</code>. For the different <code>currency</code> of same <code>ID</code>, no need to sum <code>total</code>.</p>
  
  <p>Here is what I want.</p>
  
  <pre><code>[
      {"ID":"126871","total":"200.00","currency":"USD","name":"John"},
      {"ID":"126872","total":"4000.00","currency":"Euro","name":"John"},
      {"ID":"126872","total":"500.00","currency":"USD","name":"John"}
  ]
  </code></pre>
  
  <p>I am stuck with the above problem. I already tried as much as I can. But I got the wrong result. I'm very appreciative for any advice.</p>