Survey Tabulation > Table specification syntax > Special elements > Creating an element based on a custom expression
 
Creating an element based on a custom expression
This example is based on the Museum sample data set.
biology{.., ^Not_answered, expression('visits > 4')}
This example creates an axis based on the biology variable. It includes all of the elements in the axis with the exception of the Not answered category, but has an additional element, which is based on a custom expression. The custom expression selects respondents who entered a value greater than four when answering the question on which the visits variable is based. Because you have not specified a label for the special element, the label defaults to the expression text.
Just like when you specify a custom label, you must enclose the custom expression in single quotation marks:
'<expression>'
or two double quotation marks:
""<expression>""
If the expression contains a text literal, you must escape the double quotation marks used to enclose the text literal as you do when a label contains a double quotation mark. For example, if you use single quotation marks, you must escape each of the double quotation marks that enclose the text literal with a second double quotation mark.
Here is a table that has this axis on the top:
Table showing element based on a custom expression
You can use any expression that is supported by the Data Model, including any of the functions in the Operators.
See Advanced expressions for more information.
See also
Special elements