title: Comparing integers to return Boolean in BigQuery
body: <p>Running a big query Select Case When query from the command line. When looking in a string, for a numeric value and casting that to an integer - this needs to be compared to a value and return a boolean so that the case statement worked.</p>
  
  <pre><code>bq query SELECT case when integer(right(strWithNumb,8))&gt; 10000000 then right(strWithNumb,8) else "no" end FROM [Project:bucket.mytable]
  </code></pre>
  
  <p>returned </p>
  
  <blockquote>
    <p>"CASE expects the WHEN expression to be boolean."</p>
  </blockquote>
  
  <p>I tried:</p>
  
  <pre><code>boolean(integer(right(strWithNumb,8))&gt; 10000000) 
  </code></pre>
  
  <p>but got  </p>
  
  <blockquote>
    <p>" Was expecting: "WHEN" ..."</p>
  </blockquote>