Hi all
I have the following query for a single value visualisation:
| stats count(eval(completedDate < TargetDate)) as completed, count(number) as total
| eval percentage = round((completed/total)*100, 2)." %"
The visualisation is the percentage. I need to change the colors to red and green based on the value of the percentage. This I managed to do. However, I need to change the color of the value to grey if total<5. Is this possible to do, or not?
Thanks in advance.
Yes, you have control over the colors in a SV. Click on the format icon for the visualization then click on the Color tab on the left. Enter the levels for each range and click on the colored box to choose the color for that range. Use the "Add Range" button if you need more ranges. Changes are saved when you close the formatter.
Hi, Thank you for your quick reply. Unfortunately the output of this single value is not the 'total' value (numeric), but the 'percentage' value (string). I was wondering if I can change the color of the percentage value if the total value is <5.
If the value is a string then it cannot be compared to a number.
The fix is to remove the "%" from the value and let the SV visualization add it in for you using the "Number Format" tab in the formatter.