# Metric Evaluation Logic

#1

We have a Compound Metric designed to present the value of one Simple Metric if a value exists and subtract values from two other Simple Metrics if not. The question is how the logic of the first expression is evaluated to trigger the “if false” expression.

For example, for a compound metric written as:
SimpleMetric1 ? SimpleMetric1 : SimpleMetric2 - SimpleMetric3

Are the following accurate?

1. If the SimpleMetric1 is not defined for the right Type or has an issue, then the Compound Metric would fail/error as opposed to presenting the second expression of “SimpleMetric2 - SimpleMetric3”
2. If the SimpleMetric1 has a series, but no data, it would return SimpleMetric1 with no data.
3. If SimpleMetric1 evaluates, but has no series, then the CompoundMetric would present the “if false” expression of “SimpleMetric2 - SimpleMetric3”.

#2

case `1` is true as `SimpleMetric1` will be first thing evaluated and will cause the compound metric to fail.
case `2` no data means it returns `0` i.e. `false` then `SimpleMetric2 - SimpleMetric3` will be returned.
case `3` no series means no data means `0` is returned and same as case `2`.