title: How do I define a custom metric in Apache Superset?
body: <p>I've been implementing superset at work, and I like it so far. However, I have such a table:</p>
  
  <pre><code>name,age,gender
  John,42,M
  Sally,38,F
  Patricia,27,F
  Steven,29,M
  Amanda,51,F
  </code></pre>
  
  <p>I want to define a new metric against each name, counting the number of people who are younger. My data is in a MySQLdatabase, and I suppose that for one person, I could write the query thus:</p>
  
  <pre><code>SELECT COUNT(DISTINCT name) from users where users.age &lt;= 42;
  </code></pre>
  
  <p>for, say, John's row. So, how do I do this continuously for the entire table?</p>