title: Cognos equivalent of Excel Sumif() function without a static variable
body: <p>Here is the following example that I found that does work as a sumif function. </p>
  
  <p>total(<br>
      case<br>
      when [free of charge flag] = 'FALSE'<br>
      then [Total Margin]<br>
      else null<br>
      end<br>
  for [Item Code])</p>
  
  <p>My question is how to replace the 'FALSE' portion and have the expression reflect the [free of charge flag] for that specific row. So as the report builds the total in each row may switch from a total of that item code and the free of charge flag being false to true depending on what is in the specific row.</p>
  
  <p>This fails to run and I believe this may not be possible.</p>