Next: The valueMapEntry
Element, Previous: The sourceVariable
Element, Up: Variable Elements [Contents]
derivedVariable
ElementderivedVariable :id :categorical=(true) :value :dependsOn=ref sourceVariable? => variable_extension* (format | stringFormat)? valueMapEntry*
Like sourceVariable
, this element defines a variable whose
values can be used elsewhere in the visualization. Instead of being
read from a data source, the variable’s data are defined by a
mathematical expression.
This element has the following attributes.
An id
is always present because this element exists to be
referenced from other elements.
Always set to true
.
An expression that defines the variable’s value. In theory this could be an arbitrary expression in terms of constants, functions, and other variables, e.g. (var1 + var2) / 2. In practice, the corpus contains only the following forms of expressions:
constant(0)
constant(variable)
All zeros. The reason why a variable is sometimes named is unknown. Sometimes the “variable name” has spaces in it.
map(variable)
Transforms the values in the named variable using the
valueMapEntry
s contained within the element.
This attribute doesn’t affect the display of a table.