Expression language details

If you learn how the expression language works, the creation of valid expressions will be easier. This topic attempts to explain some basic functionality of the language.

If a column name contains characters other than letters, digits or _ (underscore), then they must be enclosed with "[" and "]" characters (square brackets). The square brackets are also required when the column name is the same as a function name, or when the column name begins with a digit.

If you apply <> around an expression, it is treated as categorical.

Multiple columns are normally separated by a comma.

You can use the AS keyword to specify a new name for an expression, and hide the underlying expression. See below for some examples. Note that when the axis expression contains commas, you cannot rename the entire axis, but you can define one name for each part of the expression.

Constants can always be used as an argument, even if the function description says that the argument has to be a column.

See also Operators and Functions for complete descriptions of the available operators and functions.

If you create more complex expressions that need an explanation, it is possible to add comments to the expressions. Use '//' to specify that the text after the symbols is a comment.

For example:

Avg([Sales]) OVER Intersect([Cat], AllPrevious([Year]))
//Shows the average sales per category for all years, up until the current year.

Note that if you add comments to an expression on a visualization axis, it is expected that you continue using the custom expression dialog for all further editing. This is because the drag-and-drop operations affect and rearrange the expressions too much to be able to keep comments.

Examples of expressions:

[Column1]

[Column1], [Column2]

[Column1]/([Column1]+[Column2]) AS Quota

[Column1] AS [My first column], [Column2] AS [My second column]

<[Category column 1]>

<[Category column 1] nest [Category column 2]>

39+12*3

-(1-2)

cast (power(2,2) as integer)

case [Column1] when 10 then 'ten' else 'not ten' end

case when Column1 is not null then Column1 else Column2 end

[Sales]/1000 //The sales figure has been divided by a thousand to show values in kkr instead of SEK