# Computed Metrics

Computed metrics can be created in the portal from existing metrics in order to manipulate the underlying series or to join multiple series to perform ratio (percentage) or roll-up (sum/average) calculations.

The `replace-value`

setting can be used to simply replace the input value when no references to other series are required.

In this example, the second chart uses log10 values to make it easier to compare small and large scale values.

`replace-value = Math.log10(value)`

In this example, the underlying series are hidden and another visible series is created which displays the ratio of two hidden series multiplied to a percentage value. In order to reference other series, such underlying series should be assigned unique identifiers with the `alias`

setting.

[series] metric = nmon.logical_partition.physicalcpu alias = pcpu display = false [series] metric = nmon.logical_partition.virtualcpus alias = vcpu display = false [series] label = max used, % value = 100*value('pcpu')/value('vcpu') color = violet |

In addition to obtaining the last value at a given time for the referenced series with the value(`alias`

) function, it is also possible to obtain its period statistics with avg(), max(), min(), and other aggregation functions. If a custom period is required, the syntax is avg(`alias`

, `period`

), for example avg(`s1`

, `1 hour`

)

#### Extrapolation

Computed series values are calculated for all unique timestamps of the underlying series.

If one of the series is lagging behind, its value at later points is extrapolated from its last value.

Extrapolation can be disabled by setting computed values to `null`

for timestamps after the minimum last time of the underlying metrics.