An expression is a calculation which produces a value or data set. It can be a combination functions, fields, and mathematical operators. Expressions are used to process data in the app in order to produce a result that can be seen in a visualization.
Click Open Expression editor () in the properties panel when editing a visualization or a sheet.
The symbol indicates an expression field, for example titles, subtitles, footnotes, dimensions, and measures.
Type directly into the expression editor, or use the expression editor panel to build expressions.
In the expression editor, you can enter an expression by typing in the expression field. When you type the name of a function in the expression, a tooltip appears that provides information to help you enter the function correctly, including argument names and qualifiers.
Select a field from a specific table and a common aggregation function to generate some common expressions to be inserted into the expression editor. You can also select system fields.
To learn more about aggregation functions, see Basic aggregation functions, Counter aggregation functions and Statistical aggregation functions.
To learn more about system fields, see System fields.
Clauses and set expressions
Some aggregation functions might require a Distinct clause or a Total clause. Use the check box for each clause to insert it in the aggregation function. Each clause can be used independently.
Use the Set Expression check box to insert your current selection as a set expression in your aggregation. The current selection inserted will always be based on the default state. If you want to create an expression based on an alternate state use the Set Expressions section instead.
To learn more about how to use these set expressions, see Set modifiers.
To learn more about alternate states see Using alternate states for comparative analysis.
Select a function from a specific category to insert it into the expression editor. You can use functions to generate more complex expressions. A small syntax template shows you how each function is used.
See: Script and chart functions
Select whether you want to insert the current selection or a bookmark as a set expression. If available, you can choose which alternate state on which to base the current selection or bookmark.
Select variables and insert them in your expressions. If available, a definition and the value of each variable is shown.