Creating a master measure from a field
When you are working with an app, you can create master measures so that they can be reused. You can create a master measure from the Fields section of the assets panel.
When naming an entity, avoid assigning the same name to more than one field, variable, or measure. There is a strict order of precedence for resolving conflicts between entities with identical names. This order is reflected in any objects or contexts in which these entities are used. This order of precedence is as follows:
-
Inside an aggregation, a field has precedence over a variable. Measure labels are not relevant in aggregations and are not prioritized.
-
Outside an aggregation, a measure label has precedence over a variable, which in turn has precedence over a field name.
-
Additionally, outside an aggregation, a measure can be re-used by referencing its label, unless the label is in fact a calculated one. In that situation, the measure drops in significance in order to reduce risk of self-reference, and in this case the name will always be interpreted first as a measure label, second as a field name, and third as a variable name.
Do the following:
-
In sheet view, click Edit sheet in the toolbar.
The assets panel opens on the left-hand side.
-
Click Fields in the assets panel.
-
Right-click the field you want to use as a measure and click Create measure.
The Create new measure dialog opens with the field you selected. The field name is also used as the name of the measure.
-
Click in the Expression field to open the Edit expression dialog.
-
Type the expression directly in the expression editor (the main window).
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 in the lower left-hand corner. 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.
Tip noteYou 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, and only when using a computer with a keyboard. -
Click Apply to close the Add expression dialog.
Now you need to add some descriptive data for the measure.
-
Edit the name if you want to.
-
Type a description for the measure (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.
-
If you want to specify a color, 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 measure to a glossary term.
-
Under Number formatting, you can choose:
- Auto
- Number
- Money
- Date
- Duration
- Custom
- Measure expression
- Click Create.
The measure is now saved in the Measures category in the master items, and you can use it in visualizations.
Considerations
A master measure is a type of master item. When working with master items, consider the following:
-
Master items can only be viewed, edited, created, and deleted when editing a private sheet. You cannot perform actions on master items from a public or community sheet.
-
Depending on your permissions, your access to master items might be limited. For example, you might be able to view the master items in an app but not create, edit, or delete them. For more information about how permissions affect actions on master items, see Permissions for working with master items.
-
You cannot create, edit, or delete the master items of a published app. Instead, perform these actions in the source app and then re-publish the app to the managed space.
Permissions
For more information about the required permissions for creating master measures, see Permissions for working with master items.