Formula Indicator to return string value

venori26
Tera Contributor

Hello team,

 

I am trying to use formula indicator to return a string value based on a condition something like:

 

If ([[indicator1]]/[[indicator2]] < 5) {"good"} else {"bad"}

 

Apparently formula indicator returns only numeric values.

 

Is there any work around?

 

Thanks in advance

1 REPLY 1

AnkaRaoB
Kilo Guru

Hi @venori26 ,

 

In Performance Analytics, Formula Indicators only return numeric values, not strings. To achieve Good / Bad logic, use a numeric formula + thresholds.

Steps to follow

  1. Create or identify base indicators
    Ensure both inputs are Performance Analytics indicators that return numeric values.
  2. Create a Formula Indicator
    • Navigate to Performance Analytics --Indicators
    • Type: Formula
    • Add the formula:
    • IF([[Indicator 1]] / [[Indicator 2]] < 5, 1, 0)
      • 1 = Good
      • 0 = Bad
  3. Collect scores
    Formula indicators calculate only after scores are collected.
    Run Collect Scores or wait for the scheduled job.
  4. Configure thresholds
    Add thresholds to translate numeric values into text:
    • 1 - Good (Green)
    • 0 - Bad (Red)
  5. Display on a dashboard
    Use a Single Score or Scorecard widget and enable labels/colors to show Good or Bad instead of numbers.

Alternative approach

Keep the formula numeric:

[[Indicator 1]] / [[Indicator 2]]

Then apply thresholds:

  • < 5 - Good
  • >= 5 - Bad

If my response helped mark as helpful and accept the solution