TABLE tag

Defines an Analytics table that the user selects as input for an analytic script.

The TABLE tag can be followed by zero or more FIELD tags entered on sequential lines.

Note

The TABLE and FIELD tags require that an Analytics table pre-exists in the storage location in order to be available to be selected. For more information, see DATA tag.

Use the TABLE and FIELD tags if you want to create variables that allow users to specify different tables or fields for use with the same analytic script. If the script is designed to always work with the same table and set of fields, with names that do not change, you can hardcode the table and field names into the script and avoid use of the TABLE and FIELD tags.

Syntax

//TABLE variable_name label
  <description>

Parameters

Name Description
variable_name

The name of the variable that stores the input table name selected by the user. Use variable_name in the analytic script to reference the table.

Do not include any spaces in variable_name.

Do not use any of the following characters in variable_name. They are not supported:

` ~ ! @ # $ % ^ & * ( ) - + = { } [ ] | \ : ; ' " < > , . / ?
label

In Robots, the interface label that users see when prompted to select the table. For example, Payments Table

description

optional

In Robots, descriptive text associated with the input field that users see. The description can be multiline, but it cannot skip lines.

The description can help the user select the correct table. For example, Select a table that lists payments and includes a check number column.

The description must be entered on the line below the associated TABLE tag.

Examples

Basic examples

TABLE tag with description to help user select the correct input table:

//TABLE v_table_payments Payments Table
  Select a table that lists payments and includes a check number column.

Advanced examples

Using a table defined in a TABLE tag in the script

The following script runs an AGE command on a table that is selected by the user from the data tables in the project:

COMMENT
//ANALYTIC example_script
//TABLE v_table_payments Payments Table
  Select a table that lists payments and includes a check number column.
END

OPEN %v_table_payments%
AGE ON payment_date CUTOFF 20141231 INTERVAL 0,30,60,90,120,10000 SUBTOTAL Payment_Amount TO r_output
CLOSE %v_table_payments%