Using Kettle variables in your queries

As an alternative to the use of positional parameters, you can use Kettle variables. Instead of getting the parameters from an incoming step, you check the Replace variables in script? option and replace the question marks with names of variables. This is how you create a new version of the preceding Transformation but using variables:

  1. Create a Transformation and add a Table input step.
  1. Double-click on the Table input step and type the preceding query used, this time, replacing the last line with the following:
WHERE ca.name = '${CATEGORY}';
  1. Check the Replace variables in script? checkbox.
  2. Save the Transformation.
  3. With the Table input selected, click on the Preview button.
  4. Click on Configure.

Get Learning Pentaho Data Integration 8 CE - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.