title: Tableau grouping by calculated field
body: <p>I have a dataset within SQL that pulls sales by client on a product basis.  Some clients can have multiple products, while others can have just one.  I'm trying create a histogram of clients by their aggregated spend amount, but the classification I'm using is a measure, and I can't figure out how to make that a dimension.</p>
  
  <p>Using the table below, the Sale Amount for AAA would be $7500, BBB would be $4000 and CCC is $14,000.  I would use the following :<code>if SaleAmt &gt; 10000 then "10K+", elseif SaleAmt &gt; 5000 then "5K-10K, else "sub-5K" end</code> and then combine it with  <code>countd(Client)</code> to get the histogram, ideally it would show 1:2:1 for 10K+, 5K-10K, sub-5K.</p>
  
  <p>But when I try this within Tableau, it treats the if statement result as a measure and not a dimension, not something I can classify around.  Is there a better way to do this within Tableau?</p>
  
  <pre><code>Client    Product    SaleAmt
  AAA       1          3500
  AAA       2          4000
  BBB       1          4000
  CCC       4          7000
  CCC       7          7000 
  DDD       5          8000
  </code></pre>