title: InfluxDB get maximum value of moving average
body: <p>To get the moving average of a series in InfluxDB you can do the following:</p>
  
  <pre><code>SELECT MOVING_AVERAGE(&lt;field_key&gt;,&lt;window&gt;) FROM &lt;measurement_name&gt;
  </code></pre>
  
  <p>(from the <a href="https://docs.influxdata.com/influxdb/v1.2/query_language/functions/#moving-average" rel="nofollow noreferrer">influxdb documentation</a>)</p>
  
  <p>That will return a dataset with the moving average on each point.
  However I would like to get only the maximum of that dataset. </p>
  
  <p>Of course I could do that in my script but then I would have to download all the data of the moving average first, and then process it locally. (My InfluxDB server is not on the local network)</p>
  
  <p>Is there a way to get <em>only</em> the maximum of the moving average without getting the complete moving average data?</p>