this is my first post on this forum and I have the following quesiton: is it possible to apply a condtional format based on an attribute?
My use case is the following, I have a view with KPIs in the rows. They have different condtional formats, for instance:
Measure | condition
Market share | positive only, between 0 and 1
Units | positive only
Price | positive only
do you have by any chance a code snippet for that ?
I’m not sure how I can put both combined conditions:
this one relying on the attribute column
{
“dataColumn”: “checkSchema”,
“condition”: “=”,
“value”: “positive only”,
“className”: “kpi-green”
}
and this one relying on the value of the cell:
{
“condition”: “<”,
“value”: “0”,
“className”: “bg-red-100”
}
I do not know if it is possible to apply classes and combine them.
When we had a similar requirement, we created an additional custom class containing both formats of the classes
Alternatively, if it has more complex conditions, you could solve this in the Cube as a rule, then just add the result on the View as an extra column, and then simply apply Conditional formatting based on this result in UX.