pentahopentaho-data-integrationdata-pipeline

How to execute Step based on condition in Tranformation Level in Pentaho?


I know that I can use condition executing at Job Level like below

simpleEvaluation

But I want to use condition executing at Tranformation level. For example I have a simple Table Input step, which have a query like "select id from tableA". Now based on the value of each id, I want the result row to be forward to different road. For example if id > 5, I want to execute step A and so on, else execute step B and so on. Something like below

step

Pls note that in the picture above, currently every row is copied to 2 roads, not based on condition like I wanted. Is there anyway, any trick to achive condition executing on Tranform Level?


Solution

  • There a are a couple of ways to do this, based on the complexity of the filter you want to run. The most common are:

    But the better solution is to go for a switch/case step where you first categorize the data and then send the data to the right step:

    enter image description here