title: Cognos query calculation - how to obtain a null/blank value?
body: <p>I have a query calculation that should throw me either a value (if conditions are met) or a blank/null value.</p>
  
  <p>The code is in the following form:</p>
  
  <p><code>if([attribute] &gt; 3) 
  then ('value') 
  else ('')</code></p>
  
  <p>At the moment the only way I could find to obtain the result is the use of '' (i.e. an empty character string), but this a value as well, so when I subsequently count the number of distinct values in another query I struggle to get the correct number (the empty string should be removed from the count, if found).</p>
  
  <p>I can get the result with the following code:</p>
  
  <p><code>if (attribute='') in ([first_query].[attribute])) 
  then (count(distinct(attribute)-1) 
  else (count(distinct(attribute))</code></p>
  
  <p>How to avoid the double calculation in all later queries involving the count of <code>attribute</code>?</p>