The Copy transformation in Nexadata Pipelines allows you to duplicate an existing column within your dataset. This is useful when you want to preserve the original column while applying changes to its duplicate or when you need the same column for different operations, such as when working with conditional Mapping Groups. You can configure this transformation using either Natural Language Mode or Advanced Mode.
Inputs for the Copy Transformation
Name of the Transformation: In Natural Language Mode, the transformation name is automatically generated, but it can be updated later using Advanced Mode. For example, you might rename it to something more descriptive, such as "Duplicate Department Name" or "Sales Amount Copy.".
Select Column to Copy: Choose the column in your dataset that you want to duplicate.
New Column Name: Define the name for the newly duplicated column to help distinguish it from the original. For instance, if you're copying a "Department_Name" column, the new name might be "Department_Name_Backup".
Position of the New Column: Specify where the duplicated column should be placed in the dataset:
First: Inserts the new column at the beginning.
Last: Adds the new column at the end.
Before: Places the new column before another specified column.
After: Places the new column after another specified column.
Reference Column: If you choose to position the column Before or After another column, you will need to select a reference column that will serve as the insertion point for the new column.
Using Natural Language Mode
In Natural Language Mode, you can create the Copy transformation using a single instruction, and Nexadata will automatically generate the transformation for you. The transformation will also be automatically named, but you can update it later in Advanced Mode.
Example Instructions in Natural Language Mode
Copy the Department_Name column to Department_Name_Backup.
Duplicate the Sales_Order_Number column to a new column named Sales_Order_Number_Backup.
Copy the Sales_Amount column to Sales_Amount_Backup.
Copy the Department_Code column to Dept_Code_Backup.
Copy the Total_Sales column to Total_Sales_Backup.
Note: If the output isn’t as expected or you want to adjust settings, you can always switch to Advanced Mode to refine the transformation.
Using Advanced Mode
In Advanced Mode, you have full control over how the Copy transformation is set up. You can modify the transformation name, define the new column name, and precisely specify its position in the dataset.
Steps in Advanced Mode
Name of the Transformation: Provide or update a custom name for the transformation, such as "Copy of Sales Amount" or "Duplicate Department Name".
Select Column to Copy: Choose the column you want to duplicate from the list of available columns.
New Column Name: Define a unique name for the new column that will store the duplicated values (e.g., "Sales_Amount_Backup" or "Department_Name_Copy").
Position of the New Column: Select where to place the new column:
First: Add the new column at the start of the dataset.
Last: Add the column at the end of the dataset.
Before/After: If choosing Before or After, you’ll also need to select a reference column where the new column should be inserted relative to existing columns.
Reference Column: Provide a reference column if selecting Before or After.
Example in Advanced Mode
Name of the Transformation: Duplicate Sales Amount
New Column Name: Sales_Amount_Backup
Position of New Column: After
Reference Column: Sales_Amount
Advanced Mode allows you to precisely control column placement and make adjustments as needed.
Example Use Case
Imagine you have a dataset with a "Price" column, and you need to apply different calculations to the original price and a discounted price. Instead of modifying the original "Price" column directly, you can use the Copy transformation to create a duplicate.
Column to copy: Price
New column name: Discounted_Price
Position: After the Price column
Now, you have a new column, "Discounted_Price", where you can apply specific transformations without altering the original "Price" data.
Summary
The Copy transformation in Nexadata Pipelines provides an easy way to duplicate existing columns, allowing you to apply different transformations or modifications to the original and the duplicate columns. Use Natural Language Mode for quick setup or Advanced Mode for full control over the transformation details.