Hitachi Vantara Pentaho Community Wiki
Child pages
  • .07 Variables
Skip to end of metadata
Go to start of metadata


Variables can be used throughout Pentaho Data Integration, including in transformation steps and job entries. You define variables by setting them with the Set Variable step in a transformation or by setting them in the file in the directory:

$HOME/.kettle (Unix/Linux/OSX)
C:\Documents and Settings\<username>\.kettle\ (Windows)

The way to use them is either by grabbing them using the Get Variable step or by specifying meta-data strings like:



  • %%VARIABLE%%

Both formats can be used and even mixed, the first is a UNIX derivative, the second is derived from Microsoft Windows. Dialogs that support variable usage throughout Pentaho Data Integration are visually indicated using a red dollar sign. You can use <CTRL>+ space hot key to select a variable to be inserted into the property value. Mouse over the variable icon to display the shortcut help.

The following topics are covered in this section:

Variable Scope

Internal Variables 

Variable scope

The scope of a variable is defined by the place in which it is defined.

Environment variables

The first usage (and only usage in previous Kettle versions) was to set an environment variable. Traditionally, this was accomplished by passing options to the Java Virtual Machine (JVM) with the -D option. It's also an easy way to specify the location of temporary files in a platform independent way, for example using variable ${}. This variable points to directory /tmp on Unix/Linux/OSX and to C:\Documents and Settings\<username\Local Settings\Temp on Windows machines. The only problem with using environment variables is that the usage is not dynamic and problems arise if you try to use them in a dynamic way. For example, if you run two or more transformations or jobs run at the same time on an application server (for example the Pentaho platform) you get conflicts. Changes to the environment variables are visible to all software running on the virtual machine.

Kettle variables

Because the scope of an environment variable is too broad, Kettle variables were introduced to provide a way to define variables that are local to the job in which the variable is set. The "Set Variable" step in a transformation allows you to specify in which job you want to set the variable's scope (i.e. parent job, grand-parent job or the root job).

Internal variables

The following variables are always defined:

Variable Name

Sample value


2007/05/22 18:01:39





These variables are defined in a transformation:

Variable Name

Sample value




Denormaliser - 2 series of key-value pairs.ktr


Denormaliser - 2 series of key-value pairs sample



These are the internal variables that are defined in a Job:

Variable Name

Sample value




Nested jobs.kjb


Nested job test case



These variables are defined in a transformation running on a slave server, executed in clustered mode:

Variable Name

Sample value


0..<cluster size-1> (0,1,2,3 or 4)


<cluster size> (5)

  • No labels