Analytic headers and tags

An analytic header is a series of tags enclosed in a comment block at the start of an analytic script. The analytic tags specify input parameters that a user populates in advance of scheduling or running an analytic script, and output parameters.

An analytic header is required for any analytic script that you intend to run in Robots.

For a visual overview of analytic script inputs and outputs, and associated analytic tags, see Script inputs and outputs – the big picture.

Note

Version 16 of Analytics, and all subsequent versions, are not intended for use with Analytics Exchange (AX). Diligent ended support for Analytics Exchange on January 1, 2023. Learn more or upgrade to Robots.

For information about using Analytics in conjunction with Analytics Exchange, see Analytics and ACLScript 15.1 Help.

Adding or modifying an analytic header

The easiest way to add or modify an analytic header is to use the Analytic Header Designer. The Designer provides automated error checking and embedded guidance to help ensure that the header you build is valid and works correctly. For more information, see Working with analytic headers.

You can also build an analytic header by manually entering the required analytic tags. Or you can use a combination of manual entry and the Designer.

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 script 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 Robots.

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 Robots.

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
  • PARAM
  • TABLE
  • FIELD

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 script runs in Robots, 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 tag

Designates a script as an analytic script that can run in Robots.

Input tags
FILE tag

Specifies a non-Analytics file, such as an Excel file, or a delimited file, that provides input for an analytic script running in Robots. The file must be located in the Input/Output tab in the same robot as the analytic script.

PARAM tag

Creates an input parameter for an analytic script, 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 script.

PASSWORD tag

Creates a password input parameter for an analytic script. 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 the analytic script so that user intervention is not required as the analytic script is running.

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.

FIELD tag

Defines a field that the user selects as input for an analytic script.

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.

Output tags
RESULT tag

Specifies that the results output by an analytic script are available in Robots to end users.

Output results, even if they exist, are not automatically made available.

DATA tag

Specifies that an Analytics table output by an analytic script is copied to a central data storage location in Robots.

Typically, you store Analytics tables so that they can be used as input tables for subsequent analytic scripts.