title: Delphi: How to aggregate just the ranged records in TClientDataset?
body: <p>I need to make some aggregates using  <strong>TClientdataset</strong>. In SQL these aggregates can be done with script like this :</p>
  
  <pre><code>Select Sum(column1) from table1 where Date_Column &lt; Date_Value
  </code></pre>
  
  <p>Because I need more speed during a very long process and a very slow network, I want to use in-memory aggregates instead of using sql . My idea is to add an aggregate to the ClientDataset with Expression like this:</p>
  
  <pre><code>Sum(column1)
  </code></pre>
  
  <p>And make Date_Column index, then filter the clientdataset like this:</p>
  
  <pre><code>myClientdataset.SetRang([value1],[value2]);
  </code></pre>
  
  <p>I was expecting to see the aggregate result of this range, but, unfortunately the aggregate ignore the range and keep giving the result of all records!</p>
  
  <p>So, my question is: how I can achieve this in TClientdataset? Or, do you have any other idea how to do ranged-aggregates in memory?</p>