Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
As in attached image, I am comparing values of current month with values of previous month and accordingly giving color for the line using RGB function. The if condition is as below:
If (current value > previous value, RED, GREEN)
Till now its prefect. Problem is in representation. In attached image, Feb 2010 value is higher than of Jan month so it is in RED. Mar value is lower than Feb so it should be in GREEN. But we have a RED line between Feb n Mar. Its giving a wrong impression. Since we are moving from higher to lower value, this line should be in GREEN color. Similarly for Mar to Apr, it should be in RED color.
I can't change the if condition as that will change the business logic.
Any Idea!!
This does work as intended, the color of the line changes at the data point, thus since Mar has a lower value than Feb, the color changes to green at that point, and will be green until it reaches Apr, where it will turn red again. The problem is a definition of which point does the line belong to. I guess it would be possible to switch color midway between points, but not sure if that would make much more sense.
I'm not sure how changing the if() would change your business logic since you aren't changing any values, only the colors. And it looks like you can color it correctly if you remove the symbols and change the expression to this format:
if(current value <= next value, red, green)
See attached example.