title: Syntax for Aggregating a Filtered Dataset in OData v4 Spec using $apply
body: <p>Suppose I am querying a dataset called <code>Sales</code> with the following schema:</p>
  
  <p><code>id (int)
  price (decimal)
  active (bit)</code></p>
  
  <p>Using the <code>$apply</code> query option and the <code>aggregate</code> transformation of the <a href="http://docs.oasis-open.org/odata/odata-data-aggregation-ext/v4.0/cs01/odata-data-aggregation-ext-v4.0-cs01.html#_Toc378326289" rel="nofollow">OData v4 spec</a>, what would be the syntax for finding the average price for only active Sales?</p>
  
  <p><code>$apply</code> supports both aggregation and filter transformations, but I can't figure out how to combine them or if you're even allowed to do so.</p>
  
  <p>Thanks!</p>