Creating a calculated dimension
You can create a calculated dimension from the Master items tab in the assets panel. The expression editor opens from the Create new dimensions dialog.
Do the following:
-
Click Edit sheet in the toolbar.
The assets panel opens on the left-hand side.
-
Click Master items in the assets panel.
-
In Master items, click Create new beside Dimensions.
The Create new dimensions dialog opens.
-
Click in the Field text box to open the Add expression dialog.
You will now be able to add expressions in different ways, depending on you preferences and of different levels of complexity.
Using a common function
-
Select a field from the drop-down list.
- Click the aggregation function you want to use.
-
Click Insert to insert the function and the field into the expression editor.
Tip noteYou can insert just a function or just a field by selecting only one of them. -
Click Apply to close the Add expression dialog.
Continue by adding the descriptive data for the dimension.
Adding an expression by typing
-
Type the expression directly in the expression editor.
The field names you use in the expression are checked, and the syntax of the expression is validated.
Tip noteAs you type in the expression editor, the expression is validated continuously. If there is an error, you see a hint about what is incorrect. Additional error information may be available by clicking the icon next to the hint.Each line in the expression editor is numbered and syntax highlighting is used.
-
Click Apply to close the Add expression dialog.
For a measure, you continue by adding the descriptive data for the measure.
Adding an expression through the properties panel
You can add an expression to a visualization through the properties panel.
-
Open the sheet with the visualization that you want to edit.
-
Click Edit sheet and click Advanced options to open the advanced edit mode.
-
Click the visualization that you want to edit.
The properties panel for that visualization is displayed on the right-hand side.
-
Under Data, click Add data and select Dimension.
A dimension text box is displayed.
-
Type your expression. The expression must begin with an equals sign (=), otherwise the string will be interpreted as text.
Detailed syntax help
You can open the online help with the full description of how to use the current function by double-clicking the function name in the expression editor and pressing Ctrl+H on the keyboard. This feature becomes available after having entered the first parenthesis of the expression after the function name.
Adding the descriptive data for the dimension
After having entered the expression, you need to add some descriptive information.
-
Type a name for the dimension.
-
Type a description for the dimension (optional).
If you do not add a description and then link a glossary term to your master item as a definition, the term definition will be used in the description.
-
Optionally, click in the color drop down and select a color through one of the following methods:
- Click one of the colors in the palette.
- Type a 6 character color code in the Hex input field: #.
- Click at the bottom of the dialog, select a color in the color wheel, and optionally adjust the saturation slider.
-
Add tags (optional).
-
Optionally, if you have access to a glossary, link the dimension to a glossary term.
- Click Create.
-
Click Close.
The calculated dimension is now saved in the Dimensions category of the Master items, and you can use it in visualizations.