A context is always described by a key, e.g. a dimension, and a value, e.g. a member. In the examples above, the keys would be 'year' or 'country' and the values would be '2021' or 'Germany'. Contexts can be defined statically in the GPS or dynamically using the scripting language in BI environments that allow scripting, such as SAP Analytics. If we use the comments in a visualization, data contexts are automatically created for data point comments for the data hierarchy on which the data point is based. For a visualization comment that describes the visualization as a whole, an environment context is automatically created that refers to a randomly generated and persisted ID of the visualization.
A hierarchy is implicitly formed from the set of contexts for a comment, which is mapped in our independent comment component under "more specific comment(s)". For example, if only one context is specified as the context combination to be displayed, all comments containing at least that context will be displayed here. Assuming that only the name of the dashboard is specified as the context combination, more specific comments about each year will also be displayed here.
Context Types
Environment Context
The "Environment Context" is intended to limit the comment space to properties that are not dependent on the data. For example, the comment area could be restricted to the current dashboard. An Environment Context is also defined by a combination of key and value. In our example, the key could be something like "Dashboard Name" and the value could be "Sales Dashboard".
Data Context
The "Data Context" is used to restrict the comment space to a certain data constellation. In addition to the properties key and value, it also contains the optional properties keyText and valueText. These are used to maintain the display name from the data source (if available) for the dimension and member. This makes the display of contexts associated with a comment easier to understand. Dashboards and data layers can be very diverse and dynamic. Therefore, they are usually read and maintained directly in scripting environments. For example, the data context could be set so that the key 'Year' is defined with the value '2021'.
Context setting types
Static Contexts
The "Static Contexts" are defined in the GPS and thus apply independently of filter states defined by scripting, for example, throughout the entire runtime. A static context could be used, for example, to limit the comment space to the current dashboard. The type "Environment Context" should be selected for this.
Dynamic Contexts
The "Dynamic Contexts" are set in environments with scripting, there based on the current state. These are usually used to dynamically pass on the current filter state on the data to the comments.
In this way, a maintained comment is assigned to exactly this data constellation.
For example, we can connect a dropdown with a selection for the current year. When the dropdown is used, it filters the data source at the same time and adds a data context. This data context then consists of the key "Year" and the value that was selected in the dropdown. Static contexts are of course retained.
Automatic Contexts
Automatic contexts are created when using our visualisations with comments. The data hierarchy associated with the data point is automatically assigned to the comment. The visualisation comment is automatically assigned the visualisation ID.