Hello,
I have a structure with multiple filters. One of the columns I use is Count Sub-Items.
I would like to have another column which contains a colored box depending on the amount of sub-items I have.
For example:
- if count sub-items = 0, then show a green box with text "OK"
- if count sub-items < 10, then show a yellow box with text "Check"
- if count sub-items >= 10, then show a red box with text "Risk"
Could you please help?
Hello @Julia M_ ,
Welcome to the Community!
This should work for you:
with _count = SUM#children{1}:
with _format(text,color) =
"""{panel:borderStyle=solid|borderColor=white|bgColor=$color}$text{panel}""":
IF _count = 0:
_format("OK","green")
ELSE IF _count < 10:
_format("Check","yellow")
ELSE:
_format("Risk","red")
Please set the option from General to Wiki Markup
It starts off with defining a local variable _count. This will essentially count all of the sub-items under each parent.
Next, we create a function for the formating
Lastly, we use the conditional statements to define which values to display the correct text and box color for.
Please let me know if this helps!
Best,
David
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.