Special elements
This topic documents the special elements that you can include in an axis. See also
Element list syntax.
By default, the element name is the same as the element type. For example, by default, a Standard Error element is called stderr. However, if you create multiple elements of the same type, you must specify names to ensure that each element is uniquely identified.
Base
Shows the total number of cases in the variable after any weighting has been applied. Generally, the base includes every case for which the value in the case data is not Null.
If an axis does not include a base element, UNICOM Intelligence Reporter - Survey Tabulation creates one at the start of the axis. This means that normally you do not need to use this syntax if you want the base element to appear at the start of the axis. For more information, see
Base elements. See also
Restricting a base using an expression.
Syntax
base(['<expression_text>'])
Unweighted base
Shows the total number of cases in the variable before any weighting has been applied. In an unweighted table, an unweighted base element shows the same values as the counts in the base element. Only one value is ever shown for an unweighted base element, even when multiple types of cell contents have been requested.
The value that is shown is the unweighted base count, regardless what type of cell contents have been requested for the table. By default UNICOM Intelligence Reporter - Survey Tabulation automatically adds an unweighted base element at the start of each axis in a weighted table. For more information and examples, see
Base elements.
Syntax
unweightedbase(['<expression_text>'])
Mean
Shows the mean value of a specified numeric variable, optionally restricted by an expression. See
Displaying the mean of a numeric variable. If you do not specify a numeric variable, the mean element shows the mean value of the factors associated with the elements in the axis, and the expression is ignored. See
Displaying a mean based on factors.
Syntax
mean([<numeric_variable>], ['<expression_text>'])
Standard deviation
Shows the standard deviation for a specified numeric variable, optionally restricted by an expression. If you do not specify a numeric variable, the element shows the standard deviation for the factors associated with the elements in the axis, and the expression is ignored.
Syntax
stddev([<numeric_variable>], ['<expression_text>'])
Standard error
Shows the standard error for a specified numeric variable, optionally restricted by an expression. If you do not specify a numeric variable, the element shows the standard error for the factors associated with the elements in the axis, and the expression is ignored. For examples, see Mean.
Syntax
stderr([<numeric_variable>], ['<expression_text>'])
Sample variance
Shows the sample variance for a specified numeric variable, optionally restricted by an expression. If you do not specify a numeric variable, the element shows the sample variance for the factors associated with the elements in the axis, and the expression is ignored.
Syntax
sampvar([<numeric_variable>], ['<expression_text>'])
Total
Shows the sum of the counts between the most recent base or total element, whichever is the most recent, and the next total or base, or the end of the axis, whichever occurs first. A total element works in this way regardless of its position in the axis. See
Displaying totals and subtotals.
Syntax
total()
Subtotal
Shows the sum of the counts between the most recent base, total, or subtotal element, whichever is the most recent, and the next base, total, or subtotal, or the end of the axis, whichever occurs first. A subtotal element works in this way regardless of its position in the axis. See
Displaying totals and subtotals.
Syntax
subtotal()
Text
A text-only element that can be used to form a subheading. When the axis is on the side of the table, the element forms a text-only row.
Syntax
text()
Minimum
Shows the minimum value of a numeric variable, optionally restricted by an expression.
Syntax
min([<numeric_variable>], ['<expression_text>'])
Maximum
Shows the maximum value of a numeric variable, optionally restricted by an expression.
Syntax
max([<numeric_variable>], ['<expression_text>'])
Net
In a multiple response variable this creates an element that shows the number of respondents who chose one or more categories in a group of categories. A subtotal element for the same categories would show the number of responses given. In a single response variable a net shows the same values as the subtotal. See
Creating nets.
Syntax
net({<element_list>})
Combine
This is like a net, except that the elements on which it is based are not shown. See
Combining categories.
Syntax
combine({<element_list>})
Expression
This creates a special element that is defined by a custom expression. You can use any expression that is supported by the UNICOM Intelligence Data Model, including any of the functions in the UNICOM Intelligence Function Library. When you are using the hierarchical (HDATA) view, the level of the expression is defined by the level of the variable. You must make sure that all variables included in the custom expression are at this level or are up-leved/down-leved to this level. See
Creating an element based on a custom expression. You can use expressions to band numeric variables, autocode text variables, or band date variables.
Syntax
expression('<expression_text>')
Numeric
Shows a numeric variable, optionally restricted by an expression. You can use this element type to create summary statistic tables.
Syntax
numeric(<numeric_variable>, ['<expression_text>')
Paired Preference
Shows the result of a paired preference test run on a table. See
‘Paired preference test’ on page 181 for further information and examples.
Syntax
ppt()
Derived
Shows a derived element calculated from other elements within the variable using an arithmetic expression. Derived elements use an arithmetic expression based on the values of other elements in the table. This differs from the expression() syntax, which uses a logical expression that tests the case data to determine whether a respondent is included in the count. See
Creating a derived element calculated from other elements.
Syntax
derived('<expression_text>')
Sum
Shows the sum or total of the values in a specified numeric variable, optionally restricted by an expression. See
Displaying the sum of a numeric variable.
Syntax
sum(<numeric_variable>, ['<expression_text>'])
Effective base
Syntax
effectivebase()
Median
Shows the median for a specified numeric variable, optionally restricted by an expression. For more information, see
Displaying median and percentile values. You must specify a numeric variable.
Syntax
median(<numeric_variable>, ['<expression_text>'])
Percentile
Shows a percentile for a specified numeric variable, optionally restricted by an expression. You must specify a numeric variable. You must also specify a cut-off value between 1 and 100 to indicate the percentile you want to use. The
median element gives the same result as a percentile with a cut-off value of 50. For more information, see
Displaying median and percentile values.
Syntax
percentile(<numeric_variable>,<cut_off_value>,['<expression_text>'])
Mode
Shows the mode for a specified numeric variable, optionally restricted by an expression. For more information, see
Displaying a mode. If there is more than one mode value, the lowest is displayed. You must specify a numeric variable.
Syntax
mode(<numeric_variable>, ['<expression_text>'] )
Notes
▪When calculating the values for mean, standard deviation, standard error, sample variance, min, and max elements, UNICOM Intelligence Reporter - Survey Tabulation uses the same formulas used for the cell contents. For more information, see
Statistical formulae.
▪When you create a special element in UNICOM Intelligence Professional or UNICOM Intelligence Reporter - Survey Tabulation, the Table Object Model automatically takes care of creating any helper elements required by that element. If you are adding special elements to the metadata using a programming language or a data management script, you might sometimes want to create the helper elements explicitly, rather than let the Table Object Model create them. For further information on the required settings for creating special elements and their helper elements, see the Special elements and helper elements in metadata topic in the UNICOM Intelligence Developer Documentation Library.
▪NumericVariable (AnalysisVariable), Multiplier, and Weight properties need to be specified as absolute references. However, variable references in expressions need to be specified as relative references. Using the Household.mdd sample as an example, when editing a categorical variable at the person level, if you want to display the mean of man’s weight, you can add the following mean element:
mean(person[..].weight, 'gender.ContainsAny({Male})')
▪Use of analysis variables on parallel levels is not supported. Valid analysis variables must meet the following conditions:
▪The variables must be numeric.
▪The variables must be at the same ascendant level.
Take the following variable as an example:
variable "person[..].trip[..].purpose"
Same level analysis variable (valid):
person[5].trip[..].transportmodes
Ascendant level analysis variable (valid):
person[..].age, numpersons
Parallel level (not valid)
vehicle[..].mileage
In some of the examples, the axis specification is presented on multiple lines for clarity. In practice, you must specify the axis specification without line breaks.
See
See also