Here are the high level steps to write a data function in TERR. 

  1. Write the script
  2. Create the input parameters
  3. Create the output parameters
  4. Run the script
  5. Map the input and output parameters to the data in the DXP file
  6. Find outputs and make visible in DXP as needed (for example, if the script created a table output, you will need to add a table visualization to see it). 

Things to Know

  1. The script will be universal. It can be used in any DXP file. The input/output parameters that are created with the script are also universal and can be thought of as shells or containers. When the script is run, data will be put into those containers and run against the TERR functions to generate the desired output specific to the data.
  2. Case and spacing are important, especially in the input and output parameters.
  3. Filtering and marking can be utilized in order to limit data.
  4. Data types defined in the input/output parameters can also be of critical importance.
  5. Data functions can be setup to run automatically anytime data, filtering or marking changes or you can choose to press a button to rerun the function.
  6. Make sure that the 'Type' drop down is set to 'R Script - TIBCO Enterprise Runtime for R' and not 'R Script - Open Source R'