Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
robmarr789
New 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
bcavestro
Contributor

Re: Colour scatter points relative to reference lines

Why a new post?

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

robmarr789
New Contributor

Re: Colour scatter points relative to reference lines

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

bcavestro
Contributor

Re: Colour scatter points relative to reference lines

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
New Contributor

Re: Colour scatter points relative to reference lines

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

bcavestro
Contributor

Re: Colour scatter points relative to reference lines

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"
bcavestro
Contributor

Re: Colour scatter points relative to reference lines

Good,

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

robmarr789
New Contributor

Re: Colour scatter points relative to reference lines

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

For instance there are no negative variances

bcavestro
Contributor

Re: Colour scatter points relative to reference lines

When I opened the original app, there were no data

robmarr789
New Contributor

Re: Colour scatter points relative to reference lines

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