Adding an attribute

You can add a new attribute to a project data set by specifying Groovy code to produce the attribute and by specifying a new attribute name and data type for the result. You then preview the change. If the result is what you expect, you can add it to the transformation script.

To add an attribute:

  1. In the Catalog, select a project.
  2. Select Transform.
  3. From the transform menu, select Editor.
  4. In the Transformation Editor, specify the Groovy code necessary add the attribute.
    This code can be as simple or as complicated as necessary for your use case.
    In this simple example, the toUpperCase function examines the asciiname attribute, converts its values to upper case, and creates a new attribute called Name:
    Shows the Transformation Editor with a very simple function example

  5. In New Attribute Name, specify the name of the attribute you want to add.
  6. From the Data Type list, choose the data type of the new attribute.
  7. If necessary, select Single Assign to make the new attribute multi-assign.
  8. Either click Preview to see the previewed results of running the transformation, or click Add to Script to save the transformation step to the script.

If you are done making changes to the project data set, you can commit the changes. See Running the transformation script against a project data set.