Every calculation view has a Semantics node. You do not add this, it is already present and will always be the top node (regardless of the type of calculation view). In this node, you assign semantics to each column in order to define its behavior and meaning. This is important information used by consuming clients so that they are able to display and process the columns appropriately.
One of the most important and mandatory settings for each column is its column type. You can choose between attribute or measure. This defines the basic role of the column.
In the semantic node, you can also optionally assign a semantic type to each column. A semantic type describes the specific meaning of each column and this can be helpful to any client that consumes the calculation view by enabling it to then represent the columns in the appropriate format. For example, if you define a column as a date semantic type, the front-end application can format the value with separators rather that a simple string. The key point is that it is the responsibility of the front-end application or consuming client to make use of this additional information provided by the semantic type.
Assigning a description column to another column - for example, assigning the product id column to a product description column so that a user sees a value which is more meaningful.
Hiding a column - This can be used if a column is only used in a calculation, or is an internal value that should not be shown, for example, hiding the unhelpful product id when we have assigned a description column that should be shown in its place.
Assigning a variable - This enables a user to select a filter value at runtime for the attribute.
Apart from the semantic type, there are other important settings that can be defined for each column such as the following:
- One of the most frequently maintained values in the Semantics node is the name and label of the column. It is possible to define an alternative name and label to any column so that it will make more sense to a user than what was originally proposed from the data source.
- For example, who wants to see the word MATNR in a business report column heading when we really should be seeing the words Material Number?