title: Filter complex metric in grafana
body: <p>Is it possible to filter values from comlex metric in grafana?
  For example:</p>
  
  <p><code>SELECT sum(one) + sum(two) FROM "table" WHERE $timeFilter GROUP BY time($interval)</code></p>
  
  <p>I need to show only positive sum <code>sum(one) + sum(two) &gt; 0</code></p>
  
  <p>In sql I would use alias and <code>HAVING</code> clause like:</p>
  
  <p><code>SELECT sum(one) + sum(two) AS S FROM "table" WHERE $timeFilter GROUP BY time($interval) HAVING S &gt; 0</code></p>
  
  <p>However that does not work in grafana. 
  How can I achieve this result without creating a new sum column in back-end database?</p>
  
  <p><a href="https://i.stack.imgur.com/wmJqb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wmJqb.png" alt="version"></a></p>
  
  <p>[EDIT]: My grafana GUI looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/XfsXw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XfsXw.png" alt="enter image description here"></a>
  After clicking on "pen" button:</p>
  
  <p><a href="https://i.stack.imgur.com/qhwEq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qhwEq.png" alt="enter image description here"></a></p>