Optimization problems require one or more metrics to be defined. The metrics are used as a basis for optimization, or for helping define the constraints of the problem. In either case, defining an optimization metric in LityxIQ follows the same process.

The Defined Metrics area of the Scenario Setting dialog looks like the following:

For metrics that you have defined, the buttons can be used to Delete and Edit the metrics, respectively. To create a new metric, click the Add Metric button. In either case (new metric, or edit existing metric using ), the dialog looks like the following. This document described the options available.

# Metric Formula Tab

**Label** - Enter the text label to be used for this metric in reporting or in the interface.

**Simple vs Complex Metric** - Select whether this is a simple or complex metric. Each possibility leads to a different method for computing the metric and is defined below.

- A simple metric is one that is computed directly from summarizing the raw dataset. Typically it is defined as a sum of a particular variable (Data Element) in the dataset.
- A complex metric is one that is computed based on combining other Simple or Complex metrics.

__Simple Metric Options__

For a more detailed overview of Simple Metrics, see: https://support.lityxiq.com/181244-Simple-Optimization-Metric.

**Summary Function** - Select either SUM, MIN, MAX, or AVG. This determines how the dataset is aggregated to compute the metric. In general, only the SUM function leads to the metric being available for optimizing or for constraints. Any summary function selected will allow the metric to be available for reporting.

**Data Element and Multiply By ... **- All Data Elements selected on the Dataset & Settings tab will be available in the Data Element dropdown. The options "none" is available also. In combination with the Multiply By option, these settings define how the summary metric is computed.

- If Multiple By is checked, then the metric is computed by summarizing over the dataset by multiplying the result of the optimization by the data element.
- If Multiple By is not checked, then the metric is computed by summarizing over the dataset by simply applying the Summary Function to the selected data element.

__Complex Metric Options__

For an overview of Complex Metrics, see: https://support.lityxiq.com/910529-Complex-Optimization-Metric. An overview of the options provided is below.

**Numerator** - Select the existing metric that will serve as the numerator for this complex metric. This is required.

**Denominator** - Optionally, select the existing metric that will serve as the numerator for this complex metric.

**Right Hand Side** - Optionally, set the right hand side of the complex metric definition. Options are:

- No RHS - do not have a right hand side to the metric
- Enter a Constant - enter a constant value manually for the RHS. In this case, you will also enter a sign that connects the right hand side and the constant value.
- Use a Summary Metric - use another metric on the RHS. In this case, you will also enter a sign that connects the right hand side and choose the summary metric.

For both a simple and complex metric, you will also be shown a **Formula. ** This area shows the formula that results from the combination of the options you have chosen. If the formula results in an invalid metric, you will see "invalid" displayed in the Formula box.

# Display Options Tab

The Display Options tab relates only to how computed values of the metric are shown when analyzing outputs. These settings have no effect at all on how the metric itself is computed.

**Rounding** - set the number of decimal places for rounding off displayed values of the metric.

**Prefix** - set the prefix string to be shown in front of displayed values of the metric.

**Suffix** - set the suffix string to be shown on the right side of displayed values of the metric.

When finished, click Save to save all options from both tabs and close the dialog. Click Cancel to close and not save your changes.