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:

    If you have a single boolean choice (like in your example, larger or smaller then a certain limit value) it's most common to use filter rows (centralized).

    enter image description here

    If you have a multiple categorie splitting of actions, it can be done by a decentralized filter rows (just send the data to diffrent filter rows step which each check if it is complying to the categories, while having the distribution on copy).

    enter image description here

    But the better sollution 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