Mapper Variables

Mapper variables can only be set and referenced in the mapper. Mapper components map mapper variables for each row, while other variable types are only mapped for the mapper's first execution. So, you could use mapper variables to count the number of rows as "var = var + 1". See the guides eblow to define and use mapper variables.

Note

You also define stream variables in the mapper.

Defining Mapper Variables

Select a mapper on the canvas. In the Variables tab in the inspector, next to the Basic tab, specify the Name, Type, and Default properties.

You can also create a stream variable with a mapper variable. To set the mapper variable as a stream variable in the output stream, set the SV property in the Variables tab in the inspector to true.

Mapping Variables to the Mapper's Input

Normally, when a record in the mapper's input contains multiple rows, the flow variables and external variables are only mapped to the first row of the record. But, mapper variables are mapped for every row; so, for example, you can use mapper variables as a counter by incrementing the variable as each row is processed.