Knowledge Model - Calculated Attributes
Calculated attributes allow you to extend physical tables (known as records in the Knowledge Model) in your Data Model with virtual columns. These virtual columns are created using PQL, allowing you to reference and reuse the PQL calculations and formulas in your KM. The PQL used to define the calculate attribute is then evaluated at runtime (after the Data Model load), displaying the result of your PQL calculation as values in your view or other Studio assets.
Calculated attributes PQL functions must contain the following references:
"recordID"."attributeID"
To learn more about PQL, see PQL - Process Query Language.
Creating calculated attributes in the Knowledge Model
As calculated attributes based on tables in your Data Model, they are created from record attributes. For more information about record attributes, see: Records.
To create a calculated attribute:
Click Studio and then open the package containing the Knowledge Model you want to create the record in.
Open the KM you want to create the calculated attribute for.
Select Records and then open the record you want to associate your calculated attribute to.
In this example, we're associating our calculated attribute with the Eban / EBAN record in our Data Model:
Click Add Attribute, opening the attribute creation panel.
Configure your calculated attribute using the following settings:
Display Name: A human-readable label used in the user interface.
Short Display Name: Shorter human readable label for the object shown automatically on the Views whenever the Display Name is truncated. Can contain max 20 characters.
ID: A unique technical identifier used to reference this calculated attribute. Must be unique within all attributes in the KM.
Description: A human-readable description for the calculated attribute.
Internal Note: A field only visible within the Knowledge Model.
PQL formula: This must reference the record ID and your attribute ID (configured above).
Ensure that your PQL formula includes this:
"recordID"."attributeID"
Column configuration: Configure your virtual column type, format, and any associated units.
Use the preview section to check that your calculated attribute is configured correctly and returning the desired results. If errors are displayed here, return to your PQL formula and correct them.
Click Save.
The calculated attribute is added to your Knowledge Model and available to use in your related content.
Managing existing Knowledge Model objects
You can manage existing Knowledge Model objects by clicking the Options icon:
You then have the following options per object:
Disable scope: By disabling the scope of an object, the object then can't be used anywhere within the package. This is a good option if you want to disable an object but delete it from your KM.
Duplicate: This opens the create object window with the configuration of the object you are duplicating used as a template. When saving a duplicate object, the object ID must be unique.
Delete: This deletes the object from the KM and any references to that object in existing content. When deleting an object, there is no undo or recovery option.