Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
robmarr789
Contributor
Contributor

Colour scatter points relative to reference lines

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 points are set relative to the percentile so will move as and when new data is added.

12 Replies
bc-thebruuu
Creator
Creator

Why a new post?

What's the difference with https://community.qlik.com/thread/301500   ?

robmarr789
Contributor
Contributor
Author

If you look the source data is formatted differently meaning my expressions are different. I'm not sure how to rearrange the colour definition

bc-thebruuu
Creator
Creator

ok

OkOk
Let's work step by step.
First . in  the expressions, you need to use set analysis
"Sales",
SUM({<Year = {"=$(=Year(Today()))"}>}Sales)
"Variance"
SUM({<Year = {"=$(=Year(Today()))"}>}Sales)-SUM({<Year = {"=$(=Year(Today())-1)"}>}Sales)
robmarr789
Contributor
Contributor
Author

Thanks for the help. Now my chart looks like this?

bc-thebruuu
Creator
Creator

Here's a first step implementation ...
I added a YearType column in the script, with values PY (Present Year) and LY (Last Year), null otherwise
Please note that Today is calculated at Refresh Time ... you should probably use the Now function
Please note that with the given data you only have two "quadrants"
bc-thebruuu
Creator
Creator

Good,

You can now apply formulas similar to the one we saw beforesample_sales3.png

robmarr789
Contributor
Contributor
Author

Sorry I'm confused the points on the chart are not displayed as they were before.

For instance there are no negative variances

bc-thebruuu
Creator
Creator

When I opened the original app, there were no data

robmarr789
Contributor
Contributor
Author

Sorry this has become too complicated for my skill level. I wanted a solution similar to the first post without having to use set analysis.

Don't worry, thanks for your help though