Desktop User Guides > Reporter > Reference > Table specification syntax > Table and axis syntax
 
Table and axis syntax
This topic provides a detailed description of the syntax you use to specify tables in a script.
Table specification
A table specification consists of up to two axis specifications that define the side and top of the table in order as follows:
<table-spec> ::= [<axis-spec>] [* <axis-spec>]
These axis specifications (sometimes called the root-level axes) define the dimensions of the table. The axis specification on the left of the * defines the side axis, which in turn defines the rows of the table. The axis specification on the right of the * defines the top axis, which in turn defines the columns of the table. UNICOM Intelligence Reporter supports two table dimensions (side and top).
Axis specification
<axis-spec> ::= <axis>

<axis> ::= <axis> > <axis>
          | <axis> + <axis>
          | (<axis>)
          | id as AxisName | id ['label-text'] [as AxisName]
          | id [language_id:'label-text'] [as AxisName]
          | id {<element-list>} [MaxResponses = Value]
            [as AxisName]
          | axis (id) | axis ( {<element-list>}
            [MaxResponses = Value])
          | axis ( {<element-list>} [MaxResponses = Value])
            as AxisName
Parts
>
Nests the axis on the right of the > symbol within the axis on the left of the symbol. Generally the evaluation of the axis specification takes place from left to right. However, when an axis specification contains both > and + symbols, the > symbol takes precedence over the +. (This means that the > symbol is evaluated before the + symbol.) However, you can use parentheses to change the order of precedence.
+
Concatenates the two axes that are separated by the symbol.
( )
Indicates that the symbols within the parentheses are to be evaluated before the symbols outside the parentheses.
id
Creates the axis from the variable with name id. If an axis expression has been defined in the metadata (in the AxisExpression property), it is used to define the elements. What happens if an axis expression has not been defined in the metadata depends on the variable type. For a categorical variable, all of the elements within the variable are used. For numeric, text, date, and Boolean variables, you get an error.
id {<element-list>}
Creates the axis from the variable with name id and the elements are to be as specified in the element list. You can define new analysis elements in the element list. For more information, see Element list syntax.
axis ( id )
Creates the axis from a reusable axis with name id. A reusable axis is an axis that has been added to the Document.Axes collection.
id as AxisName
Creates the axis from the variable with name id, but that the axis will have the name AxisName. Use this if you want to add the same variable to an axis more than once.
axis ( {<element-list>} )
Creates the axis without reference to an existing variable. The base for the new variable contains all cases. If you do not specify an axis name, the axis is given the default name of _Custom. If you want to create more than one axis, you should give each one a unique name.
axis ( {<element-list>} ) as AxisName
Creates an axis without reference to an existing variable, and then saves it with a unique name.
[MaxResponses = Value]
Custom property for axis. When using axis expressions to edit a variable, the max response value could be changed. For example, an axis expression can change a single response variable to a multiple response by doing a net and keep operation. It is important to identify whether a variable, or an axis, is single or multiple while performing statistic tests, as they might require different formulas. You should set the appropriate value when the response type is different from the variable.
Do not take statistics elements into account.
Examples
age
Creates a table that has a side axis only, based on a single variable called age.
* age
Creates a table that has a top axis only, based on a single variable called age
age * gender
Creates a table that has a side axis based on the age variable and a top axis based on the gender variable.
interest * axis(MyBanner)
Creates a table that has a side axis based on a single variable called interest and a top axis based on the reusable axis called MyBanner.
age + gender * interest > before
Creates a table that has a side axis based on the variables called age and gender concatenated together and a top axis that is based on the variable called before nested inside the variable called interest.
interest * resident + axis(MyBanner)
Creates a table that has a side axis based on a single variable called interest and a top axis based on a variable called resident concatenated with a reusable axis called MyBanner.
interest{Dinosaurs, Fossils, Whales} * gender
Creates a table that has a side axis based on three specific elements of a variable called interest and a top axis based on a variable called gender. For more information, see Examples.
age 'Age Range' + gender
Creates a table that has a side axis only, based on a variable called age with the label Age Range concatenated with a variable called gender with the default label.
age ENU: 'Age Range' ESN: 'Edad'
Creates a table that has a side axis only, based on a variable called age with labels in United States English (ENU) and International Spanish (ESN). For languages where no label is specified, the default label from the metadata is used.
education as education1 > gender + education as education2 > biology
Creates a table that has a side axis only, based on a variable called education which is used twice in the axis, once with gender and once with biology nested within it.
axis({base(), male expression('gender={Male}')})
Creates a table that has a side axis only, with the default name _Custom. The axis is not based on an existing variable.
axis({base(), male expression('gender={Male}')}) as MyMaleAxis
Creates a table that has a side axis only, with the name MyMaleAxis. The axis is not based on an existing variable.
order{first, second} * order[..].column
Creates a table that demonstrates editing grid and loop iterations.
See also
Table specification syntax