Transformer
The Transformer stage modifies field values and formatting. You can perform more than one transform on a field as long as the input and output field names are identical.
General Transforms
- Construct Field
- Uses values from existing fields and/or constant values to either replace field values or create a new field. For example, say you have a field named City and you want to add the phrase "City of" to the values in the City field. You would create a template like this:
City of ${City}
In the To field field, you would select the City field. This has the effect of replacing the existing values in the City field with a value constructed using the template. For example, if the value in the City field is Chicago, the new value would be City of Chicago.
Some characters must be preceded by a backslash ("\") in order to produce a valid template. For example, the single quote character must be preceded by a backslash like this:
\'
. See groovy-lang.org/syntax.html for a list of characters that must be escaped with a backslash. - Copy
- Copies the value from one field to another.
- Custom
- Allows you to define your own transform using the Groovy language. For more information,
see Creating a Custom Transform.
For users of the Location Intelligence Module, custom transforms can access spatial datasets. See the Stages section in the Spectrum Spatial Guide on support.pb.com.
- Rename
- Changes the name of a field. You can select from a list of field names already in the dataflow or you can type the name you want.
- Status
- Changes the Status field to a value of either Success or Fail. When set to Fail, an optional Description and Code may also be set.
Formatting Transforms
- Case
- Changes casing upper or lower case.
- Mask
- Applies or removes characters from a field. For more information, see Using a Mask Transform.
- Pad
- Adds characters to the left or right of the field value.
String Transforms
- Minimize Whitespace
- Removes whitespace at the beginning and end of the field. It also replaces any sequence of whitespaces (such as multiple, consecutive spaces) to a single whitespace character.
- Remove Substring
- Removes all occurrences of a string from a field. For example, you could remove "CA" from the StateProvince field.
- Substring
- Copies a contiguous sequence of characters from one field to another.
- Trim
- Removes specified characters from the left, right, or both sides of a field. Note that this transform is case-sensitive.
- Truncate
- Removes a specified number of characters from the left, right, or both sides of a field.