Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Custom KPI cards can be configured and enabled via the admin panel starting with version 23.8.

KPI cards are visualised in the report of a part detail page in AMPI. They can be used to highlight important values resulting from the part assessment, to provide the user with a clear overview at a glance when they access the report.

...

Configuring a custom KPI score

KPI cards can be used to highlight the result of a single score on the part detail page in AMPI. In order to do so:

...

A KPI score can be created and setup in Admin panel > AMPI > Scores

...

Add a new score, fill the following and save (Remember to trigger score recalculation in the scores list page after all scores have been created):

...

`Name`, `Slug`, `Unit of measurement` (e.g. USD, kg, days), `Decimal places`, `Is currency` (if it is a currency value)

...

`Type`: Numeric (for this example)

  1. KPI cards can also be used to highlight scores of Type: Text, in which case the configured Unit of measurement and decimal places are ignored

...

`Schema`: Kpi

...

as follows.

Script

To configure a correct KPI card to visualize in the UI, it’s important that the structure of the returned results is as follows:

Code Block
return {
	result: {
		techSlug: 'fdm',
		value: 100.20, 
		percentage: 1,
	},
}

...

The provided example script above has hardcoded values for techSlug, value and percentage , whereas in real setups the value and percentage can come from other calculations based on other scores or helper functions.

The values of techSlug, value and percentage are then visualized in specific locations of the KPI card.

Info

Value is the only mandatory result to be returned by the script; when needed, use techSlug to display the best technology associated with the KPI value and percentage to display a trend.

Type

  1. When Numeric is selected as a `Type`, the value property on the script is a simple number (integer or floating). The unit of the value is defined by either the `Unit of measurement` or `Is currency` fields

  2. When Text is selected as a `Type`, the value property on the script needs to be a string within 2 ' characters (e.g. value: 'a string'). `Unit of measurement`, `FE Multiplier`, `Decimal places` and `Is currency` are ignored.

Schema: Kpi

Select KPI to create a score that can be selected and visualized as a KPI card in the UI. Other schema options are not compatible with a report chart of `Type` = KPI (see below for more information).

...

Note

Remember to trigger score recalculation in the scores list page after all scores have been created

Configuring a custom KPI card

After the configuration of the desired score, a report chart of type KPI needs to be created to bundle the score results into a KPI card.

Go to Admin panel > AMPI > Report Charts and add a new report chart as follows.

Add a new chart, fill the following and save:

...

`Name`, `Description`, `Sort priority`

...

Make sure to check `Is enabled` and do not select anything in `Report`

...

`Type`: KPI

...

Attribute

Function

Name

Will be displayed Displayed as KPI card header in the UI

Description

Will be shown Displayed as help text in the UI upon mouse hover on the information icon (optional)

Sort priority

Defines the order of the KPI cards , lower numbers get sorted visualization in the UI. Lower values are displayed first

Is enabled

Shows/Hides individual KPI cardcards in the UI

Type

Defines how the report chart is rendered, choose typ type = KPI to visualize a report chart as a KPI card

After configuration of the desired score, a report chart of type KPI needs to be created to bundle the score results into a KPI card. To do so:

...

Go to Admin panel > AMPI > Report Charts

Report chart scores

Defines which score is visualized in the report chart. Make sure to select only 1 score to create a KPI card

Info

When configuring a KPI card, `Report` field is left empty; all KPI cards are displayed in the AMPI part detail page, in the Overview section.

Note

The selected score must follow the correct setup and script results structure as described above in https://3yourmind.atlassian.net/wiki/spaces/PD/pages/1881342011/KPI+card+configuration#Configuring-a-custom-KPI-score. If not, the report chart is not displayed in the UI.

...