"Merge columns" node
This node allows you to create a new column based on the values from other columns and to define the separator between the merged values.
- Click Add rule.
- Select one of the options:
- Include these - the default; it allows you to select the columns for merging.
- Include all except these - in this option, you can select the columns which you do NOT want to merge. All the other columns will be merged.
- Click Add column.
- From the dropdown list, select the columns to be merged.
- In the New column name field, enter the name of the column that will be added as a result of merging the selected columns.
- In the Separator field, enter the character which will function as a separator among values of the columns that are being merged.
- Optionally, you can delete the original columns by enabling the Remove original columns option on.
- You can check the preview of the file after changes in the Output data tab.
- To define what happens if rows contain errors, select one of the options available in the Error handling section.
- Confirm the settings by clicking Apply.
You can define what to do with failed values (for example, as a result of Jinja rendering or in other cases) in cells where data type modification failed. In the Error handling section, select one of the following options:
- Skip row if error occurred - It omits the row when an exception occurs.
- Skip if result is null or empty string - It omits rows with empty strings and
null(which may be the result of rendering Jinja)
- Stop further transformation - The transformation stops at the row with an error. The data before the line that caused the error is transformed (and imported if the transformation rule is used in the Data Transformation node).
- Insert null if error occurred - Wrong values are replaced with
null. If you use such a transformation for the import of profiles, the existing value of an attribute is cleared and replaced with the
- Insert empty string if error occurred - Wrong value is removed and the cell remains empty.
Example of use
You can use the Merge columns node in order to create an event salt. Event salt allows you to avoid duplicating an entry in the database if it is imported more than once. It is especially useful while importing events to Synerise.
customId,orderId,paymentInfo,finalUnitPriceAmount,productQuantity,sku,eventTimestamp,productName,productPriceAmount 123345,448362,cash,13.35,1,642,13.02.2022,shoe1,13.35 123345,448362,cash,40,1,453,13.02.2022,shoe2,40 345678,45678990,online,13.99,1,726,13.02.2022,shoe3,13.99
- As the first node, add Data Input.
- In the configuration of the node, upload a file on which you want to perform data transformation.
- As the next node, add a Merge Columns node.
- In the configuration of the node:
- merge the orderId and eventTimestamp columns together,
eventSaltas the name of the new column,
-as a separator.
- Leave the rest of the settings at default.
- As the last node, add Data Output.
Result: You receive a data file with a new eventSalt column.