Function Transformations
Last updated
Last updated
© Copyright 2023, Astera Software
Function Transformations apply built-in expressions on the incoming data to transform it according to the expression’s logic.
There are several built-in functions in Astera that help in string manipulation, data conversion, time manipulation, calculations, comparisons, and data parsing.
Name and Address Parser is a collection of built-in functions in the Function Transformations section. The functions in this category process the input stream of Name and Address data and give elements such as Suffix, First Name, Last Name, City, Country, Street, Zip code, etc. as parsed outputs.
In this section, we will learn how to parse name and address strings using built-in function transformations in Astera.
In this case, we have sample data coming in from a Fixed-Length File Source.
The source file contains the Name, Contact, and Address details of customers.
Preview data by right-clicking on the source object’s header > Preview Output.
A Data Preview window opens up displaying the information in each field.
Now, we want to parse the Name field into Suffix, First Name, Last Name, etc.
For this purpose, we will use the Name Parser Function Transformation.
To get a Name Parser Function Transformation, go to Toolbox > Function Transformations > Name and Address > ParseName(String name) - ParsedName.
Drag and drop the Parse Name object onto the designer.
You can see that the dragged transformation object has two sub-nodes - Input and Output.
Expand the Input node and map the Name field from the Sample Data object to the name field inside the Parse Name object.
Right-click on the Parse Name object’s header and select Preview Output from the context menu.
A Data Preview window will open, displaying parsed data for the Name field.
To store this output, write it to a destination file.
Right-click on the Output sub-node inside the Parse Name object and go to Write to > Excel Workbook Destination.
An Excel Workbook Destination object is added to the dataflow designer with auto-mapped fields.
Configure settings for the Excel Workbook Destination object.
Click on the Start Dataflow button placed in the toolbar at the top to create this destination file.
Now, we want to parse the Address field into Country, City, Street, Zip Code, etc.
For this purpose, we will use Address Parser Function Transformation.
To get an Address Parser Function Transformation, go to Toolbox > Function Transformations > Name and Address > ParseAddressUS(String fullAddress, String outputCase) - ParsedAddress.
Drag and drop the Parse Address US object onto the designer.
You can see that the dragged transformation object has two sub-nodes - Input and Output.
Expand the Input node and map the Address field from the Sample Data object to the fullAddress field inside the Parse Address US object.
Right-click on the Parse Address US object’s header and select Preview Output from the context menu.
A Data Preview window will open, displaying parsed data for the Address field.
To store this output, write the parsed data to a destination file.
Right-click on the Output sub-node inside the Parse Address US object, and go to Write to > Excel Workbook Destination.
An Excel Workbook Destination object is added to the dataflow designer with auto-mapped fields.
Configure settings for the Excel Workbook Destination object.
Click on the Start Dataflow button placed in the toolbar at the top to create this destination file.