Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
switch(parseInt(valuename))
{
case 1:
case 2:
case 3:
 strvalueswitch = "one, two, three";
 break;
case 4:
 strvalueswitch = "four";
 break;
default:
 strvalueswitch = "five";
}

Filter rows

If you want to filter rows, i.e. remove rows from the output, you can set the trans_Status variable:

Code Block

trans_Status = CONTINUE_TRANSFORMATION
if (/* add your condition here */) trans_Status = SKIP_TRANSFORMATION

All rows matching the condition are removed from the output.

Blog "Squeezing the most out of the JavaScript Step in Pentaho Kettle":
http://type-exit.org/adventures-with-open-source-bi/2010/06/squeezing-the-most-out-of-the-javascript-step-in-pentaho-kettle/