How to :: add highlighted KPIs

Overview

This feature highlights important information, or add extra information, e.g. compare the data appearing on the screen with data from previous years.

It can be a numerical value or some text.

You can use the dataset of the existing chart or create a new dataset to query values for this HKPI.

highlighted kpis

highlighted kpis

Note

On mobile you can scroll left and right on the HKPIs to show more. As a general rule don’t forget to prioritize the information : use 3 HKPIs at most!

💡 Did you know?

HKPIs can depend on a filter. Just use make sure you add your hkpi dataset in the filter configuration.

Options

Options
Parameter Type Value returned Description
name mandatory string type in the kpi name
value mandatory string reference for the value in the datasets block
badge optional boolean true/false to display the legend
comment optional string column name containing the value to be displayed in the comment
sentiment optional string column name containing the sentiment to be displayed on the value

Note

The badge can be either:

  1. a variation (an up or down arrow) linked to a queried value
  2. simply a bullet (badge: "bullet")

Switch to code mode to add a simple bullet instead of the arrow or equal sign. Just type in bullet next to the badge parameter.

Code mode sample

charts: []
highlightedKpis: [ # !important: same identation level as charts
  {
    name: ""
    value: ""
    comment: ""
    badge: ""
    sentiment: ""
  }
]
datasets:[]

Examples

Ex 1: with badge, sentiment and comments using templating

hkpi

Dataset example

country revenue last_year variation
France 50 70 -28.6
UK 80 74 8.1

Configuration

charts: []
highlightedKpis: [ # !important: same identation level as charts
  {
    name: "<$= my_dataset.country $> revenue"
    value: "my_dataset.revenue"
    comment: "vs <$= my_dataset.last_year $> last year | <$= my_dataset.variation $> "
    badge: "my_dataset.variation"
    sentiment: "my_dataset.variation"
  }
]
datasets:[
  my_dataset:
    id: "hkpi"
    query:
      domain: "hkpi_data"
      country: "France"
    units:
      last_year: " M$"
      revenue: " M$"
      variation: " %"
    sentiment:
      variation:
        domain: [
          0
        ]
        range: [
          "negative"
          "positive"
        ]
]

Ex 2: with multiple HKPIs

hkpi2

Dataset example

country revenue last_year variation
France 50 70 -28.6
UK 80 74 8.1

Configuration

charts: []
highlightedKpis: [ # !important: same identation level as charts
  {
    name: "<$= my_dataset.country $> revenue"
    value: "my_dataset.revenue"
    comment: "vs <$= my_dataset.last_year $> last year | <$= my_dataset.variation $> "
    badge: "my_dataset.variation"
    sentiment: "my_dataset.variation"
  }
  {
    name: "<$= my_dataset_2.country $> revenue"
    value: "my_dataset_2.revenue"
    comment: "vs <$= my_dataset_2.last_year $> last year | <$= my_dataset_2.variation $> "
    badge: "my_dataset_2.variation"
    sentiment: "my_dataset_2.variation"
  }
]
datasets:[
  my_dataset:
    id: "hkpi"
    query:
      domain: "hkpi_data"
      country: "France"
    units:
      last_year: " M$"
      revenue: " M$"
      variation: " %"
    sentiment:
      variation:
        domain: [
          0
        ]
        range: [
          "negative"
          "positive"
        ]
  my_dataset_2:
    id: "hkpi"
    query:
      domain: "hkpi_data"
      country: "UK"
    units:
      last_year: " M$"
      revenue: " M$"
      variation: " %"
    sentiment:
      variation:
        domain: [
          0
        ]
        range: [
          "negative"
          "positive"
        ]
]

Legacy configuration

Note

The datasets configuration has been implemented. No need to migrate your old configuration, it’s compatible. See below for more details

Code mode sample
#charts: []
highlightedKpis: [ # !important: same identation level as charts
  name: " "
  value: "value_name" #reference used for the value in the data block
  precision:
    value: ',.2f'
  units:
    value: "%"
  data:
    value_name:  #[query for value_name]
      query:
        domain: ""
      field: "value_field" #column used for the value
]
Ex 1: with badge, comment and sentiment
#charts:
highlightedKpis: [ # !important: same identation level as charts
  name: " "
  value: "value_name" #reference used for the value in the data block
  badge: 'value_badge' #reference used for the badge in the data block. Can also take the static value "bullet"
  comment: " " #commentary shown bellow the KPI
  sentiment: #select color of KPI and badge, see the docs on sentiment
    value_badge:
      domain: [0]
      range: ['negative','positive']
  precision:
    value_name: ',.1%'
    value_badge: ',.0f'
  units:
    value_name: ''
    value_badge: ' pts'
  data:
    value_name:##[query for value_name
      query:
        domain:""
      field: "value_field" #column used for the value
    value_badge:##[query for value_badge]
      query:
        domain:""
      field: "value_badge_field" #column used for the value badge
]
Ex 2: with badge, comment and sentiment based on a third value
#charts:
highlightedKpis: [ # !important: same identation level as charts
  name: " "
  value: "value_name" #reference used for the value in the data block
  badge: 'value_badge' #reference used for the badge in the data block. Can also take the static value "bullet"
  comment: " " #commentary shown bellow the KPI
  sentiment: #select color of KPI and badge, see the docs on sentiment
    value_sentiment:
      domain: [0]
      range: ['negative','positive']
  precision:
    value_name: ',.1%'
    value_badge: ',.0f'
  units:
    value_name: ''
    value_badge: ' pts'
  data:
    value_name:##[query for value_name
      query:
        domain:""
      field: "value_field" #column used for the value
    value_badge:##[query for value_badge]
      query:
        domain:""
      field: "value_badge_field" #column used for the value badge
    value_sentiment:##[query for value_sentiment]
      query:
        domain:""
      field: "value_sentiment_field" #column used for the value sentiment
]
Ex 3: with 2 Highlighted KPIs
#charts:
highlightedKpis: [ # !important: same identation level as charts
  name: " Kpi 1"
  value: "value_name" #reference used for the value in the data block
  precision:
    value: ',.2f'
  units:
    value: "%"
  data:
    value_name:  ##[query for value_name]
      query:
        domain: ""
      field: "value_field" #column used for the value
,
  name: " Kpi 2"
  value: "value_name" #reference used for the value in the data block
  precision:
    value: ',.2f'
  units:
    value: "%"
  data:
    value_name:  ##[query for value_name]
      query:
        domain: ""
      field: "value_field_2" #column used for the value
]

That’s it!