Analytic headers and tags
An analytic header is a series of tags enclosed in a comment block at the start of an Analytics script. The analytic tags specify input parameters that a user populates in advance of scheduling or running an analytic, and output parameters.
An analytic header is required for any analytic script that you intend to run in Robots, on AX Server, or in the Analysis App window.
Basic analytic header requirements
Analytic headers must be defined in a comment block that starts on the first line of the script. Tags can be in any order in the analytic header, except for:
- the ANALYTIC tag, which must be first
- FIELD tags, which must immediately follow their associated TABLE tag
Example
This analytic header identifies a table and field to use in the script, as well as a start date parameter:
COMMENT //ANALYTIC Identify missing checks This analytic identifies missing check numbers //TABLE v_table_payments Payments Table Select a table that lists payments and includes a check number column //FIELD v_check_num CN Check Number Select the field that contains the check numbers //PARAM v_start_date D OPTIONAL Start Date (Optional) Enter the start date for the analysis END
Tag format
Each tag in the header uses the following format:
//tag_name attributes optional_descriptive_text
The // tag indicator must be the first non-whitespace character on the script line. The tag name must immediately follow the tag indicator, without any space or characters in between.
The optional descriptive text must be entered on the next line after the tag. The text can be multiline, but it cannot skip lines. Line breaks are not preserved when the descriptive text is displayed in client applications.
Tag conventions
Component | Convention |
---|---|
Tag names |
Tag names are not case-sensitive. Unlike Analytics command and function names, tag names cannot be abbreviated. |
Tag attributes | When specifying attribute values for a tag, you may include spaces and optionally enclose the value in quotation marks. |
Tag descriptions | Descriptions are optional. If a description is specified it can be multi-line, but line breaks are not preserved in client applications. |
Specifying test input values in Analytics
You can use a special assignment operator ( := ) to specify test input values for any analytic tag that requires definition:
- FILE
- TABLE
- FIELD
- PARAM
Use this syntax to test analytic scripts in Analytics:
//TABLE v_AnalysisTable "Table to classify" := "Trans_May"
When the script runs in Analytics, the parameter takes the value specified in the assignment. When the analytic runs in a client application, the test value is ignored and the user-defined input parameters are used.
You must leave a space between the assignment operator and the tag syntax preceding it. Assignment values must use the correct qualifier for the data type as required throughout Analytics. For more information, see Data types.
Full list of available analytic tags
Tag | Description |
---|---|
ANALYTIC |
Designates an Analytics script as an analytic that can run in Robots, on AX Server, or in the Analysis App window. |
Input tags | |
FILE |
Specifies a non-Analytics file, such as an Excel file, or a delimited file, that provides input for an analytic running in Robots, or on AX Server.
|
TABLE |
Defines an Analytics table that the user selects as input for an analytic. The TABLE tag can be followed by zero or more FIELD tags entered on sequential lines. |
FIELD |
Defines a field that the user selects as input for the analytic. The field must be part of the table defined in the preceding TABLE tag. The first FIELD tag must immediately follow a TABLE tag, and can be followed by additional FIELD tags entered on sequential lines. |
PARAM |
Creates an input parameter for an analytic, and defines the requirements for the input value. An input parameter is a placeholder that allows the user to specify the actual value when scheduling or running an analytic. |
PASSWORD |
Creates a password input parameter for an analytic. The parameter provides encrypted storage of a password for subsequent use in an ACLScript command. The user is prompted to specify the required password value when they schedule or start an analytic so that user intervention is not required as the analytic is running. |
Output tags | |
DATA |
Specifies that an Analytics table output by an analytic is copied to a data subfolder (a storage location) in the deployment environment. Typically, you store Analytics tables so that they can be used as input tables for subsequent analytics. |
RESULT |
Specifies the analytic output results that you want to make available to end users in client applications. Output results, even if they exist, are not automatically made available. |
PUBLISH |
Specifies a file that contains metadata defining which Analytics tables to publish to AX Exception when an analytic is finished processing. |