# KPI Formulas in KPI Scorecards

The `kpis` structure in a `kpiscorecard` can encapsulate formulas that calculate KPI comparisons.

Note:

In addition to KPI formulas, the `kpis` structure can encapsulate all the KPI performance indicators that you want to compare. For more information, see KPI Comparisons in KPI Scorecards.

Each formula reference in the `kpis` structure is represented by the `kpi` structure. The following is an example of the `kpis` structure:

```          ```    ...
<kpis>
<kpi>
<kpi>FORMULAPERCENT</kpi>
<formula>{SALES}/{QUOTA}</formula>
<lessismore>F</lessismore>
<hidden>F</hidden>
</kpi>
</kpis>
...
```
```

Set the `kpi` element to any of the following values to define a formula expression:

• FORMULACURRENCY

• FORMULANUMERIC

• FORMULAPERCENT

Use the `formula` element to define the formula expression. These formulas are similar to those used in Excel. They can include functions and KPI IDs. For more information about valid KPI IDs, see KPI IDs Available for Scorecard Formulas.

Warning:

KPI scorecards do not support results that are unions of two comparisons. If you enter a KPI comparison and a date range comparison, the result is displayed as N/A. To work around this limitation, try defining the comparison as a formula instead. For example, instead of entering ESTIMATES for `kpi`, SALES for `comparevalueto`, and VARIANCE_PERCENT for `comparisontype`, enter FORMULAPERCENT for `kpi` and {SALES}/{QUOTA} for `formula`. See Defining KPI Scorecard Formulas.

Set the <`lessismore` boolean element to T if lower values from the calculated result are more preferable than higher values. When this element is set to T, downward arrows are green and upward arrows are red in the KPI scorecard.

Set the `hidden` boolean element to T to hide the results of the formula from the KPI scorecard.

Set the `label` value to the text that should appear as a row or column header in the KPI scorecard portlet.

For more information about `kpi` elements, see kpi.