Dear community,
When using a CollorPallete expression on a statistics table the following code works:
<format type="color" field="myField">
<colorPalette type="expression">if (value == "DEBUG", "#f54242","#65A637")
</colorPalette>
</format>
#F54242 = RED
#65A637 = GREEN
Because the data in myField is not exactly "DEBUG" , the table collumns are all green. So in order to make the collumns with "DEBUG" red and the rest green, I tried the following piece of code:
<format type="color" field="myField">
<colorPalette type="expression">if (like(value,"%DEBUG%", "#f54242","#65A637")
</colorPalette>
</format>
This piece of code is not working at all. I am trying to use the wildcard to find any occurance of "DEBUG" inside myField. Not only are the fields not red, they are not even green, making me think my code is incorrect.
What am I doing wrong?
Thanks.
You need to close the brackets of the like function
if (like(value,"%DEBUG%"), "#f54242","#65A637")
If that doesn't work, try the match function.
You need to close the brackets of the like function
if (like(value,"%DEBUG%"), "#f54242","#65A637")
If that doesn't work, try the match function.
Whoops. Small mistake. Got it working. Thanks!