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 ACCEPTED SOLUTION

AndersBGS
Tera Patron

Hi @venori26 ,

 

This is not how  formula indicators work. Formula indicators is for mathematical calculation and will return a score of some sort - not a string. 

 

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

View solution in original post

5 REPLIES 5

AnkaRaoB
Giga 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

Thanks for the response!

May I know where to apply the threshold?

Also would like to know if we can color code the values.

 

if the value <5, then green,

<10 amber

or Red