Making your own calculations
To get insight into your data, you set up visualizations using various data columns, aggregation methods, and visualization properties. Often you can retrieve even more knowledge of the data by making your own calculations on it.
When you make calculations on the data, you get the results by specifying expressions that combine one or more columns with aggregation methods and/or mathematical functions. Then you can choose different ways of exposing the results:
When you use calculated columns, the results from your expression become available as values in a new data column, which is added to the data table. The column is, like any other data column, available for selection in any visualization, and on various visualization axes, whenever the data table is used in the analysis. It can also be used in further calculations. Moreover, you can filter to the calculated values in the column, because a filter is created to represent the new column.
Generally, the calculation of the new data column is a once-only calculation. This means that once a value is calculated, it is definitive, and it will not change upon filtering. Refreshing the data leads to recalculation of the values, though.
When you use custom expressions, you apply your specified expression directly to the current context, for example, to an axis in a visualization. Neither a new data column nor a filter is created, and when applied to a visualization axis, no other visualizations are affected. If the visualization properties change, for example, by filtering, your custom expression re-evaluates instantly in the same way as predefined aggregation methods. This means, you can look upon the custom expression as an aggregation method created by you.
Even if these calculations are used in different ways, the expressions you create for what to calculate are common to both the methods. To get started with using expressions, you need to know some basic syntax rules:
- Names of data columns must be wrapped in square brackets:
- Aggregation methods must be followed by parentheses. Parentheses enclose what to be aggregated, and they can contain more than one parameter: