title: Pentaho Set Variable Exception
body: <p>I've got this doubt about Pentaho set variable step. This is my ktr configuration:</p>
  
  <p><a href="https://i.stack.imgur.com/3LS7v.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3LS7v.png" alt="enter image description here"></a></p>
  
  <p>I'm checking if there are bad records to report. I'm using a sequence to keep the count. After that I'm preparing a document with this errors to be sent just it the counter is greater than zero.</p>
  
  <p>For the kjb father I am using this configutation to check the quantity of errors:</p>
  
  <p><a href="https://i.stack.imgur.com/IRnNi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IRnNi.png" alt="enter image description here"></a></p>
  
  <p>However when I execute the process, for the ktr I'm getting this message:</p>
  
  <blockquote>
    <p>Set Variables 2.0 - Set variable NumberOfErrors to value <a href="https://i.stack.imgur.com/3LS7v.png" rel="nofollow noreferrer">1</a>
    org.pentaho.di.core.exception.KettleStepException: <strong>Only 1 input row
    was expected to set the variables and at least 2 were received.</strong>
            at org.pentaho.di.trans.steps.setvariable.SetVariable.processRow(SetVariable.java:96)
            at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
            at java.lang.Thread.run(Thread.java:748) 2019/02/04 18:56:36 - Set Variables 2.0 - ERROR (version 8.1.0.0-365, build 8.1.0.0-365 from
    2018-04-30 09.42.24 by buildguy) : Unexpected error 2019/02/04
    18:56:36 - Set Variables 2.0 - ERROR (version 8.1.0.0-365, build
    8.1.0.0-365 from 2018-04-30 09.42.24 by buildguy) : org.pentaho.di.core.exception.KettleStepException: 2019/02/04 18:56:36
    - Set Variables 2.0 - <strong>Only 1 input row was expected to set the variables and at least 2 were received</strong>. 2019/02/04 18:56:36 - Set
    Variables 2.0 - 2019/02/04 18:56:36 - Set Variables 2.0 -       at
    org.pentaho.di.trans.steps.setvariable.SetVariable.processRow(SetVariable.java:96)
    2019/02/04 18:56:36 - Set Variables 2.0 -       at
    org.pentaho.di.trans.step.RunThread.run(RunThread.java:62) 2019/02/04
    18:56:36 - Set Variables 2.0 -       at
    java.lang.Thread.run(Thread.java:748)</p>
  </blockquote>
  
  <p>And the variable with the errors is equal to zero even when I know that there are some bad records.</p>
  
  <p><a href="https://i.stack.imgur.com/2XieS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2XieS.png" alt="enter image description here"></a></p>
  
  <p>How can I configure the set variable step in the proper way in order to set the value of this variable?</p>
  
  <p>Regards.</p>