Annotation macros
Annotation macros can be used in your annotation specifications to insert information about the tables, filters, weighting, data set, population date and time, etc. You can use more than one macro in a single annotation specification and you can combine the macros with plain text.
{CDSCName}
The name of the CDSC, such as "mrXmlDsc".
Switches: \n \p
Corresponding table object model property: DataSet.CdscName
{CellContents}
The table's cell contents. If there is more than one, they are separated by <BR/> tags.
Switches: \n \p
Corresponding table object model property: Properties of each CellItem object in Table.CellItems
{CellItemSymbols}
Information about symbols displayed in the table cells.
Switches: \n \p
{Context}
The user context being used, such as “Analysis”.
Switches: \n \p
Corresponding table object model property: Document.Context
{CurrentTime}
The current date and time. By default this is in the long date format for the current language's default regional setting (locale). Use the \s switch to use the short date format.
Switches: \s \n \p
{DBLocation}
The name and location of the case data, such as:
[INSTALL_FOLDER]\IBM\SPSS\DataCollection\7\DDL\Data\XML\Museum.xml
Switches: \n \p
Corresponding table object model property: DataSet.DBLocation
{DocumentDescription}
The description of the table document, such as “Analysis of age and education against interest in the various galleries”.
Switches: \n \p
Corresponding table object model property: Document.Description
{Filters}
The descriptions of all of the filters, concatenated with the word “AND” in bold. If the filters are at different levels, details of the levels are shown. If the filter doesn't have a description, its expression is shown.
You can use one or more of the optional switches described in the table below.
Switches: \d+ \d- \e \t \g \i+ \i- \n \p
Corresponding table object model property: Description or Expression properties of each Filter object in Table.Filters.
{LabelType}
The label type being used, such as “Label”.
Switches: \n \p
Corresponding table object model property: Document.LabelType
{Language}
The metadata language being used, such as “English (United States)”.
Switches: \n \p
Corresponding table object model property: Document.Language
{Level}
The table's population level. For example, “Person[..].Trip". The top level is always shown as “Top” when using English. Use the \l switch to use the level's description instead of the name. For example, “Overseas trips taken by each person”.
Switches: \l \n \p \s
Corresponding table object model property: Table.Level
{MDSCName}
The name of the MDSC being used, such as “mrQvDsc”.
Switches: \n \p
Corresponding table object model property: DataSet.MdscName
{MetaDataLocation}
The name and location of the metadata, such as "[INSTALL_FOLDER]\IBM\SPSS\DataCollection\7\DDL\ Data\XML\Museum.mdd".
Switches: \n \p
Corresponding table object model property: DataSet.MetaDataLocation
{MetadataVersion}
The version(s) of the metadata being used in the form of aversion expression, such as "{..}". See also
Version expressions.
Switches: \n \p
Corresponding table object model property: DataSet.Version
{PopulateWarnings}
Displays warnings generated during the generation of statistical tests, for example, if the type of test requested is not valid for the type of table.
Switches: \n \p
{ProjectDescription}
The description of the data set, such as “Museum Survey”.
Switches: \n \p
Corresponding table object model property: DataSet.Description
{ProjectName}
When you are using a CDSC that supports multiple projects (such as RDB DSC), you can show the name of the project being used, such as “short_drinks”.
Switches: \n \p
Corresponding table object model property: DataSet.Project
{Rules}
The rules defined for the table. Each rule is separated by a <BR/> tag. For example,
“Hide cells where Count equals 0”.
Switches: \n \p
Corresponding table object model property: Table.Rules
{RunTime}
The population date and time for the current language's default regional setting (locale). By default this is in the long date format. Use the \s switch to use the short date format.
Switches: \s \n \p
Corresponding table object model property: Table.DatePopulated
{SideSpec}
The specification of the side axis. For example, “age”. Use the \l switch if you want to replace variable names with their descriptions. For example, “Age of respondent”.
Switches: \l \n \p \s
Corresponding table object model property: Table.Axes["Side"].Specification
{SortColumn}
The column by which the table is sorted. For example, “Gender{Male}”.
Switches: \n \p \s
Corresponding table object model property: Table.SortColumn
{SortRow}
The row by which the table is sorted. For example, “Age{Base}”.
Switches: \n \p \s
Corresponding table object model property: Table.SortRow
{Statistics}
Notes relating to the statistical tests, separated by a <BR/> tag. This annotation should always be used in tables that include a statistical text. For example, “Column Proportions: Columns Tested (5%) A/B”. If a statistic is invalid, the annotation indicates this. The \i- switch suppresses annotations for invalid statistics.
Switches: \n \p \i-
Corresponding table object model property: Statistic.Annotation
{TableBase}
The table's base value. For example, "602".
Switches: \n \p
Corresponding table object model property: Table.Base
{TableDescription}
The table description, such as "Age by gender for all respondents".
Switches: \n \p
Corresponding table object model property: Table.Description
{TableName}
The name of the table, such as "MyTable".
Switches: \n \p
Corresponding table object model property: Table.Name
{TableNumber}
The index of the table in the table document, such as "5".
Switches: \n \p \g
{TableProperty: PropertyName }
The content of a custom table property. Add the name of the custom property after the colon. You must first specify the custom property in your script and enter a value for it.
Switches: \n \p
{TableSpec}
The table specification, such as "age * gender". Use the \l switch if you want to replace variable names with their descriptions. For example, "Age of respondent * Gender of respondent".
Switches: \l \n \p \s
Corresponding table object model property: Table.Specification
{TableStatus}
The overall status set for the table. The status can be any user-defined string. Standard status values for reporting are “ok”, “warning”, and “error”.
Switches: \n \p
Corresponding table object model property: Table.Status
{TopSpec}
The specification of the top axis. For example, "gender". Use the \l switch if you want to replace variable names with their descriptions. For example, "Gender of respondent".
Switches: \l \n \p \s
Corresponding table object model property: Table.Axes["Top"].Specification
{TotalNumberOfTables}
The total number of tables in the table document, such as "10".
Switches: \n \p
Corresponding table object model property: Document.Tables.Count
{WeightVariable}
The name of the weighting variable. For example, "agebalance". Use the \l switch if you want to display the weighting variable's description. For example, "Weighting factor for age balance".
Switches: \l \n \p \s
Corresponding table object model property: Table.Weight
Optional switches
\d+
Include only filters that have the IsDimensionsFilter property set to True.
\d-
Include only filters that have the IsDimensionsFilter property set to False.
\e
Always use the filter expression instead of the description.
\g
(Used with Filters macro) Include only global filters (that is, ignore any filters applied directly to the table).
(Used with TableNumber macro) add hierarchical numbering if the tables are stored in folders; for example, 2.1, 2.1.1, etc.
\i+
Include only filters that have the IsInterviewFilter property set to True.
\i-
(Used with Filters macro) Include only filters that have the IsInterviewFilter property set to False.
(Used with Statistics macro) Suppress annotations for invalid statistics.
\l
Displays variable descriptions (labels) instead of names. You can also specify the context for the labels using the syntax:
\l:<context_name>
For example, {TableSpec \l:Question} displays the table specification using the variable descriptions used in the questionnaire (the Question context).
If no context is specified, the labels displayed are those of the context specified for the table document.
\n
When combining more than one macro in an annotation position, you can use this switch to add a conditional line break after the text inserted by the macro. The line break will only be inserted if the macro inserts some text.
\p
This switch can be used with all macros to add a text prefix. For example, when used with the Filters macro, it inserts the text "Filters: " in front of the details of the filters.
\s
Used with the CurrentTime and RunTime fields, displays the short date format rather than the long date format.
Used with the Level, SideSpec, SortColumn, SortRow, TableSpec, TopSpec, and WeightVariable fields, displays the short name of the field instead of the full name. This option is ignored if you use the \l option.
\t
Include only filters applied directly to the table (that is, ignore global filters).
See also