title: Ranking values in a column
body: <p>I have a table that has multiple budget records for a single ID each with a status, I need to be able to sum the budget and pull the status based on some predefined hierarchy. So if any of the records say "Forecast" for example, I need the sum to be marked as forecast.</p>
  
  <pre><code>ID      Status       Budget
  1       Forecast     50
  1       Forecast     100
  1       Final        50
  2       Final        75
  2       Final        75
  </code></pre>
  
  <p>I would need the above table to return:</p>
  
  <pre><code>1 forecast 200
  2 final 150
  </code></pre>
  
  <p>Ideally I would be able to add 3 or 4 levels into this hierarchy, but only the two are completely necessary.</p>