Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I wanted to have persistent colors for field values. I successfully did this by attaching an Excel table with RGB codes, and putting RGB(R,G,B) in Chart Properties -> Background Color.
However, I have a new problem. I have a chart with Dimension Limits -> Show Only Largest 10 Values. I want to show 'Others'. However, how can I set the color for 'Others'? I cannot use the setting in the Colors tab anymore, because I am using a definition in Expressions-> Background Color. Is using an IF statement the only way to do this? If so, can anyone provide the syntax?
Thanks!
Ok. no point in not using the simple solution if we don't have too:)
I adapted my expression to your QVW and 2 dimensions. See it below. Fluorescent green is not a mandatory color either
If(
isnull(rank( aggr(sum(Amount),Year,Country) )) ,
LightGreen(),
rgb(R,G,B)
)
Still looking for a solution to this problem. Anyone have a suggestion?
Here is a solution using rank() to figure out if its 'Others' or not
Hi Jon,
Thank you very much for your reply and the QVW. Unfortunately it does not seem to be working. My graph is using two dimensions, both Country and Year, to display stacked bar charts over time. In that case do I need to do anything differently?
Not sure. Can you share a sample that matches what you are trying to do ?
Here you go. This QVW is using a hierarchy function, I hope it does not confuse you. You will see that I have set dimension limit to 4 - please let me know how I can control the colors of both the first 3 values, and also "Others".
hmm... in this QVW sample the colors tab / 'others' color setting seems to work.
Here is sample color change :
Hi Jon,
Sorry - I was not being clear what my problem was. Please see the new attached QVW and excel data file. I have used rgb(R,G,B) for Background Colors expression in order to control Country color. However, this forces Others to become black. Is there a way to control Others color if I am using RGB function?
Ok. no point in not using the simple solution if we don't have too:)
I adapted my expression to your QVW and 2 dimensions. See it below. Fluorescent green is not a mandatory color either
If(
isnull(rank( aggr(sum(Amount),Year,Country) )) ,
LightGreen(),
rgb(R,G,B)
)
It worked! Thank you so, SO much Jon! Just had to include the second dimension in the aggr function, duh!