Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
robmarr789
Contributor
Contributor

Colour scatter points relative to scatter points

Can any one show me how to colour the scatter points on this chart based on the following rules

1. If points are in top right quadrant then colour Green

2. If points are in bottom right then colour Red

3. If points are in bottom left then colour Orange

4. If points are in top left then colour blue

Bare in mind the reference lines are set relative to a percentile so will move as and when new data is added.

Ideally if someone could provide the completed solution and reattach the file so I can see how you've done it it would be much appreciated.

1 Solution

Accepted Solutions
sunny_talwar

try this

=If(Sum(IF(Year = Year(Today()), Sales)) >= Fractile(TOTAL Aggr(Sum(IF(Year = Year(Today()), Sales)), CustomerGroupName), 0.5),

If(Sum(IF(Year = Year(Today()),Sales,))-Sum(IF(Year = Year(Today())-1,Sales)) > Fractile(TOTAL Aggr(Sum(IF(Year = Year(Today()),Sales,))-Sum(IF(Year = Year(Today())-1,Sales)), CustomerGroupName), 0.5), LightGreen(), LightRed()),

If(Sum(IF(Year = Year(Today()),Sales,))-Sum(IF(Year = Year(Today())-1,Sales)) > Fractile(TOTAL Aggr(Sum(IF(Year = Year(Today()),Sales,))-Sum(IF(Year = Year(Today())-1,Sales)), CustomerGroupName), 0.5), LightBlue(), LightMagenta()))

View solution in original post

4 Replies
sunny_talwar

robmarr789
Contributor
Contributor
Author

Hi Sunny,

I can see why you may think that but think time I have a slightly different problem. In the previous example the variance figures were stored in a separate column. In this example the variance is the result of an expression. I can't figure how to adjust your solution to my new scenario.

If you have a look at the script you will see how the data is stored this time

Any ideas?

sunny_talwar

try this

=If(Sum(IF(Year = Year(Today()), Sales)) >= Fractile(TOTAL Aggr(Sum(IF(Year = Year(Today()), Sales)), CustomerGroupName), 0.5),

If(Sum(IF(Year = Year(Today()),Sales,))-Sum(IF(Year = Year(Today())-1,Sales)) > Fractile(TOTAL Aggr(Sum(IF(Year = Year(Today()),Sales,))-Sum(IF(Year = Year(Today())-1,Sales)), CustomerGroupName), 0.5), LightGreen(), LightRed()),

If(Sum(IF(Year = Year(Today()),Sales,))-Sum(IF(Year = Year(Today())-1,Sales)) > Fractile(TOTAL Aggr(Sum(IF(Year = Year(Today()),Sales,))-Sum(IF(Year = Year(Today())-1,Sales)), CustomerGroupName), 0.5), LightBlue(), LightMagenta()))

robmarr789
Contributor
Contributor
Author

Fantastic, worked perfectly