Get Free Trial

Conditional formating with more complex conditions

Albert Beermann asked on August 3, 2022

Hello Everybody
I can do this:
“formula”:”#value < 10″}]
I need an example how to do something like:
if(#value < 10) { then}
else if (#value >= 10 && #value < 30 ) {then background.yellow  }
else {}
We just want to visiualize ‘traffic lights’ (green = Ok, yellow = prepare, red = upps)
We need formating based on text fields. For example:
If customername like ‘%GmbH%’ && debts > 25000 then …
means: customers with special legal forms need special attention 🙂
Any help welcomed
Best regards

3 answers

Maksym Diachenko Maksym Diachenko Flexmonster August 4, 2022

Hello, Albert!

Thank you for your questions.

“Traffic light” visualization
Flexmonster supports setting multiple conditions via conditional formatting. In the example which you have described, if-else blocks can be replaced by three separate if statements:

if( #value < 10 ) { then }
if( #value >= 10 && #value < 30 ) {then background.yellow }
if( #value >= 30 ) { then } 

These statements can be represented by placing three condition objects inside the conditions array. Please see the JSFiddle example.

Formatting based on text fields

Conditional formatting allows specifying the exact string member to which the formatting is applied by the combination of member and hierarchy properties. Kindly note that this feature does not support the usage of string filters. Also, it will highlight only the numeric measures on the grid. If you want to highlight the string members, we suggest using the customizeCell() API call.

Please see the example illustrating both the conditional formatting with member and hierarchy properties and the customizeCell usage for highlighting the string member: 

Hope you will find this information helpful. Looking forward to hearing from you.

Best Regards,

Albert Beermann August 5, 2022

Thank you!

Maksym Diachenko Maksym Diachenko Flexmonster August 5, 2022

Hello, Albert!

We are glad to hear that the suggested approaches worked for you.
Feel free to reach out to us if any other questions arise.

Best Regards,

Please login or Register to Submit Answer