Combine Columns

Create a new column by combining other columns using a String Template. Use the String Template to manipulate text according to a specific pattern or structure. The $column_<column_name> notation can be used to specify any column in your dataset.

Parameters

  • Destination Column: The column name that will hold the manipulated text. Defaults to manipulated_text.
  • String Template: The template that guides the manipulation of text. Defaults to empty string.

Usage

To use the Combine Columns transformation, you will need to follow these steps:

  1. Specify the Destination Column parameter with the name of the column that will hold the manipulated text.
  2. Define the String Template parameter with the desired template that guides the manipulation of text. Use $field_source_column to reference the source column and $column_<column_name> to reference other columns in your dataset.
  3. Run the transformation by clicking the Save and Run Transforms button.

Example 1: Structuring Customer Feedback

Suppose you have a dataset of customer feedback with the customer's name, email, and feedback text. You want to structure the feedback text to include the customer's name and email in the "structured_text" column.

IDNameEmailFeedback
1John[email protected]Great product!
2Jane[email protected]I love the new design

Parameters (YAML):

transform:
  name: Combine Columns
  parameters:
    source_column: Feedback
    destination_column: structured_text
    string_template: "Customer Name: $column_Name, Email: $column_Email, Feedback: $field_source_column"

Expected Result Dataset:

IDNameEmailFeedbackStructured_Text
1John[email protected]Great product!Customer Name: John, Email: [email protected], Feedback: Great product!
2Jane[email protected]I love the new designCustomer Name: Jane, Email: [email protected], Feedback: I love the new design

Example 2: Structuring Order Details

Suppose you have a dataset of order details with the order ID, product name, and quantity. You want to structure the order details into a sentence in the "structured_text" column.

Order_IDProduct_NameQuantity
1001Laptop2
1002Headphones1

Parameters (YAML):

transform:
  name: Combine Columns
  parameters:
    source_column: Product_Name
    destination_column: structured_text
    string_template: "Order ID: $column_Order_ID, Product: $field_source_column, Quantity: $column_Quantity"

Expected Result Dataset:

Order_IDProduct_NameQuantityStructured_Text
1001Laptop2Order ID: 1001, Product: Laptop, Quantity: 2
1002Headphones1Order ID: 1002, Product: Headphones, Quantity: 1