Using the Data Transformation Widget

The Data Transformation widget allows you to write and import complex expression and transformation in Python and Java.

To use this widget effectively, you must have a working knowledge of scripting and Java or Python.
  1. Create a pipeline, as shown in Adding DTP Pipelines.
  2. Add a Data Transformation widget to the pipeline by right-clicking the Canvas to display the list of widgets and selecting Data TransformationData Transformation widget.
    The Data Transformation widget can be stand-alone or associated with another widget, such as Business Filter, Evaluation, or Aggregator.
  3. Click Options Options iconthen click EditEdit icon. The Data Transformation pane displays.
  4. In Basic Configuration, provide the following details:
    1. Enter a Name for this Data Transformation.
    2. Select a Runtime Parameter from the drop-down list. To add a new Runtime Parameter, see Creating Runtime Parameters.
    3. For Data Transformations associated with another widget, map the columns in Column Definition using Add Columns. The View Input Table Columns shows which columns were mapped in the connected Data Forge.
  5. The Define Transformation tab displays the script options.
    • Standard
      1. Select the Type from the drop-down list.
      2. Select the Transform from the drop-down list.
      3. Select Interpreters from the drop-down list. Python allows you call a custom python script.
        1. In the Script section, provide a description.
        2. Enter or paste the python script you want to execute.

          Note:

          If this is a script you intend to reuse, you can create a template by clicking Templates, then Add. Enter the pertinent details about the script, enter or paste the script into the box, and click Save.

          Existing templates can be modified by clicking Edit. Editing a template updates the script in every pipeline which uses this template.

          To use an existing template, select Use Template and select the desired template from the Script drop-down list.

        3. Click Save.
    • Selecting Custom allows you to create a notebook.
      Notebooks allow you to add and run paragraphs, invalidate session, edit, add, export the notebook, and so on. To understand the icons which display in the Notebook, see Common Screen Elements.
      1. Click Add Python Paragraph to add a paragraph in the notebook and fetch the runtime parameters. This is available for all the interpreters.
      2. Add paragraphs to the Notebook as desired.
      3. Click Play to run the script and display the label.
  6. You can import an existing notebook by selecting Import Notebook.
    • Click Import Archive File to select the .dsnb file from the file selector dialog and select a file. Click Open.
    • OR
    • Drag and drop the file into the Import Archive File field.