> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Adding new kpis

This page provides a description of how we can add a KPI.

The techniques employed are generic examples that can be extended, adapted and repeated for any use
case that we need. In all cases, we make minimal changes to the Reference Implementation.

A KPI can be defined as a bean with the following format:

To define a KPI, create a bean with a Qualifier in the following format `kpi[cubeNameHERE]`. Below is an example of a KPI on the FRTBCombinedCube

Be sure to include our configuration class which contains our bean(s) in the application config class `FRTBConfig` located
in `/frtb-starter/src/main/java/com/activeviam/frtb/starter/cfg/impl/`

```java theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
    @Bean
    @Qualifier("kpiFRTBCombinedCube")
    public IKpiDescription myKpiTest() {
        return StartBuilding.kpi()
            .withName("myName")
            .withValue(new KpiValueDescription("[Measures].[MyMeasure]"))
            .withStatus(new KpiStatusDescription(
                "Case\n" +
                "When IsNull(KpiValue(\"MyMeasure\"))\n" +
                "Then NUll\n" +
                "When 0.7 > KpiValue(\"MyMeasure\")\n" +
                "Then -1\n" +
                "When KpiValue(\"MyMeasure\") > 0.8\n" +
                "Then 1\n" +
                "Else 0\n" +
                "End",
                "Shapes"))
            .build();
    }
```

Pre-defined KPIs are located in the class `KpiProviderConfig` within `/frtb-starter/src/main/java/com/activeviam/frtb/starter/cfg/impl/`
