Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I'm trying to set a color expression for a scatter chart. Basically, I would like all those balls that indicate a value > 400 to be a different color.
I've changed all the colors to a calculated value, but it's not taking. Does anybody have any suggestions what I'm doing wrong?
Thanks!
Oliver
Everything you set on the colors tab isevaluated once for the whole chart, so can not be used to set color of individual datapoints, the Background color you can set for expressions is evaluated for each datapoint, however i dont believe this is implemented for scatterchart mostly because each datapoint drives from more than one expression so could be ambigous which color to use.
Oliver, I think that sum(Price) is evaluated over all selected data here, and always >400 because of that. Try to us aggr() on the chart dimension, whatever it is, and possibly on week. Can't tell for sure without seeing dimensions and expressions, and the data model.
Everything you set on the colors tab isevaluated once for the whole chart, so can not be used to set color of individual datapoints, the Background color you can set for expressions is evaluated for each datapoint, however i dont believe this is implemented for scatterchart mostly because each datapoint drives from more than one expression so could be ambigous which color to use.
You could always overlay two charts, one for the points <= 400, one for the points > 400, but it's not really ideal - you can only mouse over and click on the top chart, and you have dual maintenance. Hopefully there's a better answer.
EDIT: Sorry, I was thinking Grid Chart. It doesn't look like it works on a scatter (except for in the legend).
I think you should be able to use the Background Color expression on the Expressions tab. Set the background color to the color expression you used above.
I just did a test and used:
if(Sum(Sales) > 50, RGB(255, 0, 0))
If the value is greater than 50, it is red, if not, it goes to the default color (from the Colors tab). If you use your expression, it would completely ignore the Color tab.
Thanks for your input! It looks like Johan may (unfortunately) correct - I've tried using aggr(). It worked in a regular pivot table, but when I change the chart to scatter, it doesn't. Looks like I'm SOL! This would be a really cool feature to implement, though.
Cheers,
Oliver
OK, I think I have it, though I DO agree that QlikView should be able to do this by merely setting the color expression.
Add a calculated second dimension like aggr(if(sum(Price)>400,'Price > 400','Price <= 400'),FirstDimension). As long as you have prices both over and less than 400, it will use the first color in the chart for > 400, and the second for <= 400. See attached.
I was able to duplicate the problem in 8.5 by hitting refresh a bunch of times. What it looks like to me is that if ALL of the data points have the same value for our calculated dimension, then similar to drill down groups, it will simply ignore that dimension. I don't know if that will or will not be a problem in your real application, but it's definitely a potential problem when they start making selections. While I don't know, it sounds like the sort of default behavior that we wouldn't be able to fix.
(Edit: Verified same behavior in 9.0)