title: Checking for null and 0 in multiple columns
body: <p>I have a table in our Oracle DW with the following columns:</p>
  
  <pre><code>Turnover_In
  Turnover_Out
  Revenue_In
  Revenue_Out
  </code></pre>
  
  <p>For both <code>Turnover_In</code> and <code>Turnover_Out</code>, I need to check to see if the value for either <code>Turnover_In</code> or <code>Turnover_Out</code> on that row is null or 0, and if that's the case, I need to output the value from <code>Revenue_In</code> or <code>Revenue_Out</code> into the corresponding column (<code>Turnover_In</code> and <code>Turnover_Out</code>).</p>
  
  <p>Example of how source data looks:</p>
  
  <pre><code>Revenue In      Revenue out     Turnover in     Turnover out
                  0               1000            1500
  </code></pre>
  
  <p>It should turn into the following:</p>
  
  <pre><code>Revenue In      Revenue out     Turnover in     Turnover out
  1000            1500            1000            1500
  </code></pre>
  
  <p>I've tried the following now:</p>
  
  <pre><code>case
      when rev.revenue_in in (null,'0')
      or rev.revenue_out in (null,'0')
      then tur.turnover_in
  end "Revenue in",
  case
      when rev.revenue_in in (null,'0')
      or rev.revenue_out in (null,'0')
      then tur.turnover_out
  end "Revenue out"
  </code></pre>
  
  <p>and</p>
  
  <pre><code>case
      when nvl(rev.revenue_in, '0') = '0'
      or nvl(rev.revenue_out, '0') = '0'
      then tur.turnover_in
  end "Revenue in",
  case
      when nvl(rev.revenue_in, '0') = '0'
      or nvl(rev.revenue_out, '0') = '0'
      then tur.turnover_out
  end "Revenue out"
  </code></pre>
  
  <p>...But nothing seems to work. Any ideas?</p>