Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is there anyway to apply entire row making color based on condition?
I' m using the following condition for one expression and it is working fine without any issues. Main issue is that I have to apply this condition to all expressions in the straight table object. Current Table having 164 expressions.
Instead of copying same script to all expressions, Is there any way to read all expressions one time by using script?
Ex:
if(ChangeCaptured = '<--', RGB(255,0,0),
if(ChangeCaptured = '-->', RGB(0,0,255), RGB(255,255,255))
)
Please, help me to fix this issue ASAP.
You can take help of 'custom format cell'
press CTRL G then right click on top of the table , select 'custom format cell'
If it is only one condition, it should works for custom format cell. I do have multiple conditions like below,
if(ChangeCaptured = '<--') then TextColor = Red
if(ChangeCaptured = '-->') then TextColor = Blue
if(ChangeCaptured = '<--'>) then TextColor = Black
What I do in a case like this won't help with needing to repeat the expression. But it would make it much easier to modify if you want to change colors later. First thing is I would use a variable, like vColor. And you could set it to the expression you're currently using. However, if your expression depends only on the ChangeCaptured field, you might want to load the colors in script. Something like this:
[Colors]:
LOAD
ChangeCaptured
,rgb(R,G,B) as Color
INLINE [
ChangeCaptured,R,G,B
<--,255,0,0
-->,0,0,255
<-->,0,0,0
...
];
Then you could just use Color as your color expression. But it still might be safer to use a variable, even if that variable is just set to Color right now, because again, it's easier to modify later if, say, you decide you need to take more than just the ChangeCaptured into account when setting the color.
After I added color expression, still I can't see color for the attribute "ChangeCaptured". Now I can see the data for this color expression as like this RGB(0,0,255) or RGB(255,0,0) or RGB(0,0,0)
I'm not sure quite what you're saying, but I looked up a working example in case that helps.
[Types]:
LOAD
[Type]
,rgb(R,G,B) as [Color]
INLINE [
Type,R,G,B
Actual,220,91,78
SRP,113,113,185
BP,109,147,188
Act,143,173,39
Fcst,80,170,135
];