Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am new to QlikView and have limited expression creation experienced so was hoping someone might be able to help me out. I am trying to get a scatter chart to show only 2 colors for values - red for under 25% and green for over 25%. A simplified version of the data in the scatter chart is below (excel extract from scatter chart) -
Item | Number of requests | % sales |
1 | 278 | 15% |
2 | 122 | 23% |
3 | 898 | 20% |
4 | 231 | 9% |
5 | 847 | 20% |
6 | 57 | 14% |
7 | 401 | 17% |
8 | 63 | 11% |
9 | 280 | 16% |
10 | 348 | 26% |
11 | 918 | 40% |
12 | 334 | 40% |
13 | 35 | 17% |
14 | 40 | 8% |
15 | 354 | 36% |
16 | 1,000 | 21% |
17 | 283 | 29% |
18 | 167 | 21% |
19 | 69 | 12% |
20 | 193 | 27% |
21 | 90 | 23% |
The number of request is a based off an expression counting individual requests and forms the X axis and the % Sales is based off an expression counting the number of requests that convert into sales and forms the Y axis.
I am trying to get the scatter chart to color all values red where they are under 25% (e.g.. item 1, 2 3...) and green when they are 25% and over (e.g.. item 10,11,12..).
I have tried to look through the forum for a similar answer but not found anything I can readily apply to this - I have had various attempts at trying to apply a formula to the "background color" part in the expression and applying a formula in the actual color tab for the chart by selecting "Calculated" and then putting in a formula.
I suspect this is relatively easy to do and I am just missing something but if anyone can help it will be appreciated?
Regards
Hoppy
this color formula in the "background color" expression has to work:
if ([% sales] < 0.25, red(), green())
did you try in backgroundcolor of first expression ?
= if( [% sales] < 0.25, red(), green())
You are trying in the right places. If it isn't working it might depend how are you calculating the "% Sales" value.
your color formula in the "background color" expression should be like:
if ([% sales] < 0.25, red(), green())
or maybe:
if ([% sales] < '25 %', red(), green())
or
if ([% sales] < 25, red(), green())
Like I said, It depends on how you calculate de % Sales. Maybe if you could paste your % Sales expression we can help you more.
Cheers.
Luis.
Thanks for your responses the calculation for the % sales is below -
Count ( {$<[Sale/Miss]= {"Sale"}, Prodsub={1}>} [Call Id])
/
Count ( {$<Prodsub={1}>} [Call Id])
(Prodsub is a type of item as we are only looking at a certain segment of the results)
this color formula in the "background color" expression has to work:
if ([% sales] < 0.25, red(), green())