A variable field defines calculations and stores data temporarily. You can use variable fields in the Expression and Aggregator transformations.
You might use variables to perform the following tasks:
•Temporarily store data.
•Simplify complex expressions.
•Store values from prior rows.
•Compare values.
For example, you want to generate a mailing list by concatenating first and last names, and then merging the name with the address data. To do this, you might create a variable field, FullName, that concatenates the First and Last fields. Then, you create an expression field, NameAddress, to concatenate the FullName variable field with the Address field.
Mappings don't pass the results of a variable field to the data flow. To use data from a variable field in the data flow, create an expression field for the variable field output. In the preceding example, to pass the concatenated first and last name to the data flow, create a FullName_out expression field. And then, use the FullName variable field as the expression for the field.
You can't use variables to store values from a prior row in a mapping in advanced mode. To compare the current row with a previous row for stateful computation, use a window function in the expression.