Conditional formatting

Hi,

I am trying to format a cell based on the value of another cell:

  1. <95% to Plan or Forecast
  2. 99.9% to 95% Plan or Forecast
  3. 100% to 105% to Plan or Forecast
  4. 105% to Plan or Forecast
    I have used the follow, moving the position (I thought it could have the same behavior of rules in TM1):;
    {
    “readOnly”: true,
    “dataColumn”: “Percentage”,
    “condition”: “>”,
    “value”: “1.05”,
    “className”: “bg-blue-header-row”
    },
    {
    “condition”: “<”,
    “dataColumn”: “Percentage”,
    “value”: “0.95”,
    “className”: “bg-red-100”,
    “readOnly”: true
    },
    {
    “condition”: “>=”,
    “dataColumn”: “Percentage”,
    “readOnly”: true,
    “value”: “1”,
    “className”: “bg-light-green-500”
    },
    {
    “condition”: “>=”,
    “dataColumn”: “Percentage”,
    “readOnly”: true,
    “value”: “0.95”,
    “className”: “bg-yellow-header-row”
    }

Is there a condition “in between” or a way to let it works the statement above?

try the following order

{
“condition”: “<”,
“dataColumn”: “Percentage”,
“value”: “0.95”,
“className”: “bg-red-100”,
“readOnly”: true
},
{
“condition”: “>=”,
“dataColumn”: “Percentage”,
“readOnly”: true,
“value”: “0.95”,
“className”: “bg-yellow-header-row”
},
{
“condition”: “>=”,
“dataColumn”: “Percentage”,
“readOnly”: true,
“value”: “1”,
“className”: “bg-light-green-500”
},
{
“readOnly”: true,
“dataColumn”: “Percentage”,
“condition”: “>”,
“value”: “1.05”,
“className”: “bg-blue-header-row”
}
1 Like

Still not working

Hi Filippo,

If you need to do “ranges” of the condition, you can probably achieve this using the “condition2”, “value2” option on each portion.
If you look form the GUI (the blue wrench for the settings), under Column Format, and you click on the + sign for the conditions, you have a secondary condition option, meaning you could do something like “>=0.95 and < 1”

In your example, should look something like this:

{
“dataColumn”: “Percentage”,
“condition”: “<”,
“value”: “0.95”,
“className”: “bg-red-100”,
“readOnly”: true
},
{
“dataColumn”: “Percentage”,
“readOnly”: true,
“condition”: “>=”,
“value”: “0.95”,
“condition2”: “<”,
“value2”: “1”,
“className”: “bg-yellow-header-row”
},
{
“dataColumn”: “Percentage”,
“readOnly”: true,
“condition”: “>=”,
“value”: “1”,
“condition2”: “<=”,
“value2”: “1.05”,
“className”: “bg-light-green-500”
},
{
“readOnly”: true,
“dataColumn”: “Percentage”,
“condition”: “>”,
“value”: “1.05”,
“className”: “bg-blue-header-row”
}

Hope this helps.

Note: Careful with the double quotes sign when copying the code from the Forum or other external websire, as sometimes it becomes a special charactere, so make sure it is the correct double quote when adding it on UX.

1 Like

Rodrigo superstar!

1 Like