Search code examples
pentahotransformationkettlepdi

Count Filtered Rows in Kettle Transformation


Probably, there is an easy solution -- I just can't find it:

In a kettle transformation rows are read from some DB table, passed on through some filtering steps and finally written to some other DB table. The filtering steps eliminate non-matching rows.

In this process, I want to count both "good" and "bad" rows and pass those two results to a calling job to send out an email like

<n> rows in total (<g> good / <b> bad)

PS: Using global variables and increasing them in JavaScript-Steps does not work ... (multi-threading?)


Solution

  • You can calculate the number of rows in each branch using GroupBy step and "Number of rows (without field argument)" aggregate, then you can set variables as needed using these calculated values.